[PATCH v4 14/14] x86/traps: Use fatal_trap() for #UD and #GP

Andrew Cooper posted 14 patches 3 days, 4 hours ago
[PATCH v4 14/14] x86/traps: Use fatal_trap() for #UD and #GP
Posted by Andrew Cooper 3 days, 4 hours ago
This renders the diagnostics in a more uniform way.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>

v4:
 * New

PF and CP are more complicated and not converted yet.
---
 xen/arch/x86/traps.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e2c35a046e6b..c04ab484ad27 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1375,8 +1375,7 @@ void asmlinkage do_invalid_op(struct cpu_user_regs *regs)
     if ( likely(extable_fixup(regs, true)) )
         return;
 
-    show_execution_state(regs);
-    panic("FATAL TRAP: vector = %d (invalid opcode)\n", X86_EXC_UD);
+    fatal_trap(regs, false);
 }
 
 void asmlinkage do_int3(struct cpu_user_regs *regs)
@@ -1475,8 +1474,7 @@ void do_general_protection(struct cpu_user_regs *regs)
         return;
 
  hardware_gp:
-    show_execution_state(regs);
-    panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
+    fatal_trap(regs, false);
 }
 
 #ifdef CONFIG_PV
-- 
2.39.5


Re: [PATCH v4 14/14] x86/traps: Use fatal_trap() for #UD and #GP
Posted by Jan Beulich 10 hours ago
On 28.02.2026 00:16, Andrew Cooper wrote:
> This renders the diagnostics in a more uniform way.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
Re: [PATCH v4 14/14] x86/traps: Use fatal_trap() for #UD and #GP
Posted by Jan Beulich 10 hours ago
On 28.02.2026 00:16, Andrew Cooper wrote:
> This renders the diagnostics in a more uniform way.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>