Skip to content

Commit f22cc87

Browse files
Andi KleenKAGA-KOKO
authored andcommitted
x86/speculation/l1tf: Invert all not present mappings
For kernel mappings PAGE_PROTNONE is not necessarily set for a non present mapping, but the inversion logic explicitely checks for !PRESENT and PROT_NONE. Remove the PROT_NONE check and make the inversion unconditional for all not present mappings. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
1 parent bc2d8d2 commit f22cc87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/include/asm/pgtable-invert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
static inline bool __pte_needs_invert(u64 val)
88
{
9-
return (val & (_PAGE_PRESENT|_PAGE_PROTNONE)) == _PAGE_PROTNONE;
9+
return !(val & _PAGE_PRESENT);
1010
}
1111

1212
/* Get a mask to xor with the page table entry to get the correct pfn. */

0 commit comments

Comments
 (0)