]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/mm: Do not zap page table entries mapping unaccepted memory table during kdump
authorAshish Kalra <ashish.kalra@amd.com>
Fri, 14 Jun 2024 09:58:58 +0000 (12:58 +0300)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 17 Jun 2024 15:46:12 +0000 (17:46 +0200)
commit5574b368873d4f24e2ae8fab3a1105ede252e542
treeb756a67e3791c1556f5682b9977f97b7eaf4ae95
parent06fa48d85b09b3e67afeda220bc19f7102b53beb
x86/mm: Do not zap page table entries mapping unaccepted memory table during kdump

During crashkernel boot only pre-allocated crash memory is presented as
E820_TYPE_RAM.

This can cause page table entries mapping unaccepted memory table to be zapped
during phys_pte_init(), phys_pmd_init(), phys_pud_init() and phys_p4d_init() as
SNP/TDX guest use E820_TYPE_ACPI to store the unaccepted memory table and pass
it between the kernels on kexec/kdump.

E820_TYPE_ACPI covers not only ACPI data, but also EFI tables and might be
required by kernel to function properly.

The problem was discovered during debugging kdump for SNP guest. The unaccepted
memory table stored with E820_TYPE_ACPI and passed between the kernels on kdump
was getting zapped as the PMD entry mapping this is above the E820_TYPE_RAM
range for the reserved crashkernel memory.

Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240614095904.1345461-14-kirill.shutemov@linux.intel.com
arch/x86/mm/init_64.c