OpenCloudOS-Kernel/arch/x86
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
..
boot x86/boot: Don't add the EFI stub to targets, again 2024-06-21 14:38:37 +02:00
coco x86/tdx: Fix data leak in mmio_read() 2024-09-12 11:11:25 +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/sha512-avx2 - add missing vzeroupper 2024-06-12 11:11:32 +02:00
entry x86/bhi: Avoid warning in #DB handler due to BHI mitigation 2024-07-18 13:21:27 +02:00
events perf/x86/intel: Limit the period on Haswell 2024-09-12 11:11:25 +02:00
hyperv x86/hyperv: fix kexec crash due to VP assist page corruption 2024-09-18 19:24:07 +02:00
ia32
include x86/hyperv: fix kexec crash due to VP assist page corruption 2024-09-18 19:24:07 +02:00
kernel x86/mm: Use IPIs to synchronize LAM enablement 2024-10-04 16:29:04 +02:00
kvm KVM: SVM: Don't advertise Bus Lock Detect to guest if SVM support is missing 2024-09-12 11:11:24 +02:00
lib x86/kmsan: Fix hook for unaligned accesses 2024-09-12 11:11:29 +02:00
math-emu x86/fpu: Include asm/fpu/regset.h 2023-05-18 11:56:18 -07:00
mm x86/mm: Use IPIs to synchronize LAM enablement 2024-10-04 16:29:04 +02:00
net Revert "bpf: Take return from set_memory_rox() into account with bpf_jit_binary_lock_ro()" 2024-07-09 11:44:29 +02:00
pci x86/pci/xen: Fix PCIBIOS_* return code handling 2024-08-03 08:53:21 +02:00
platform x86/platform/iosf_mbi: Convert PCIBIOS_* return codes to errnos 2024-08-03 08:53:21 +02:00
power mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:35:46 +02:00
purgatory x86/purgatory: Switch to the position-independent small code model 2024-06-12 11:11:43 +02:00
ras
realmode x86/realmode: Make stack lock work in trampoline_compat() 2023-05-30 14:11:47 +02:00
tools x86/boot: Ignore relocations in .notes sections in walk_relocs() too 2024-06-12 11:11:36 +02:00
um um: Fix the -Wmissing-prototypes warning for get_thread_reg 2024-06-12 11:12:42 +02:00
video Merge drm/drm-next into drm-misc-next 2023-07-24 15:44:47 +02:00
virt/vmx/tdx
xen xen: tolerate ACPI NVS memory overlapping with Xen allocated memory 2024-10-04 16:29:13 +02:00
.gitignore
Kbuild
Kconfig cpu: Ignore "mitigations" kernel parameter if CPU_MITIGATIONS=n 2024-06-12 11:11:24 +02:00
Kconfig.assembler x86/kconfig: Add as-instr64 macro to properly evaluate AS_WRUSS 2024-08-03 08:53:21 +02:00
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-23 09:25:10 +01:00
Kconfig.debug x86/kconfig: Select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y 2024-06-12 11:12:46 +02:00
Makefile kbuild: unify vdso_install rules 2024-06-12 11:12:32 +02:00
Makefile.postlink x86/build: Avoid relocation information in final vmlinux 2023-06-14 19:54:40 +02:00
Makefile.um um: Only disable SSE on clang to work around old GCC bugs 2023-04-04 09:57:05 +02:00
Makefile_32.cpu