From: Andrew Cooper Date: Wed, 12 Apr 2017 16:37:56 +0000 (+0100) Subject: x86/traps: Rename compat_hypercall() to entry_int82() X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2177 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=913fc4ec705f608ae34a728e6954ab5d42b36181;p=xen.git x86/traps: Rename compat_hypercall() to entry_int82() 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 Reviewed-by: Jan Beulich Release-acked-by: Julien Grall --- diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 7fcdeeab26..27fdf12edb 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -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); diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S index fb72464a2e..abf109447e 100644 --- a/xen/arch/x86/x86_64/compat/entry.S +++ b/xen/arch/x86/x86_64/compat/entry.S @@ -11,10 +11,10 @@ #include #include -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) diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index f244e105cd..1d1a4ff2da 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -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)