~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/include/asm/processor-flags.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ASM_X86_PROCESSOR_FLAGS_H
  3 #define _ASM_X86_PROCESSOR_FLAGS_H
  4 
  5 #include <uapi/asm/processor-flags.h>
  6 #include <linux/mem_encrypt.h>
  7 
  8 #ifdef CONFIG_VM86
  9 #define X86_VM_MASK     X86_EFLAGS_VM
 10 #else
 11 #define X86_VM_MASK     0 /* No VM86 support */
 12 #endif
 13 
 14 /*
 15  * CR3's layout varies depending on several things.
 16  *
 17  * If CR4.PCIDE is set (64-bit only), then CR3[11:0] is the address space ID.
 18  * If PAE is enabled, then CR3[11:5] is part of the PDPT address
 19  * (i.e. it's 32-byte aligned, not page-aligned) and CR3[4:0] is ignored.
 20  * Otherwise (non-PAE, non-PCID), CR3[3] is PWT, CR3[4] is PCD, and
 21  * CR3[2:0] and CR3[11:5] are ignored.
 22  *
 23  * In all cases, Linux puts zeros in the low ignored bits and in PWT and PCD.
 24  *
 25  * CR3[63] is always read as zero.  If CR4.PCIDE is set, then CR3[63] may be
 26  * written as 1 to prevent the write to CR3 from flushing the TLB.
 27  *
 28  * On systems with SME, one bit (in a variable position!) is stolen to indicate
 29  * that the top-level paging structure is encrypted.
 30  *
 31  * On systemms with LAM, bits 61 and 62 are used to indicate LAM mode.
 32  *
 33  * All of the remaining bits indicate the physical address of the top-level
 34  * paging structure.
 35  *
 36  * CR3_ADDR_MASK is the mask used by read_cr3_pa().
 37  */
 38 #ifdef CONFIG_X86_64
 39 /* Mask off the address space ID and SME encryption bits. */
 40 #define CR3_ADDR_MASK   __sme_clr(PHYSICAL_PAGE_MASK)
 41 #define CR3_PCID_MASK   0xFFFull
 42 #define CR3_NOFLUSH     BIT_ULL(63)
 43 
 44 #else
 45 /*
 46  * CR3_ADDR_MASK needs at least bits 31:5 set on PAE systems, and we save
 47  * a tiny bit of code size by setting all the bits.
 48  */
 49 #define CR3_ADDR_MASK   0xFFFFFFFFull
 50 #define CR3_PCID_MASK   0ull
 51 #define CR3_NOFLUSH     0
 52 #endif
 53 
 54 #ifdef CONFIG_MITIGATION_PAGE_TABLE_ISOLATION
 55 # define X86_CR3_PTI_PCID_USER_BIT      11
 56 #endif
 57 
 58 #endif /* _ASM_X86_PROCESSOR_FLAGS_H */
 59 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php