[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86: rename HAVE_GAS_* to HAVE_AS_*



Xen also uses clang's assembler when it is possible. Change the macro
names to not be GAS specific.

Patch produced with:

$ for f in `git grep HAVE_GAS_ | cut -d':' -f1`; \
    do sed -i 's/HAVE_GAS_/HAVE_AS_/g' $f; done

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/Rules.mk                  | 14 +++++++-------
 xen/arch/x86/x86_emulate/x86_emulate.c |  6 +++---
 xen/include/asm-x86/asm_defns.h        |  4 ++--
 xen/include/asm-x86/hvm/vmx/vmx.h      | 26 +++++++++++++-------------
 xen/include/asm-x86/msr.h              |  8 ++++----
 5 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index acec5ce92a..a29ab22d36 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -14,14 +14,14 @@ CFLAGS += -msoft-float
 
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
-$(call as-option-add,CFLAGS,CC,"vmcall",-DHAVE_GAS_VMX)
-$(call as-option-add,CFLAGS,CC,"crc32 %eax$$(comma)%eax",-DHAVE_GAS_SSE4_2)
-$(call as-option-add,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_GAS_EPT)
-$(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_GAS_RDRAND)
-$(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_GAS_FSGSBASE)
-$(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_GAS_RDSEED)
+$(call as-option-add,CFLAGS,CC,"vmcall",-DHAVE_AS_VMX)
+$(call as-option-add,CFLAGS,CC,"crc32 %eax$$(comma)%eax",-DHAVE_AS_SSE4_2)
+$(call as-option-add,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_AS_EPT)
+$(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,"rdseed %eax",-DHAVE_AS_RDSEED)
 $(call as-option-add,CFLAGS,CC,".equ \"x\"$$(comma)1", \
-                     -U__OBJECT_LABEL__ -DHAVE_GAS_QUOTED_SYM \
+                     -U__OBJECT_LABEL__ -DHAVE_AS_QUOTED_SYM \
                      '-D__OBJECT_LABEL__=$(subst $(BASEDIR)/,,$(CURDIR))/$$@')
 $(call as-option-add,CFLAGS,CC,"invpcid (%rax)$$(comma)%rax",-DHAVE_AS_INVPCID)
 
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c 
b/xen/arch/x86/x86_emulate/x86_emulate.c
index f02ce2cab4..02c79914dd 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6688,7 +6688,7 @@ x86_emulate(
                 goto unrecognized_insn;
 
             case 6: /* rdrand */
-#ifdef HAVE_GAS_RDRAND
+#ifdef HAVE_AS_RDRAND
                 generate_exception_if(rep_prefix(), EXC_UD);
                 host_and_vcpu_must_have(rdrand);
                 dst = ea;
@@ -6731,7 +6731,7 @@ x86_emulate(
                     dst.bytes = 4;
                     break;
                 }
-#ifdef HAVE_GAS_RDSEED
+#ifdef HAVE_AS_RDSEED
                 generate_exception_if(rep_prefix(), EXC_UD);
                 host_and_vcpu_must_have(rdseed);
                 dst = ea;
@@ -7311,7 +7311,7 @@ x86_emulate(
             ASSERT_UNREACHABLE();
         }
         break;
-#ifdef HAVE_GAS_SSE4_2
+#ifdef HAVE_AS_SSE4_2
     case X86EMUL_OPC_F2(0x0f38, 0xf0): /* crc32 r/m8, r{32,64} */
     case X86EMUL_OPC_F2(0x0f38, 0xf1): /* crc32 r/m{16,32,64}, r{32,64} */
         host_and_vcpu_must_have(sse4_2);
diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index ebd2c88a1f..24a269c546 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -71,7 +71,7 @@ void ret_from_intr(void);
 
 #ifdef __ASSEMBLY__
 
-#ifdef HAVE_GAS_QUOTED_SYM
+#ifdef HAVE_AS_QUOTED_SYM
 #define SUBSECTION_LBL(tag)                        \
         .ifndef .L.tag;                            \
         .equ .L.tag, 1;                            \
@@ -152,7 +152,7 @@ void ret_from_intr(void);
 
 #else
 
-#ifdef HAVE_GAS_QUOTED_SYM
+#ifdef HAVE_AS_QUOTED_SYM
 #define SUBSECTION_LBL(tag)                                          \
         ".ifndef .L." #tag "\n\t"                                    \
         ".equ .L." #tag ", 1\n\t"                                    \
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h 
b/xen/include/asm-x86/hvm/vmx/vmx.h
index af1f82d244..af6fe7c9a4 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -311,7 +311,7 @@ extern uint8_t posted_intr_vector;
 #define INVVPID_ALL_CONTEXT                     2
 #define INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL 3
 
-#ifdef HAVE_GAS_VMX
+#ifdef HAVE_AS_VMX
 # define GAS_VMX_OP(yes, no) yes
 #else
 # define GAS_VMX_OP(yes, no) no
@@ -320,7 +320,7 @@ extern uint8_t posted_intr_vector;
 static always_inline void __vmptrld(u64 addr)
 {
     asm volatile (
-#ifdef HAVE_GAS_VMX
+#ifdef HAVE_AS_VMX
                    "vmptrld %0\n"
 #else
                    VMPTRLD_OPCODE MODRM_EAX_06
@@ -330,7 +330,7 @@ static always_inline void __vmptrld(u64 addr)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_GAS_VMX
+#ifdef HAVE_AS_VMX
                    : "m" (addr),
 #else
                    : "a" (&addr),
@@ -342,7 +342,7 @@ static always_inline void __vmptrld(u64 addr)
 static always_inline void __vmpclear(u64 addr)
 {
     asm volatile (
-#ifdef HAVE_GAS_VMX
+#ifdef HAVE_AS_VMX
                    "vmclear %0\n"
 #else
                    VMCLEAR_OPCODE MODRM_EAX_06
@@ -352,7 +352,7 @@ static always_inline void __vmpclear(u64 addr)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_GAS_VMX
+#ifdef HAVE_AS_VMX
                    : "m" (addr),
 #else
                    : "a" (&addr),
@@ -364,7 +364,7 @@ static always_inline void __vmpclear(u64 addr)
 static always_inline void __vmread(unsigned long field, unsigned long *value)
 {
     asm volatile (
-#ifdef HAVE_GAS_VMX
+#ifdef HAVE_AS_VMX
                    "vmread %1, %0\n\t"
 #else
                    VMREAD_OPCODE MODRM_EAX_ECX
@@ -373,7 +373,7 @@ static always_inline void __vmread(unsigned long field, 
unsigned long *value)
                    UNLIKELY_START(be, vmread)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
-#ifdef HAVE_GAS_VMX
+#ifdef HAVE_AS_VMX
                    : "=rm" (*value)
                    : "r" (field),
 #else
@@ -387,7 +387,7 @@ static always_inline void __vmread(unsigned long field, 
unsigned long *value)
 static always_inline void __vmwrite(unsigned long field, unsigned long value)
 {
     asm volatile (
-#ifdef HAVE_GAS_VMX
+#ifdef HAVE_AS_VMX
                    "vmwrite %1, %0\n"
 #else
                    VMWRITE_OPCODE MODRM_EAX_ECX
@@ -397,7 +397,7 @@ static always_inline void __vmwrite(unsigned long field, 
unsigned long value)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_GAS_VMX
+#ifdef HAVE_AS_VMX
                    : "r" (field) , "rm" (value),
 #else
                    : "a" (field) , "c" (value),
@@ -467,7 +467,7 @@ static always_inline void __invept(unsigned long type, 
uint64_t eptp)
         type = INVEPT_ALL_CONTEXT;
 
     asm volatile (
-#ifdef HAVE_GAS_EPT
+#ifdef HAVE_AS_EPT
                    "invept %0, %1\n"
 #else
                    INVEPT_OPCODE MODRM_EAX_08
@@ -477,7 +477,7 @@ static always_inline void __invept(unsigned long type, 
uint64_t eptp)
                    _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
-#ifdef HAVE_GAS_EPT
+#ifdef HAVE_AS_EPT
                    : "m" (operand), "r" (type),
 #else
                    : "a" (&operand), "c" (type),
@@ -496,7 +496,7 @@ static always_inline void __invvpid(unsigned long type, u16 
vpid, u64 gva)
 
     /* Fix up #UD exceptions which occur when TLBs are flushed before VMXON. */
     asm volatile ( "1: "
-#ifdef HAVE_GAS_EPT
+#ifdef HAVE_AS_EPT
                    "invvpid %0, %1\n"
 #else
                    INVVPID_OPCODE MODRM_EAX_08
@@ -508,7 +508,7 @@ static always_inline void __invvpid(unsigned long type, u16 
vpid, u64 gva)
                    "2:"
                    _ASM_EXTABLE(1b, 2b)
                    :
-#ifdef HAVE_GAS_EPT
+#ifdef HAVE_AS_EPT
                    : "m" (operand), "r" (type),
 #else
                    : "a" (&operand), "c" (type),
diff --git a/xen/include/asm-x86/msr.h b/xen/include/asm-x86/msr.h
index a5072a2d5e..b289b582f4 100644
--- a/xen/include/asm-x86/msr.h
+++ b/xen/include/asm-x86/msr.h
@@ -124,7 +124,7 @@ static inline unsigned long __rdfsbase(void)
 {
     unsigned long base;
 
-#ifdef HAVE_GAS_FSGSBASE
+#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "rdfsbase %0" : "=r" (base) );
 #else
     asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc0" : "=a" (base) );
@@ -137,7 +137,7 @@ static inline unsigned long __rdgsbase(void)
 {
     unsigned long base;
 
-#ifdef HAVE_GAS_FSGSBASE
+#ifdef HAVE_AS_FSGSBASE
     asm volatile ( "rdgsbase %0" : "=r" (base) );
 #else
     asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc8" : "=a" (base) );
@@ -173,7 +173,7 @@ static inline unsigned long rdgsbase(void)
 static inline void wrfsbase(unsigned long base)
 {
     if ( cpu_has_fsgsbase )
-#ifdef HAVE_GAS_FSGSBASE
+#ifdef HAVE_AS_FSGSBASE
         asm volatile ( "wrfsbase %0" :: "r" (base) );
 #else
         asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd0" :: "a" (base) );
@@ -185,7 +185,7 @@ static inline void wrfsbase(unsigned long base)
 static inline void wrgsbase(unsigned long base)
 {
     if ( cpu_has_fsgsbase )
-#ifdef HAVE_GAS_FSGSBASE
+#ifdef HAVE_AS_FSGSBASE
         asm volatile ( "wrgsbase %0" :: "r" (base) );
 #else
         asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8" :: "a" (base) );
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.