arch/x86/include/asm/tlb.h

Source file repositories/reference/linux-study-clean/arch/x86/include/asm/tlb.h

File Facts

System
Linux kernel
Corpus path
arch/x86/include/asm/tlb.h
Extension
.h
Size
5292 bytes
Lines
167
Domain
Architecture Layer
Bucket
arch/x86
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

static inline void __invlpgb_all(unsigned long asid, unsigned long pcid, u8 flags) { }
static inline void __tlbsync(void) { }
#endif

static inline void invlpgb_flush_user_nr_nosync(unsigned long pcid,
						unsigned long addr,
						u16 nr, bool stride)
{
	enum addr_stride str = stride ? PMD_STRIDE : PTE_STRIDE;
	u8 flags = INVLPGB_FLAG_PCID | INVLPGB_FLAG_VA;

	__invlpgb(0, pcid, addr, nr, str, flags);
}

/* Flush all mappings for a given PCID, not including globals. */
static inline void invlpgb_flush_single_pcid_nosync(unsigned long pcid)
{
	__invlpgb_all(0, pcid, INVLPGB_FLAG_PCID);
}

/* Flush all mappings, including globals, for all PCIDs. */
static inline void invlpgb_flush_all(void)
{
	/*
	 * TLBSYNC at the end needs to make sure all flushes done on the
	 * current CPU have been executed system-wide. Therefore, make
	 * sure nothing gets migrated in-between but disable preemption
	 * as it is cheaper.
	 */
	guard(preempt)();
	__invlpgb_all(0, 0, INVLPGB_FLAG_INCLUDE_GLOBAL);
	__tlbsync();
}

/* Flush addr, including globals, for all PCIDs. */
static inline void invlpgb_flush_addr_nosync(unsigned long addr, u16 nr)
{
	__invlpgb(0, 0, addr, nr, PTE_STRIDE, INVLPGB_FLAG_INCLUDE_GLOBAL);
}

/* Flush all mappings for all PCIDs except globals. */
static inline void invlpgb_flush_all_nonglobals(void)
{
	guard(preempt)();
	__invlpgb_all(0, 0, INVLPGB_MODE_ALL_NONGLOBALS);
	__tlbsync();
}
#endif /* _ASM_X86_TLB_H */

Annotation

Implementation Notes