]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
x86/gdbsx: Move domain_pause_for_debugger() into gdbsx
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 20 Apr 2022 00:38:32 +0000 (01:38 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 22 Apr 2022 19:39:34 +0000 (20:39 +0100)
domain_pause_for_debugger() is guest debugging (CONFIG_GDBSX) not host
debugging (CONFIG_CRASH_DEBUG).

Move it into the new gdbsx.c to drop the (incorrect) ifdefary, and provide a
static inline in the !CONFIG_GDBSX case so callers can optimise away
everything rather than having to emit a call to an empty function.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c
xen/arch/x86/gdbsx.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/realmode.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/include/asm/debugger.h
xen/arch/x86/include/asm/gdbsx.h
xen/arch/x86/nmi.c
xen/arch/x86/traps.c

index a5048ed6546a6ba5ca72769f467a82ea6ba30bcf..a72cc9552ad68b1ee319004590043f20add746af 100644 (file)
@@ -2540,20 +2540,6 @@ static int __init cf_check init_vcpu_kick_softirq(void)
 }
 __initcall(init_vcpu_kick_softirq);
 
-void domain_pause_for_debugger(void)
-{
-#ifdef CONFIG_CRASH_DEBUG
-    struct vcpu *curr = current;
-    struct domain *d = curr->domain;
-
-    domain_pause_by_systemcontroller_nosync(d);
-
-    /* if gdbsx active, we just need to pause the domain */
-    if ( curr->arch.gdbsx_vcpu_event == 0 )
-        send_global_virq(VIRQ_DEBUGGER);
-#endif
-}
-
 /*
  * Local variables:
  * mode: C
index 59eb31fc9a6a54687327c1dcc93548f7033b3d2e..6ef46e8ea77d8de3178ff50340bdf4fa2d0b9d95 100644 (file)
@@ -18,6 +18,8 @@
 #include <xen/mm.h>
 #include <xen/domain_page.h>
 #include <xen/guest_access.h>
+#include <xen/event.h>
+
 #include <asm/gdbsx.h>
 #include <asm/p2m.h>
 
@@ -164,6 +166,18 @@ int gdbsx_guest_mem_io(struct domain *d, struct xen_domctl_gdbsx_memio *iop)
     return iop->remain ? -EFAULT : 0;
 }
 
+void domain_pause_for_debugger(void)
+{
+    struct vcpu *curr = current;
+    struct domain *d = curr->domain;
+
+    domain_pause_by_systemcontroller_nosync(d);
+
+    /* if gdbsx active, we just need to pause the domain */
+    if ( curr->arch.gdbsx_vcpu_event == 0 )
+        send_global_virq(VIRQ_DEBUGGER);
+}
+
 /*
  * Local variables:
  * mode: C
index 2455835eda62d44068572585f13867fb332e202f..0849a9dc5f41ea42f81006be8f5ff1613d9e9140 100644 (file)
@@ -58,7 +58,7 @@
 #include <asm/hvm/trace.h>
 #include <asm/hap.h>
 #include <asm/apic.h>
-#include <asm/debugger.h>
+#include <asm/gdbsx.h>
 #include <asm/hvm/monitor.h>
 #include <asm/monitor.h>
 #include <asm/xstate.h>
index cc23afa788c22dfd27b7ab1f80a1578bb335ab5b..4ac93e081015d12d89259e91c408fb49c7761a71 100644 (file)
@@ -14,7 +14,8 @@
 #include <xen/sched.h>
 #include <xen/paging.h>
 #include <xen/softirq.h>
-#include <asm/debugger.h>
+
+#include <asm/gdbsx.h>
 #include <asm/event.h>
 #include <asm/hvm/emulate.h>
 #include <asm/hvm/hvm.h>
index af9ee7cebbe08ec57ceb60ac7722caa0a4b5003e..cc8c4e9f044a2c986e9b02e05174be5de4f9bcdb 100644 (file)
@@ -51,7 +51,7 @@
 #include <asm/hvm/trace.h>
 #include <asm/hvm/monitor.h>
 #include <asm/xenoprof.h>
-#include <asm/debugger.h>
+#include <asm/gdbsx.h>
 #include <asm/apic.h>
 #include <asm/hvm/nestedhvm.h>
 #include <asm/altp2m.h>
index c5585752cae79f77494ea648dbc2561f3602c12e..9a3132356fd6c9abea6c40034e8adf32891df465 100644 (file)
@@ -26,8 +26,6 @@
 #include <asm/regs.h>
 #include <asm/processor.h>
 
-void domain_pause_for_debugger(void);
-
 #ifdef CONFIG_CRASH_DEBUG
 
 #include <xen/gdbstub.h>
index eee746fc01d09cf339937400e6b4fc2cca0c1dfe..938eb74e2e258c3ce1f692924e797c7c63911ccd 100644 (file)
@@ -9,5 +9,11 @@ struct xen_domctl_gdbsx_memio;
 
 int gdbsx_guest_mem_io(struct domain *d, struct xen_domctl_gdbsx_memio *iop);
 
+void domain_pause_for_debugger(void);
+
+#else
+
+static inline void domain_pause_for_debugger(void) {}
+
 #endif /* CONFIG_GDBSX */
 #endif /* __X86_GDBX_H__ */
index 302eaf2ff39acebe4200fc1087afabdcf3067e27..76560237480202fadb76170cbfe38145b614ca08 100644 (file)
@@ -30,7 +30,6 @@
 #include <asm/msr.h>
 #include <asm/mpspec.h>
 #include <asm/nmi.h>
-#include <asm/debugger.h>
 #include <asm/div64.h>
 #include <asm/apic.h>
 
index 84cd038dc38bc10235efa70fe70bb1538f81fb87..d91532461189385624dc3bfc9dabfd58bfef8f32 100644 (file)
@@ -58,6 +58,7 @@
 #include <xen/bitops.h>
 #include <asm/desc.h>
 #include <asm/debugreg.h>
+#include <asm/gdbsx.h>
 #include <asm/smp.h>
 #include <asm/flushtlb.h>
 #include <asm/uaccess.h>