mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
x86/cpu: Add X86_CR4_FRED macro
Add X86_CR4_FRED macro for the FRED bit in %cr4. This bit must not be changed after initialization, so add it to the pinned CR4 bits. Signed-off-by: H. Peter Anvin (Intel) <[email protected]> Signed-off-by: Xin Li <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Tested-by: Shan Kang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
This commit is contained in:
committed by
Borislav Petkov (AMD)
parent
cd19bab825
commit
ff45746fbf
@@ -139,6 +139,13 @@
|
||||
#define X86_CR4_LAM_SUP_BIT 28 /* LAM for supervisor pointers */
|
||||
#define X86_CR4_LAM_SUP _BITUL(X86_CR4_LAM_SUP_BIT)
|
||||
|
||||
#ifdef __x86_64__
|
||||
#define X86_CR4_FRED_BIT 32 /* enable FRED kernel entry */
|
||||
#define X86_CR4_FRED _BITUL(X86_CR4_FRED_BIT)
|
||||
#else
|
||||
#define X86_CR4_FRED (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* x86-64 Task Priority Register, CR8
|
||||
*/
|
||||
|
||||
@@ -382,9 +382,8 @@ out:
|
||||
}
|
||||
|
||||
/* These bits should not change their value after CPU init is finished. */
|
||||
static const unsigned long cr4_pinned_mask =
|
||||
X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP |
|
||||
X86_CR4_FSGSBASE | X86_CR4_CET;
|
||||
static const unsigned long cr4_pinned_mask = X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP |
|
||||
X86_CR4_FSGSBASE | X86_CR4_CET | X86_CR4_FRED;
|
||||
static DEFINE_STATIC_KEY_FALSE_RO(cr_pinning);
|
||||
static unsigned long cr4_pinned_bits __ro_after_init;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user