From: Andrew Cooper Subject: [PATCH v2 2/6] xen/x86: Replace unqualified ud2 instructions with BUG frames Date: Fri, 30 Oct 2015 19:59:20 +0000 Message-ID: <1446235164-29421-3-git-send-email-andrew.cooper3@citrix.com> References: <1446235164-29421-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1446235164-29421-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Kevin Tian , Jun Nakajima , Jan Beulich List-Id: xen-devel@lists.xenproject.org No functional change, other than the failure cases, which now produce a far more clear error message. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Jun Nakajima CC: Kevin Tian --- xen/arch/x86/boot/x86_64.S | 2 +- xen/arch/x86/hvm/vmx/entry.S | 2 +- xen/arch/x86/x86_64/entry.S | 4 ++-- xen/include/asm-x86/asm_defns.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S index c8bf9d0..94cf089 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 a5438a4..5a1757e 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 28c3214..d4dd8e8 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 d750f03..95ea21d 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 -- 2.1.4