linux-stable/arch/x86
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
..
boot x86/efistub: Use 1:1 file:memory mapping for PE/COFF .compat section 2024-02-05 10:24:51 +00:00
coco - Add support managing TDX host hardware 2024-01-18 13:41:48 -08:00
configs hardening updates for v6.7-rc1 2023-10-30 19:09:55 -10:00
crypto This update includes the following changes: 2024-01-10 12:23:43 -08:00
entry x86/entry_32: Add VERW just before userspace transition 2024-02-19 16:31:46 -08:00
events Performance events changes for v6.8 are: 2024-01-08 19:37:20 -08:00
hyperv x86/hyperv: Allow 15-bit APIC IDs for VTL platforms 2024-03-01 08:36:22 +00:00
ia32
include x86/xen: attempt to inflate the memory balloon on PVH 2024-03-13 17:48:26 +01:00
kernel x86/e820: Don't reserve SETUP_RNG_SEED in e820 2024-03-01 10:27:20 -08:00
kvm KVM GUEST_MEMFD fixes for 6.8: 2024-03-10 09:27:39 -07:00
lib x86/lib: Revert to _ASM_EXTABLE_UA() for {get,put}_user() fixups 2024-01-29 11:40:41 +01:00
math-emu
mm x86/mm: Regularize set_memory_p() parameters and make non-static 2024-03-01 08:31:41 +00:00
net Networking changes for 6.8. 2024-01-11 10:07:29 -08:00
pci pci-v6.8-changes 2024-01-17 16:23:17 -08:00
platform x86/xen: attempt to inflate the memory balloon on PVH 2024-03-13 17:48:26 +01:00
power
purgatory x86/purgatory: Remove LTO flags 2023-09-17 09:49:03 +02:00
ras
realmode x86/cleanups changes for v6.8: 2024-01-08 17:23:32 -08:00
tools x86/build changes for v6.8: 2024-01-08 17:22:02 -08:00
um This pull request contains the following changes for UML: 2024-01-17 10:44:34 -08:00
video fbdev: Replace fb_pgprotect() with pgprot_framebuffer() 2023-10-12 09:20:46 +02:00
virt x86/mce: Differentiate real hardware #MCs from TDX erratum ones 2023-12-12 08:46:46 -08:00
xen x86/xen: attempt to inflate the memory balloon on PVH 2024-03-13 17:48:26 +01:00
.gitignore
Kbuild
Kconfig IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
Kconfig.assembler x86/shstk: Add Kconfig option for shadow stack 2023-07-11 14:12:18 -07:00
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-09 16:28:19 +01:00
Kconfig.debug
Makefile kbuild: use 4-space indentation when followed by conditionals 2024-02-15 06:05:44 +09:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00
Makefile.um
Makefile_32.cpu