|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] x86/msr: Remove HAVE_AS_FSGSBASE
commit 56ad7a3b27c02f4dd4804cf5d8eaa8fb97c3a72e
Author: Denis Mukhin <dmukhin@xxxxxxxx>
AuthorDate: Thu Apr 3 18:23:09 2025 +0000
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Apr 3 21:29:34 2025 +0100
x86/msr: Remove HAVE_AS_FSGSBASE
The new toolchain baseline knows the {RD,WR}{F,G}SBASE instructions; no need
to carry the workaround in the code.
No functional change.
Resolves: https://gitlab.com/xen-project/xen/-/work_items/207
Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/arch/x86/arch.mk | 1 -
xen/arch/x86/include/asm/msr.h | 22 ----------------------
2 files changed, 23 deletions(-)
diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index e9fa1c92d7..6d2876b1a8 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -12,7 +12,6 @@ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
$(call cc-option-add,CFLAGS,CC,-Wnested-externs)
$(call as-option-add,CFLAGS,CC,"crc32 %eax$(comma)%eax",-DHAVE_AS_SSE4_2)
$(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND)
-$(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE)
$(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT)
$(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED)
$(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB)
diff --git a/xen/arch/x86/include/asm/msr.h b/xen/arch/x86/include/asm/msr.h
index 549d40b404..0d3b1d6374 100644
--- a/xen/arch/x86/include/asm/msr.h
+++ b/xen/arch/x86/include/asm/msr.h
@@ -152,11 +152,7 @@ static inline unsigned long __rdfsbase(void)
{
unsigned long base;
-#ifdef HAVE_AS_FSGSBASE
asm volatile ( "rdfsbase %0" : "=r" (base) );
-#else
- asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc0" : "=a" (base) );
-#endif
return base;
}
@@ -165,31 +161,19 @@ static inline unsigned long __rdgsbase(void)
{
unsigned long base;
-#ifdef HAVE_AS_FSGSBASE
asm volatile ( "rdgsbase %0" : "=r" (base) );
-#else
- asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc8" : "=a" (base) );
-#endif
return base;
}
static inline void __wrfsbase(unsigned long base)
{
-#ifdef HAVE_AS_FSGSBASE
asm volatile ( "wrfsbase %0" :: "r" (base) );
-#else
- asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd0" :: "a" (base) );
-#endif
}
static inline void __wrgsbase(unsigned long base)
{
-#ifdef HAVE_AS_FSGSBASE
asm volatile ( "wrgsbase %0" :: "r" (base) );
-#else
- asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8" :: "a" (base) );
-#endif
}
static inline unsigned long read_fs_base(void)
@@ -253,15 +237,9 @@ static inline void write_gs_shadow(unsigned long base)
if ( read_cr4() & X86_CR4_FSGSBASE )
{
asm volatile ( "swapgs\n\t"
-#ifdef HAVE_AS_FSGSBASE
"wrgsbase %0\n\t"
"swapgs"
:: "r" (base) );
-#else
- ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8\n\t"
- "swapgs"
- :: "a" (base) );
-#endif
}
else
wrmsrl(MSR_SHADOW_GS_BASE, base);
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |