x86: rename HAVE_GAS_* to HAVE_AS_*
PATCH 1/1 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---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
--- 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(-)
xen/arch/x86/Rules.mk +7 -7
@@ -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)
xen/arch/x86/x86_emulate/x86_emulate.c +3 -3
@@ -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);
xen/include/asm-x86/asm_defns.h +2 -2
@@ -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" \
xen/include/asm-x86/hvm/vmx/vmx.h +13 -13
@@ -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),
xen/include/asm-x86/msr.h +4 -4
@@ -124,7 +124,7 @@ static inline unsigned long __rdfsbase(void) {unsigned long base; -#ifdef HAVE_GAS_FSGSBASE +#ifdef HAVE_AS_FSGSBASE asmvolatile ("rdfsbase %0" :"=r" (base) );#else asmvolatile (".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 asmvolatile ("rdgsbase %0" :"=r" (base) );#else asmvolatile (".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 asmvolatile ("wrfsbase %0" ::"r" (base) );#else asmvolatile (".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 asmvolatile ("wrgsbase %0" ::"r" (base) );#else asmvolatile (".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8" ::"a" (base) );
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 02.03.18 at 17:46, <[email protected]> wrote:
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; doneSigned-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines · Wei Liu
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
andrewcoop@andrewcoop:/local/xen.git/xen$ git help refactor `git refactor' is aliased to `!sh -c 'git grep -l "$1" -- $GIT_PREFIX | xargs sed "s|$1|$2|g" -i' -'
One of my most useful git aliases :)
Quoted 2 lines
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines · Wei Liu
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
grep -Rl HAVE_GAS_ xen/ | xargs sed...
Seems simpler :) (but I have not tried it).
Quoted 2 lines
Signed-off-by Wei Liu <[email protected]>
Thanks!
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel