x86/traps: Rename compat_hypercall() to entry_int82()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 12 Apr 2017 16:37:56 +0000 (17:37 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 May 2017 08:54:28 +0000 (09:54 +0100)
This follows the Linux example of naming the entry point by how it is arrived
at, rather than its purpose.

Doing so highlights that the SAVE_VOLATILE instantiation sets up the wrong
entry_vector on the stack (although this is currently benign as we never
sysret back to a 32bit PV, and the iret path doesn't care).

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/x86/traps.c
xen/arch/x86/x86_64/compat/entry.S
xen/include/asm-x86/processor.h

index 7fcdeeab26a46771edc089b9cb9596e80bf429d8..27fdf12edbac38ea5025b5fcaf00c0197c6f6807 100644 (file)
@@ -3872,7 +3872,7 @@ void __init trap_init(void)
 
     /* The 32-on-64 hypercall vector is only accessible from ring 1. */
     _set_gate(idt_table + HYPERCALL_VECTOR,
-              SYS_DESC_trap_gate, 1, &compat_hypercall);
+              SYS_DESC_trap_gate, 1, entry_int82);
 
     /* Fast trap for int80 (faster than taking the #GP-fixup path). */
     _set_gate(idt_table + 0x80, SYS_DESC_trap_gate, 3, &int80_direct_trap);
index fb72464a2eaaf5518cb094674c48afa877646a09..abf109447e3fa93c93ef054dd6d66b0f02f75ef9 100644 (file)
 #include <public/xen.h>
 #include <irq_vectors.h>
 
-ENTRY(compat_hypercall)
+ENTRY(entry_int82)
         ASM_CLAC
         pushq $0
-        SAVE_VOLATILE type=TRAP_syscall compat=1
+        SAVE_VOLATILE type=HYPERCALL_VECTOR compat=1
         CR4_PV32_RESTORE
 
         cmpb  $0,untrusted_msi(%rip)
index f244e105cd4105e34795f8742a6e5120f5a9dab7..1d1a4ff2da6e7c7a8aff602e46729f1cb0ca22ac 100644 (file)
@@ -529,6 +529,8 @@ DECLARE_TRAP_HANDLER(simd_coprocessor_error);
 DECLARE_TRAP_HANDLER_CONST(machine_check);
 DECLARE_TRAP_HANDLER(alignment_check);
 
+DECLARE_TRAP_HANDLER(entry_int82);
+
 #undef DECLARE_TRAP_HANDLER_CONST
 #undef DECLARE_TRAP_HANDLER
 
@@ -538,7 +540,6 @@ void do_reserved_trap(struct cpu_user_regs *regs);
 
 void sysenter_entry(void);
 void sysenter_eflags_saved(void);
-void compat_hypercall(void);
 void int80_direct_trap(void);
 
 #define STUBS_PER_PAGE (PAGE_SIZE / STUB_BUF_SIZE)