From: Andrew Cooper Date: Fri, 14 Oct 2016 12:38:23 +0000 (+0100) Subject: Rename ex_record_fault to ex_record_fault_eax X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ccd5cf7242a671109d8bdfd37fd4d4b0328ac55b;p=xtf.git Rename ex_record_fault to ex_record_fault_eax It is more descriptive, and future work will introduce equivalent handlers which use different registers. While making this change, improve the asm constraints at ex_record_fault()'s current callsites. Signed-off-by: Andrew Cooper --- diff --git a/arch/x86/extable.c b/arch/x86/extable.c index 3505e25..f138701 100644 --- a/arch/x86/extable.c +++ b/arch/x86/extable.c @@ -14,11 +14,11 @@ * Sample usage: *
  *   asm volatile ("1: $INSN; 2:"
- *                 _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault)
+ *                 _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault_eax)
  *                 : "=a" (fault) : "0" (0));
  * 
*/ -bool ex_record_fault(struct cpu_regs *regs, const struct extable_entry *ex) +bool ex_record_fault_eax(struct cpu_regs *regs, const struct extable_entry *ex) { regs->ax = (uint32_t)(regs->entry_vector << 16) | regs->error_code; regs->ip = ex->fixup; diff --git a/tests/fpu-exception-emulation/main.c b/tests/fpu-exception-emulation/main.c index beca0df..7a0379c 100644 --- a/tests/fpu-exception-emulation/main.c +++ b/tests/fpu-exception-emulation/main.c @@ -72,16 +72,15 @@ static const struct test_cfg x87[] = unsigned int probe_x87(bool force) { - unsigned int fault; + unsigned int fault = 0; asm volatile ("test %[fep], %[fep];" "jz 1f;" _ASM_XEN_FEP "1: fild %[ptr]; 2:" - _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault) - : "=a" (fault) - : "0" (0), - [ptr] "m" (zero), + _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault_eax) + : "+a" (fault) + : [ptr] "m" (zero), [fep] "q" (force)); return fault; @@ -106,16 +105,15 @@ static const struct test_cfg x87_wait[] = unsigned int probe_x87_wait(bool force) { - unsigned int fault; + unsigned int fault = 0; asm volatile ("test %[fep], %[fep];" "jz 1f;" _ASM_XEN_FEP "1: wait; 2:" - _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault) - : "=a" (fault) - : "0" (0), - [fep] "q" (force)); + _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault_eax) + : "+a" (fault) + : [fep] "q" (force)); return fault; } @@ -138,16 +136,15 @@ static const struct test_cfg mmx_sse[] = unsigned int probe_mmx(bool force) { - unsigned int fault; + unsigned int fault = 0; asm volatile ("test %[fep], %[fep];" "jz 1f;" _ASM_XEN_FEP "1: movq %[ptr], %%mm0; 2:" - _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault) - : "=a" (fault) - : "0" (0), - [ptr] "m" (zero), + _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault_eax) + : "+a" (fault) + : [ptr] "m" (zero), [fep] "q" (force)); return fault; @@ -155,16 +152,15 @@ unsigned int probe_mmx(bool force) unsigned int probe_sse(bool force) { - unsigned int fault; + unsigned int fault = 0; asm volatile ("test %[fep], %[fep];" "jz 1f;" _ASM_XEN_FEP "1: movups %[ptr], %%xmm0; 2:" - _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault) - : "=a" (fault) - : "0" (0), - [ptr] "m" (zero), + _ASM_EXTABLE_HANDLER(1b, 2b, ex_record_fault_eax) + : "+a" (fault) + : [ptr] "m" (zero), [fep] "q" (force)); return fault;