linux-stable/arch
Roger Pau Monne 38620fc4e8 x86/xen: attempt to inflate the memory balloon on PVH
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>
2024-03-13 17:48:26 +01:00
..
alpha RTC for 6.8 2024-01-18 17:25:39 -08:00
arc work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
arm i.MX fixes for 6.8, round 2: 2024-03-04 15:24:28 +01:00
arm64 arm64 fix for 6.8 2024-03-07 09:36:24 -08:00
csky work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
hexagon asm-generic cleanups for 6.8 2024-01-10 18:13:44 -08:00
loongarch LoongArch: KVM: Streamline kvm_check_cpucfg() and improve comments 2024-02-23 14:36:31 +08:00
m68k kbuild: use 4-space indentation when followed by conditionals 2024-02-15 06:05:44 +09:00
microblaze Microblaze patches for 6.8-rc1 2024-01-17 11:27:23 -08:00
mips MIPS: Clear Cause.BD in instruction_pointer_set 2024-02-12 23:04:40 +01:00
nios2 percpu: 2024-01-18 15:01:28 -08:00
openrisc
parisc parisc architecture fixes for kernel v6.8-rc6: 2024-02-23 10:40:20 -08:00
powerpc powerpc fixes for 6.8 #5 2024-03-03 09:47:19 -08:00
riscv RISC-V Fixes for 6.8-rc7 2024-03-01 12:44:33 -08:00
s390 s390 fixes for 6.8-rc6 2024-02-23 09:54:13 -08:00
sh sh updates for v6.8 2024-01-20 09:24:06 -08:00
sparc A list handling fix and 64bit division on 32bit platform fix for the 2024-02-23 08:09:50 +10:00
um work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
x86 x86/xen: attempt to inflate the memory balloon on PVH 2024-03-13 17:48:26 +01:00
xtensa work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
.gitignore
Kconfig scs: add CONFIG_MMU dependency for vfree_atomic() 2024-01-25 23:52:21 -08:00