[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/debugger: Misc cleanup prior to splitting



commit 8bbc990772f35050b9efaebc0efaaead1ea0aab1
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Wed Apr 20 14:40:45 2022 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Apr 22 20:39:34 2022 +0100

    x86/debugger: Misc cleanup prior to splitting
    
     * Remove inappropriate semicolon from debugger_trap_immediate().
     * Try to explain what debugger_trap_fatal() is doing, and write it in a 
more
       legible way.
     * Drop unnecessary includes.  This includes common/domain.c which doesn't 
use
       any debugger functionality, even prior to this cleanup.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/include/asm/debugger.h | 17 +++++++++++------
 xen/common/domain.c                 |  1 -
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/include/asm/debugger.h 
b/xen/arch/x86/include/asm/debugger.h
index 9a3132356f..5bac2ee4c2 100644
--- a/xen/arch/x86/include/asm/debugger.h
+++ b/xen/arch/x86/include/asm/debugger.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /******************************************************************************
  * asm/debugger.h
  * 
@@ -22,23 +23,27 @@
 #ifndef __X86_DEBUGGER_H__
 #define __X86_DEBUGGER_H__
 
-#include <xen/sched.h>
-#include <asm/regs.h>
-#include <asm/processor.h>
-
 #ifdef CONFIG_CRASH_DEBUG
 
 #include <xen/gdbstub.h>
+#include <xen/stdbool.h>
+
+#include <asm/x86-defns.h>
 
+/* Returns true if GDB handled the trap, or it is surviveable. */
 static inline bool debugger_trap_fatal(
     unsigned int vector, struct cpu_user_regs *regs)
 {
     int rc = __trap_to_gdb(regs, vector);
-    return ((rc == 0) || (vector == TRAP_int3));
+
+    if ( rc == 0 )
+        return true;
+
+    return vector == X86_EXC_BP;
 }
 
 /* Int3 is a trivial way to gather cpu_user_regs context. */
-#define debugger_trap_immediate() __asm__ __volatile__ ( "int3" );
+#define debugger_trap_immediate() __asm__ __volatile__ ( "int3" )
 
 #else
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 351029f8b2..8d2c2a9897 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -33,7 +33,6 @@
 #include <xen/xenoprof.h>
 #include <xen/irq.h>
 #include <xen/argo.h>
-#include <asm/debugger.h>
 #include <asm/p2m.h>
 #include <asm/processor.h>
 #include <public/sched.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.