mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86: FRED enumerations
Of note, CR4.FRED is bit 32 and cannot enabled outside of 64bit mode. Most supported toolchains don't understand the FRED instructions yet. Nevertheless, ERETU and ERETS are easy to wrap (they encoded as REPZ/REPNE CLAC), while LKGS turns out not to be needed by Xen. We will need some alternatives based on FRED, so add a synthetic X86_FEATURE_XEN_FRED. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
cf55bb7872
commit
d45113dddf
6 files changed
+27
-1
No files matched your search
@@ -4,6 +4,14 @@
|
||||
.byte 0x0f, 0x01, 0xfc
|
||||
.endm
|
||||
|
||||
/* binutils >= 2.41 or LLVM >= 19 */
|
||||
.macro eretu
|
||||
.byte 0xf3, 0x0f, 0x01, 0xca
|
||||
.endm
|
||||
.macro erets
|
||||
.byte 0xf2, 0x0f, 0x01, 0xca
|
||||
.endm
|
||||
|
||||
/*
|
||||
* Call a noreturn function. This could be JMP, but CALL results in a more
|
||||
* helpful backtrace. BUG is to catch functions which do decide to return...
|
||||
|
||||
@@ -246,6 +246,9 @@ static inline bool boot_cpu_has(unsigned int feat)
|
||||
#define cpu_has_avx_vnni boot_cpu_has(X86_FEATURE_AVX_VNNI)
|
||||
#define cpu_has_avx512_bf16 boot_cpu_has(X86_FEATURE_AVX512_BF16)
|
||||
#define cpu_has_cmpccxadd boot_cpu_has(X86_FEATURE_CMPCCXADD)
|
||||
#define cpu_has_fred boot_cpu_has(X86_FEATURE_FRED)
|
||||
#define cpu_has_lkgs boot_cpu_has(X86_FEATURE_LKGS)
|
||||
#define cpu_has_nmi_src boot_cpu_has(X86_FEATURE_NMI_SRC)
|
||||
#define cpu_has_avx_ifma boot_cpu_has(X86_FEATURE_AVX_IFMA)
|
||||
|
||||
/* CPUID level 0x80000021.eax */
|
||||
|
||||
@@ -18,7 +18,7 @@ XEN_CPUFEATURE(ARCH_PERFMON, X86_SYNTH( 3)) /* Intel Architectural PerfMon
|
||||
XEN_CPUFEATURE(TSC_RELIABLE, X86_SYNTH( 4)) /* TSC is known to be reliable */
|
||||
XEN_CPUFEATURE(XTOPOLOGY, X86_SYNTH( 5)) /* cpu topology enum extensions */
|
||||
XEN_CPUFEATURE(CPUID_FAULTING, X86_SYNTH( 6)) /* cpuid faulting */
|
||||
/* Bit 7 unused */
|
||||
XEN_CPUFEATURE(XEN_FRED, X86_SYNTH( 7)) /* Xen uses FRED */
|
||||
XEN_CPUFEATURE(APERFMPERF, X86_SYNTH( 8)) /* APERFMPERF */
|
||||
XEN_CPUFEATURE(MFENCE_RDTSC, X86_SYNTH( 9)) /* MFENCE synchronizes RDTSC */
|
||||
XEN_CPUFEATURE(XEN_SMEP, X86_SYNTH(10)) /* SMEP gets used by Xen itself */
|
||||
|
||||
@@ -115,6 +115,17 @@
|
||||
#define MCU_OPT_CTRL_GDS_MIT_DIS (_AC(1, ULL) << 4)
|
||||
#define MCU_OPT_CTRL_GDS_MIT_LOCK (_AC(1, ULL) << 5)
|
||||
|
||||
#define MSR_FRED_RSP_SL0 0x000001cc
|
||||
#define MSR_FRED_RSP_SL1 0x000001cd
|
||||
#define MSR_FRED_RSP_SL2 0x000001ce
|
||||
#define MSR_FRED_RSP_SL3 0x000001cf
|
||||
#define MSR_FRED_STK_LVLS 0x000001d0
|
||||
#define MSR_FRED_SSP_SL0 MSR_PL0_SSP
|
||||
#define MSR_FRED_SSP_SL1 0x000001d1
|
||||
#define MSR_FRED_SSP_SL2 0x000001d2
|
||||
#define MSR_FRED_SSP_SL3 0x000001d3
|
||||
#define MSR_FRED_CONFIG 0x000001d4
|
||||
|
||||
#define MSR_RTIT_OUTPUT_BASE 0x00000560
|
||||
#define MSR_RTIT_OUTPUT_MASK 0x00000561
|
||||
#define MSR_RTIT_CTL 0x00000570
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
#define X86_CR4_PKE 0x00400000 /* enable PKE */
|
||||
#define X86_CR4_CET 0x00800000 /* Control-flow Enforcement Technology */
|
||||
#define X86_CR4_PKS 0x01000000 /* Protection Key Supervisor */
|
||||
#define X86_CR4_FRED (_AC(1, ULL) << 32) /* Fast Return and Event Delivery */
|
||||
|
||||
#define X86_CR8_VALID_MASK 0xf
|
||||
|
||||
|
||||
@@ -310,7 +310,10 @@ XEN_CPUFEATURE(ARCH_PERF_MON, 10*32+8) /* Architectural Perfmon */
|
||||
XEN_CPUFEATURE(FZRM, 10*32+10) /*A Fast Zero-length REP MOVSB */
|
||||
XEN_CPUFEATURE(FSRS, 10*32+11) /*A Fast Short REP STOSB */
|
||||
XEN_CPUFEATURE(FSRCS, 10*32+12) /*A Fast Short REP CMPSB/SCASB */
|
||||
XEN_CPUFEATURE(FRED, 10*32+17) /* Fast Return and Event Delivery */
|
||||
XEN_CPUFEATURE(LKGS, 10*32+18) /* Load Kernel GS instruction */
|
||||
XEN_CPUFEATURE(WRMSRNS, 10*32+19) /*S WRMSR Non-Serialising */
|
||||
XEN_CPUFEATURE(NMI_SRC, 10*32+20) /* NMI-Source Reporting */
|
||||
XEN_CPUFEATURE(AMX_FP16, 10*32+21) /* AMX FP16 instruction */
|
||||
XEN_CPUFEATURE(AVX_IFMA, 10*32+23) /*A AVX-IFMA Instructions */
|
||||
XEN_CPUFEATURE(LAM, 10*32+26) /* Linear Address Masking */
|
||||
|
||||