]> xenbits.xensource.com Git - xtf.git/commitdiff
Rename ex_record_fault to ex_record_fault_eax
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 14 Oct 2016 12:38:23 +0000 (13:38 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 17 Oct 2016 09:26:06 +0000 (10:26 +0100)
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 <andrew.cooper3@citrix.com>
arch/x86/extable.c
tests/fpu-exception-emulation/main.c

index 3505e25426db4edb844e21e00af2aa301225c3d4..f1387018f2e76b41a39299a31698ec36886c2771 100644 (file)
  * Sample usage:
  * <pre>
  *   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));
  * </pre>
  */
-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;
index beca0df2ecca2b217018d4f78d9ce2dec4c14dad..7a0379c3fd070768e641ed5380b3a77f668e50ff 100644 (file)
@@ -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;