OpenCloudOS-Kernel/arch
Juergen Gross ac8ec1268e xen: tolerate ACPI NVS memory overlapping with Xen allocated memory
[ Upstream commit be35d91c8880650404f3bf813573222dfb106935 ]

In order to minimize required special handling for running as Xen PV
dom0, the memory layout is modified to match that of the host. This
requires to have only RAM at the locations where Xen allocated memory
is living. Unfortunately there seem to be some machines, where ACPI
NVS is located at 64 MB, resulting in a conflict with the loaded
kernel or the initial page tables built by Xen.

Avoid this conflict by swapping the ACPI NVS area in the memory map
with unused RAM. This is possible via modification of the dom0 P2M map.
Accesses to the ACPI NVS area are done either for saving and restoring
it across suspend operations (this will work the same way as before),
or by ACPI code when NVS memory is referenced from other ACPI tables.
The latter case is handled by a Xen specific indirection of
acpi_os_ioremap().

While the E820 map can (and should) be modified right away, the P2M
map can be updated only after memory allocation is working, as the P2M
map might need to be extended.

Fixes: 808fdb7193 ("xen: check for kernel memory conflicting with memory layout")
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-04 16:29:13 +02:00
..
alpha Revert "change alloc_pages name in dma_map_ops to avoid name conflicts" 2024-09-04 13:28:24 +02:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:32:33 +02:00
arm ARM: versatile: fix OF node leak in CPUs prepare 2024-10-04 16:29:03 +02:00
arm64 arm64: dts: mediatek: mt8195: Correct clock order for dp_intf* 2024-10-04 16:29:04 +02:00
csky csky, hexagon: fix broken sys_sync_file_range 2024-07-05 09:34:02 +02:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-07-05 09:34:02 +02:00
ia64 vgacon: rework screen_info #ifdef checks 2024-06-27 13:49:15 +02:00
loongarch LoongArch: Define ARCH_IRQ_INIT_FLAGS as IRQ_NOPROBE 2024-09-30 16:25:09 +02:00
m68k m68k: Fix kernel_clone_args.flags in m68k_clone() 2024-10-04 16:29:05 +02:00
microblaze microblaze: don't treat zero reserved memory regions as error 2024-09-30 16:25:08 +02:00
mips MIPS: cevt-r4k: Don't call get_c0_compare_int if timer irq is installed 2024-09-12 11:11:39 +02:00
nios2 mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
openrisc openrisc: Call setup_memory() earlier in the init sequence 2024-08-29 17:33:39 +02:00
parisc parisc: Use irq_enter_rcu() to fix warning at kernel/context_tracking.c:367 2024-08-29 17:33:36 +02:00
powerpc powerpc/vdso: Inconditionally use CFUNC macro 2024-10-04 16:29:11 +02:00
riscv RISC-V: KVM: Fix to allow hpmcounter31 from the guest 2024-10-04 16:28:51 +02:00
s390 s390/vmlinux.lds.S: Move ro_after_init section behind rodata section 2024-09-12 11:11:38 +02:00
sh sh: rework sync_file_range ABI 2024-07-05 09:34:02 +02:00
sparc sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-03 08:53:55 +02:00
um um: line: always fill *error_out in setup_one_line() 2024-09-12 11:11:35 +02:00
x86 xen: tolerate ACPI NVS memory overlapping with Xen allocated memory 2024-10-04 16:29:13 +02:00
xtensa xtensa: fix MAKE_PC_FROM_RA second argument 2024-05-17 12:02:32 +02:00
.gitignore
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-27 13:49:15 +02:00