linux-stable/arch
Roger Pau Monne 855dced6a1 xen/x86: add extra pages to unpopulated-alloc if available
[ Upstream commit a6aa4eb994 ]

Commit 262fc47ac1 ('xen/balloon: don't use PV mode extra memory for zone
device allocations') removed the addition of the extra memory ranges to the
unpopulated range allocator, using those only for the balloon driver.

This forces the unpopulated allocator to attach hotplug ranges even when spare
memory (as part of the extra memory ranges) is available.  Furthermore, on PVH
domains it defeats the purpose of commit 38620fc4e8 ('x86/xen: attempt to
inflate the memory balloon on PVH'), as extra memory ranges would only be
used to map foreign memory if the kernel is built without XEN_UNPOPULATED_ALLOC
support.

Fix this by adding a helpers that adds the extra memory ranges to the list of
unpopulated pages, and zeroes the ranges so they are not also consumed by the
balloon driver.

This should have been part of 38620fc4e8, hence the fixes tag.

Note the current logic relies on unpopulated_init() (and hence
arch_xen_unpopulated_init()) always being called ahead of balloon_init(), so
that the extra memory regions are consumed by arch_xen_unpopulated_init().

Fixes: 38620fc4e8 ('x86/xen: attempt to inflate the memory balloon on PVH')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20240429155053.72509-1-roger.pau@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:39:37 +02:00
..
alpha Kbuild updates for v6.9 2024-03-21 14:41:00 -07:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-04-16 10:45:57 -07:00
arm ARM: configs: sunxi: Enable DRM_DW_HDMI 2024-05-30 09:44:06 +02:00
arm64 KVM: arm64: Destroy mpidr_data for 'late' vCPU creation 2024-06-12 11:39:35 +02:00
csky - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-03-26 11:07:23 -07:00
loongarch LoongArch: Fix callchain parse error with kernel tracepoint events again 2024-06-12 11:39:23 +02:00
m68k m68k: Move ARCH_HAS_CPU_CACHE_ALIASING 2024-05-30 09:44:34 +02:00
microblaze microblaze: Remove early printk call from cpuinfo-static.c 2024-06-12 11:39:14 +02:00
mips Fix for syscall_get_nr() to make it work even if tracing is disabled 2024-04-12 08:46:58 -07:00
nios2 nios2: Only use built-in devicetree blob if configured to do so 2024-04-03 14:35:53 -05:00
openrisc openrisc: traps: Don't send signals to kernel mode threads 2024-05-30 09:44:21 +02:00
parisc parisc: add missing export of __cmpxchg_u8() 2024-05-30 09:44:04 +02:00
powerpc KVM: PPC: Book3S HV nestedv2: Fix an error handling path in gs_msg_ops_kvmhv_nestedv2_config_fill_info() 2024-06-12 11:39:35 +02:00
riscv riscv: Flush the instruction cache during SMP bringup 2024-06-12 11:39:14 +02:00
s390 s390/boot: Remove alt_stfle_fac_list from decompressor 2024-06-12 11:39:25 +02:00
sh Revert "sh: Handle calling csum_partial with misaligned data" 2024-05-30 09:44:29 +02:00
sparc This includes the following changes related to sparc for v6.9: 2024-03-15 12:47:21 -07:00
um um: Fix the declaration of kasan_map_memory 2024-06-12 11:39:32 +02:00
x86 xen/x86: add extra pages to unpopulated-alloc if available 2024-06-12 11:39:37 +02:00
xtensa Xtensa fixes for v6.9: 2024-05-02 10:41:28 -07:00
.gitignore
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-04-25 15:47:35 +02:00