From: Andrew Cooper Date: Tue, 3 Nov 2015 17:14:27 +0000 (+0100) Subject: x86: replace unqualified ud2 instructions with BUG frames X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2305^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a84e4d094a25c5a6b1a2e677059abd3e19b57924;p=xen.git x86: replace unqualified ud2 instructions with BUG frames No functional change, other than the failure cases, which now produce a far more clear error message. Signed-off-by: Andrew Cooper Acked-by: Kevin Tian Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S index c8bf9d02c7..94cf08956c 100644 --- a/xen/arch/x86/boot/x86_64.S +++ b/xen/arch/x86/boot/x86_64.S @@ -34,7 +34,7 @@ ENTRY(__high_start) /* Pass off the Multiboot info structure to C land. */ mov multiboot_ptr(%rip),%edi call __start_xen - ud2 /* Force a panic (invalid opcode). */ + BUG /* __start_xen() shouldn't return. */ /*** DESCRIPTOR TABLES ***/ diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S index a5438a47f3..5a1757ed63 100644 --- a/xen/arch/x86/hvm/vmx/entry.S +++ b/xen/arch/x86/hvm/vmx/entry.S @@ -110,7 +110,7 @@ UNLIKELY_END(realmode) sti SAVE_ALL call vmx_vmentry_failure - ud2 + BUG /* vmx_vmentry_failure() shouldn't return. */ ENTRY(vmx_asm_do_vmentry) GET_CURRENT(%rbx) diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S index 28c32143f7..d4dd8e8114 100644 --- a/xen/arch/x86/x86_64/entry.S +++ b/xen/arch/x86/x86_64/entry.S @@ -547,7 +547,7 @@ exception_with_ints_disabled: FATAL_exception_with_ints_disabled: movq %rsp,%rdi call fatal_trap - ud2 + BUG /* fatal_trap() shouldn't return. */ ENTRY(divide_error) pushq $0 @@ -620,7 +620,7 @@ ENTRY(double_fault) SAVE_ALL STAC movq %rsp,%rdi call do_double_fault - ud2 + BUG /* do_double_fault() shouldn't return. */ .pushsection .init.text, "ax", @progbits ENTRY(early_page_fault) diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h index d750f03bcb..95ea21debe 100644 --- a/xen/include/asm-x86/asm_defns.h +++ b/xen/include/asm-x86/asm_defns.h @@ -324,7 +324,7 @@ static always_inline void stac(void) jne 789f cmpq UREGS_r12(%rsp),%r12 je 987f -789: ud2 +789: BUG /* Corruption of partial register state. */ .subsection 0 #endif .endif