libxl, docs: Add per-arch extra default paging memory

This commit adds a per-arch macro `EXTRA_DEFAULT_PAGING_MEM_MB`
to the default paging memory size, in order to cover the p2m
pool for extended regions of a xl-based guest on Arm.

For Arm, the extra default paging memory is 128MB.
For x86, the extra default paging memory is zero, since there
are no extended regions on x86.

Also update the xl.cfg documentation to add Arm documentation
according to code changes.

This is part of CVE-2022-33747 / XSA-409.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
This commit is contained in:
Henry Wang authored and Jan Beulich committed 2022-10-11 14:28:37 +02:00
1 parent 8a2111250b
commit 156a239ea2
3 files changed
+22 -1

No files matched your search

+5
View File
@@ -2725,6 +2725,11 @@ are not using hardware assisted paging (i.e. you are using shadow
mode) and your guest workload consists of a very large number of
similar processes then increasing this value may improve performance.
On Arm, this field is used to determine the size of the guest P2M pages
pool, and the default value is the same as x86 HAP mode, plus 512KB to
cover the extended regions. Users should adjust this value if bigger
P2M pool size is needed.
=back
=head2 Device-Model Options
+11
View File
@@ -99,10 +99,21 @@ void libxl__arch_update_domain_config(libxl__gc *gc,
#define LAPIC_BASE_ADDRESS 0xfee00000
#define ACPI_INFO_PHYSICAL_ADDRESS 0xfc000000
#define EXTRA_DEFAULT_PAGING_MEM_MB 0
int libxl__dom_load_acpi(libxl__gc *gc,
const libxl_domain_build_info *b_info,
struct xc_dom_image *dom);
#else
/*
* 128MB extra default paging memory on Arm for extended regions. This
* value is normally enough for domains that are not running backend.
* See the `shadow_memory` in xl.cfg documentation for more information.
*/
#define EXTRA_DEFAULT_PAGING_MEM_MB 128
#endif
#endif
+6 -1
View File
@@ -1035,12 +1035,17 @@ unsigned long libxl__get_required_paging_memory(unsigned long maxmem_kb,
* plus 1 page per MiB of RAM for the P2M map (for non-PV guests),
* plus 1 page per MiB of RAM to shadow the resident processes (for shadow
* mode guests).
* plus 1 page per MiB of RAM for the architecture specific
* EXTRA_DEFAULT_PAGING_MEM_MB. On x86, this value is zero. On Arm, this
* value is 128 MiB to cover domain extended regions (enough for domains
* that are not running backend).
* This is higher than the minimum that Xen would allocate if no value
* were given (but the Xen minimum is for safety, not performance).
*/
return 4 * (256 * smp_cpus +
((type != LIBXL_DOMAIN_TYPE_PV) + !hap) *
(maxmem_kb / 1024));
(maxmem_kb / 1024) +
EXTRA_DEFAULT_PAGING_MEM_MB);
}
static unsigned long libxl__get_required_iommu_memory(unsigned long maxmem_kb)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.