x86/mm: Carve out INVLPG inline asm for use by others
BugLink: https://bugs.launchpad.net/bugs/2101915 commit f1d84b59cbb9547c243d93991acf187fdbe9fbe9 upstream. No functional changes. Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/ZyulbYuvrkshfsd2@antipodes Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Stefan Bader
parent
5033ce0ecc
commit
6157330146
@@ -34,4 +34,8 @@ static inline void __tlb_remove_table(void *table)
|
||||
free_page_and_swap_cache(table);
|
||||
}
|
||||
|
||||
static inline void invlpg(unsigned long addr)
|
||||
{
|
||||
asm volatile("invlpg (%0)" ::"r" (addr) : "memory");
|
||||
}
|
||||
#endif /* _ASM_X86_TLB_H */
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/apic.h>
|
||||
#include <asm/perf_event.h>
|
||||
#include <asm/tlb.h>
|
||||
|
||||
#include "mm_internal.h"
|
||||
|
||||
@@ -1145,7 +1146,7 @@ STATIC_NOPV void native_flush_tlb_one_user(unsigned long addr)
|
||||
bool cpu_pcide;
|
||||
|
||||
/* Flush 'addr' from the kernel PCID: */
|
||||
asm volatile("invlpg (%0)" ::"r" (addr) : "memory");
|
||||
invlpg(addr);
|
||||
|
||||
/* If PTI is off there is no user PCID and nothing to flush. */
|
||||
if (!static_cpu_has(X86_FEATURE_PTI))
|
||||
|
||||
Reference in New Issue
Block a user