x86/mm: Use proper mask when setting PUD mapping
authorAaron Lu <aaron.lu@intel.com>
Fri, 19 Aug 2022 02:30:01 +0000 (10:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:39:53 +0000 (11:39 +0200)
commitd26beb910904993fdc8c8dbb610908b2c066b6a6
tree79ccd6c2526116c216a656f318bf0af99e05b844
parent177bf354200962c6f0de6dd37c86a9bf3b54003a
x86/mm: Use proper mask when setting PUD mapping

commit 88e0a74902f894fbbc55ad3ad2cb23b4bfba555c upstream.

Commit c164fbb40c43f("x86/mm: thread pgprot_t through
init_memory_mapping()") mistakenly used __pgprot() which doesn't respect
__default_kernel_pte_mask when setting PUD mapping.

Fix it by only setting the one bit we actually need (PSE) and leaving
the other bits (that have been properly masked) alone.

Fixes: c164fbb40c43 ("x86/mm: thread pgprot_t through init_memory_mapping()")
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/mm/init_64.c