These are necessary in many testcases that includes hand-written assembly, otherwise they will only run for either 32- or 64-bit. Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> --- lib/x86/desc.c | 10 ---------- lib/x86/isr.c | 6 ------ lib/x86/processor.h | 11 +++++++++++ x86/vmexit.c | 6 ------ 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/lib/x86/desc.c b/lib/x86/desc.c index f75ec1d..ac60686 100644 --- a/lib/x86/desc.c +++ b/lib/x86/desc.c @@ -101,16 +101,6 @@ void do_handle_exception(struct ex_regs *regs) exit(7); } -#ifdef __x86_64__ -# define R "r" -# define W "q" -# define S "8" -#else -# define R "e" -# define W "l" -# define S "4" -#endif - #define EX(NAME, N) extern char NAME##_fault; \ asm (".pushsection .text \n\t" \ #NAME"_fault: \n\t" \ diff --git a/lib/x86/isr.c b/lib/x86/isr.c index 9986d17..7dcd38a 100644 --- a/lib/x86/isr.c +++ b/lib/x86/isr.c @@ -3,12 +3,6 @@ #include "vm.h" #include "desc.h" -#ifdef __x86_64__ -# define R "r" -#else -# define R "e" -#endif - extern char isr_entry_point[]; asm ( diff --git a/lib/x86/processor.h b/lib/x86/processor.h index 29811d4..fabd480 100644 --- a/lib/x86/processor.h +++ b/lib/x86/processor.h @@ -4,6 +4,17 @@ #include "libcflat.h" #include <stdint.h> +#ifdef __x86_64__ +# define R "r" +# define W "q" +# define S "8" +#else +# define R "e" +# define W "l" +# define S "4" +#endif + + struct descriptor_table_ptr { u16 limit; ulong base; diff --git a/x86/vmexit.c b/x86/vmexit.c index cc24738..3bd0c81 100644 --- a/x86/vmexit.c +++ b/x86/vmexit.c @@ -47,12 +47,6 @@ static unsigned int inl(unsigned short port) static int nr_cpus; -#ifdef __x86_64__ -# define R "r" -#else -# define R "e" -#endif - static void cpuid_test(void) { asm volatile ("push %%"R "bx; cpuid; pop %%"R "bx" -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html