Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/mm: Carve out INVLPG inline asm for use by others

No functional changes.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/ZyulbYuvrkshfsd2@antipodes

+6 -1
+4
arch/x86/include/asm/tlb.h
··· 34 34 free_page_and_swap_cache(table); 35 35 } 36 36 37 + static inline void invlpg(unsigned long addr) 38 + { 39 + asm volatile("invlpg (%0)" ::"r" (addr) : "memory"); 40 + } 37 41 #endif /* _ASM_X86_TLB_H */
+2 -1
arch/x86/mm/tlb.c
··· 20 20 #include <asm/cacheflush.h> 21 21 #include <asm/apic.h> 22 22 #include <asm/perf_event.h> 23 + #include <asm/tlb.h> 23 24 24 25 #include "mm_internal.h" 25 26 ··· 1141 1140 bool cpu_pcide; 1142 1141 1143 1142 /* Flush 'addr' from the kernel PCID: */ 1144 - asm volatile("invlpg (%0)" ::"r" (addr) : "memory"); 1143 + invlpg(addr); 1145 1144 1146 1145 /* If PTI is off there is no user PCID and nothing to flush. */ 1147 1146 if (!static_cpu_has(X86_FEATURE_PTI))