// SPDX-License-Identifier: GPL-2.0 #include <linux/acpi.h> #include <linux/export.h> #include <linux/mm.h> #include <xen/hvc-console.h> #include <asm/bootparam.h> #include <asm/io_apic.h> #include <asm/hypervisor.h> #include <asm/e820/api.h> #include <asm/setup.h> #include <xen/xen.h> #include <asm/xen/interface.h> #include <asm/xen/hypercall.h> #include <xen/interface/memory.h> #include "xen-ops.h" /* * PVH variables. * * The variable xen_pvh needs to live in a data segment since it is used * after startup_{32|64} is invoked, which will clear the .bss segment. */ bool __ro_after_init xen_pvh; EXPORT_SYMBOL_GPL(…); /* * Reserve e820 UNUSABLE regions to inflate the memory balloon. * * On PVH dom0 the host memory map is used, RAM regions available to dom0 are * located as the same place as in the native memory map, but since dom0 gets * less memory than the total amount of host RAM the ranges that can't be * populated are converted from RAM -> UNUSABLE. Use such regions (up to the * ratio signaled in EXTRA_MEM_RATIO) in order to inflate the balloon driver at * boot. Doing so prevents the guest (even if just temporary) from using holes * in the memory map in order to map grants or foreign addresses, and * hopefully limits the risk of a clash with a device MMIO region. Ideally the * hypervisor should notify us which memory ranges are suitable for creating * foreign mappings, but that's not yet implemented. */ static void __init pvh_reserve_extra_memory(void) { … } static void __init pvh_arch_setup(void) { … } void __init xen_pvh_init(struct boot_params *boot_params) { … } void __init mem_map_via_hcall(struct boot_params *boot_params_p) { … }