Files
linux-stable-mirror/arch/x86/include/asm
Juergen GrossandGreg Kroah-Hartman 6b54f5c684 x86/mm: Fix __swp_entry_to_pte() for Xen PV guests
[ Upstream commit 0f88130e8a ]

Normally __swp_entry_to_pte() is never called with a value translating
to a valid PTE. The only known exception is pte_swap_tests(), resulting
in a WARN splat in Xen PV guests, as __pte_to_swp_entry() did
translate the PFN of the valid PTE to a guest local PFN, while
__swp_entry_to_pte() doesn't do the opposite translation.

Fix that by using __pte() in __swp_entry_to_pte() instead of open
coding the native variant of it.

For correctness do the similar conversion for __swp_entry_to_pmd().

Fixes: 05289402d7 ("mm/debug_vm_pgtable: add tests validating arch helpers for core MM features")
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230306123259.12461-1-jgross@suse.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-19 16:21:02 +02:00
..
2023-02-01 08:34:50 +01:00
2022-08-04 11:11:59 +02:00
2022-06-27 10:33:58 +02:00
2022-09-26 10:13:16 -07:00
2022-08-19 04:05:42 -04:00
2022-06-28 13:20:21 +02:00
2022-10-03 14:03:26 -07:00
2022-08-21 10:06:28 -07:00
2022-07-07 10:13:02 -07:00
2022-08-18 12:36:42 +02:00
2022-06-08 05:56:24 -04:00