[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] x86+libxl: correct p2m (shadow) memory pool size calculation
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Mon, 25 Apr 2022 14:59:02 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8PyDMa2lIDtTbxbzDU1eV3lPk5v0MMJf5Oc/fUPvnTo=; b=H4agiNCbaOOJG5LY5CeA3KFZvP2L9I554bWV1aa2bjSwAWm/q2fKxbEp2Zocp04Q+ULWiiI9cF+Lq6NRKJGWDOQKX6XXxCuuZOhWPLa+pJLHjR3PK3lp0FiBKF0SyqNKet8ajSPSFhOsTHEiEnEvVoLbp7u1i4CqU9oHlCp2hPOhjrJXP4REwjhAWkEYfmb9MUg9oz3vBkv7S/lF0xpkBQauQFrt9InRoJpHbXWR0WMdMo5OmY3sSyJHDd3Rri7Oo7CJ6UTM12g5q4jh01FpFqJ8RCzKz/veCEnAx2JkApUUNuQDox+9/ZTvePth52qWZkn1Y42PkQE5RJTczlSfQw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XGazSG4LpNP2E1rKPUOs/8+J36f2A3hbutcamBZawWoA8xDbS5JX9Hh90Zs/iXKylRAzPJWWhaCm/MdljlnDGy7uhuP2wEV9E+j99mRZz3YtrQHoARhXzEYmxXAS/ZGX9ghkG5l9qrA/Y8P3qRBfkUrleVX3KkIF4DL/rR+6J2IPD/ALhs/6PVuer/OF8zIfSvjs5eHAksmedftwHcOB6u1UOCrSxJ5kEZ3RYdAEf8f+mPhLrX5AY9qj0tCe8ABNx5E3dob+dt9VcmTldlGpqr8HdEkEk9c6urhwPkIHjIBXUBpleJG4Wb2EmTvwTkm5fhw413Hduzwe8JP1Jo9j8Q==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
- Delivery-date: Mon, 25 Apr 2022 12:59:20 +0000
- Ironport-data: A9a23:HZ4Wn6t7onhtTQqoYVk6IeOF2OfnVFJfMUV32f8akzHdYApBsoF/q tZmKWGFa/rfZTPzeYh+a9ixoE8E6JaAzNFgTVRurig0Qy4Q+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQyw4bVvqYy2YLjW1/X5 IuryyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDRzjlAa2e0g9VPrzF4noR5fLatA88tqBb /TC1NmEElbxpH/BPD8HfoHTKSXmSpaKVeSHZ+E/t6KK2nCurQRquko32WZ1he66RFxlkvgoo Oihu6BcRi8jO/DNqsctfCNGLABENI5e/o/GBCCg5Jn7I03uKxMAwt1IJWRvZ8g9xbwyBmtDs /sFNDoKcxaPwfqsx662QfVtgcJlK9T3OIQYuTdryjSx4fQOGMifBfmVo4EGmmtv7ixNNa+2i 84xcz1gYQ6GexRSElwWFIg/jKGjgXyXnzhw9gPF+vZsujS7IApZ8IbTHPXuQvGwAsRknEHDh 1Oc0TTFO0RPXDCY4X/fmp62vcfNly7mXIMZFJWj6+VnxlaUwwQ7GBAQEFe2v/S9okq/QM5Eb VwZ/DI0qqo//1DtScPyNzWnpFaUsxhaXMBfe8U45xuK0bH8+BuCCy4PSTspVTA9nMo/RDhv0 0DTmdrsXGZrqOfNFS3b8aqIpzSvPyRTNXUFeSIPUQoC5Z/kvZ03iRXMCN1kFcZZk+HIJN05+ BjSxABWulnZpZRjO3mTlbwfvw+Rmw==
- Ironport-hdrordr: A9a23:yPlUFqPhSOCfO8BcT4/255DYdb4zR+YMi2TDiHoBKiC9I/b5qy nxppUmPEfP+UYssQIb8+xoWZPsfZq4z/IFg7X5Uo3SIjUO1FHYSr2KzLGSvgEIeBeOsdK1t5 0QApSWYeeYZTMU47eekW3IdOrIqOP3oJxAqt2usEuFJjsaE52Imj0JcDpzZXcGPzWua6BJba Z0z/A34QaISDAyVICWF3MFV+/Mq5ngj5T9eyMLABYh9U2nkS6owKSSKWnA4j4uFxd0hZsy+2 nMlAL0oo+5teug9xPa32jPq7xLhdrazMdZDsDksLlMFtyssHfyWG1SYczegNkHmpDy1L/sqq iSn/4UBbUo15oWRBDqnfKi4Xiw7N9k0Q6Q9bbRuwqQnSW+fkNoNyM7v/MkTvKR0TtXgDmlvZ g7ql5wbPdsfGT9dP6R3am9azh60kWzunYsiugVkjhWVpYfcqZYqcgF8FpSC4poJlO51GmJKp giMCjw3ocXTbqhVQGbgoCv+q3iYl0jWhOdBkQSsM2c1DZb2Hh/0ksD3cQa2nMN7og0RZVI7/ nNdv0ArsALcuYGKaZmQOsRS8q+DWLABRrKLWKJOFziUKUKIWjEpZL76Kg8oOuqZJsLxp0vn4 mpaiIciUciP0b1TcGe1pxC9R7ABG27QDT208lbo4N0v7XtLYCbcBFqBDsV4oedS952OLyTZx 9yAuMZPxbOFxqkJW8S5Xy3Z3B7EwhVbPEo
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Apr 25, 2022 at 10:49:34AM +0200, Jan Beulich wrote:
> char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid)
> --- a/xen/arch/x86/dom0_build.c
> +++ b/xen/arch/x86/dom0_build.c
> @@ -317,9 +317,12 @@ unsigned long __init dom0_paging_pages(c
> /* Copied from: libxl_get_required_shadow_memory() */
Could you also update the comment, maybe better would be:
/* Keep in sync with libxl__get_required_paging_memory(). */
> unsigned long memkb = nr_pages * (PAGE_SIZE / 1024);
>
> - memkb = 4 * (256 * d->max_vcpus + 2 * (memkb / 1024));
> + memkb = 4 * (256 * d->max_vcpus +
> + (paging_mode_enabled(d) +
> + (opt_dom0_shadow || opt_pv_l1tf_hwdom)) *
opt_pv_l1tf_hwdom is only relevant for PV guests, so maybe it would be
best to use:
paging_mode_enabled(d) ? 1 + opt_dom0_shadow
: 0 + (opt_dom0_shadow || opt_pv_l1tf_hwdom)
Or something similar. Maybe placing this inside the sum will make the
expression too complex, so we could use a separate is_shadow boolean
to signal whether the domain will use shadow pagetables?
Thanks, Roger.
|