linux-stable/arch/x86
Roger Pau Monne 4cd44fd345 x86/xen: attempt to inflate the memory balloon on PVH
[ Upstream commit 38620fc4e8 ]

When running as PVH or HVM Linux will use holes in the memory map as scratch
space to map grants, foreign domain pages and possibly miscellaneous other
stuff.  However the usage of such memory map holes for Xen purposes can be
problematic.  The request of holesby Xen happen quite early in the kernel boot
process (grant table setup already uses scratch map space), and it's possible
that by then not all devices have reclaimed their MMIO space.  It's not
unlikely for chunks of Xen scratch map space to end up using PCI bridge MMIO
window memory, which (as expected) causes quite a lot of issues in the system.

At least for PVH dom0 we have the possibility of using regions marked as
UNUSABLE in the e820 memory map.  Either if the region is UNUSABLE in the
native memory map, or it has been converted into UNUSABLE in order to hide RAM
regions from dom0, the second stage translation page-tables can populate those
areas without issues.

PV already has this kind of logic, where the balloon driver is inflated at
boot.  Re-use the current logic in order to also inflate it when running as
PVH.  onvert UNUSABLE regions up to the ratio specified in EXTRA_MEM_RATIO to
RAM, while reserving them using xen_add_extra_mem() (which is also moved so
it's no longer tied to CONFIG_PV).

[jgross: fixed build for CONFIG_PVH without CONFIG_XEN_PVH]

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20240220174341.56131-1-roger.pau@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:07:39 +02:00
..
boot x86/boot: Move mem_encrypt= parsing to the decompressor 2024-04-10 16:36:07 +02:00
coco x86/coco: Require seeding RNG with RDRAND on CoCo systems 2024-04-10 16:36:03 +02:00
configs - The first, cleanup part of the microcode loader reorg tglx has been 2023-08-28 15:55:20 -07:00
crypto crypto: x86/sha - load modules based on CPU features 2023-11-28 17:19:56 +00:00
entry x86/bhi: Add support for clearing branch history at syscall entry 2024-04-10 16:36:07 +02:00
events perf/x86/amd/lbr: Discard erroneous branch entries 2024-04-13 13:07:37 +02:00
hyperv x86/hyperv: Use per cpu initial stack for vtl context 2024-03-26 18:20:06 -04:00
ia32
include x86/xen: attempt to inflate the memory balloon on PVH 2024-04-13 13:07:39 +02:00
kernel x86/bhi: Mitigate KVM by default 2024-04-10 16:36:08 +02:00
kvm KVM: x86: Add BHI_NO 2024-04-10 16:36:08 +02:00
lib x86/boot: Move mem_encrypt= parsing to the decompressor 2024-04-10 16:36:07 +02:00
math-emu
mm x86/boot: Move mem_encrypt= parsing to the decompressor 2024-04-10 16:36:07 +02:00
net x86/bpf: Fix IP after emitting call depth accounting 2024-04-10 16:35:48 +02:00
pci PCI: Disable D3cold on Asus B1400 PCI-NVMe bridge 2024-04-13 13:07:36 +02:00
platform x86/xen: attempt to inflate the memory balloon on PVH 2024-04-13 13:07:39 +02:00
power mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:35:46 +02:00
purgatory x86/purgatory: Remove LTO flags 2023-09-17 09:49:03 +02:00
ras
realmode
tools x86, relocs: Ignore relocations in .notes section 2024-03-26 18:19:35 -04:00
um um: Hard-code the result of 'uname -s' 2023-08-26 22:40:37 +02:00
video
virt/vmx/tdx
xen x86/xen: attempt to inflate the memory balloon on PVH 2024-04-13 13:07:39 +02:00
.gitignore
Kbuild
Kconfig x86: set SPECTRE_BHI_ON as default 2024-04-10 16:36:08 +02:00
Kconfig.assembler
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-23 09:25:10 +01:00
Kconfig.debug
Makefile Kbuild updates for v6.6 2023-09-05 11:01:47 -07:00
Makefile.postlink
Makefile.um
Makefile_32.cpu