[PATCH v3 5/6] arch/x86: move domain_pause_for_debugger() to domain.h

Bobby Eshleman posted 6 patches 3 years, 3 months ago
There is a newer version of this series
[PATCH v3 5/6] arch/x86: move domain_pause_for_debugger() to domain.h
Posted by Bobby Eshleman 3 years, 3 months ago
domain_pause_for_debugger() was previously in debugger.h.  This commit
moves it to domain.h because its implementation is in domain.c.

Signed-off-by: Bobby Eshleman <bobby.eshleman@gmail.com>
---
Changes in v3:
- domain_pause_for_debugger() is now moved into debugger.h, not a new
  file debugger.c

 xen/arch/x86/hvm/svm/svm.c      | 2 +-
 xen/arch/x86/hvm/vmx/realmode.c | 2 +-
 xen/arch/x86/hvm/vmx/vmx.c      | 2 +-
 xen/arch/x86/nmi.c              | 1 -
 xen/arch/x86/traps.c            | 1 +
 xen/include/asm-x86/debugger.h  | 2 --
 xen/include/asm-x86/domain.h    | 2 ++
 7 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 642a64b747..84448e496f 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -36,6 +36,7 @@
 #include <asm/processor.h>
 #include <asm/amd.h>
 #include <asm/debugreg.h>
+#include <asm/domain.h>
 #include <asm/msr.h>
 #include <asm/i387.h>
 #include <asm/iocap.h>
@@ -58,7 +59,6 @@
 #include <asm/hvm/trace.h>
 #include <asm/hap.h>
 #include <asm/apic.h>
-#include <asm/debugger.h>
 #include <asm/hvm/monitor.h>
 #include <asm/monitor.h>
 #include <asm/xstate.h>
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index cc23afa788..5c4b1910a9 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -14,7 +14,7 @@
 #include <xen/sched.h>
 #include <xen/paging.h>
 #include <xen/softirq.h>
-#include <asm/debugger.h>
+#include <asm/domain.h>
 #include <asm/event.h>
 #include <asm/hvm/emulate.h>
 #include <asm/hvm/hvm.h>
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e09b7e3af9..6fd59865c7 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -27,6 +27,7 @@
 #include <xen/hypercall.h>
 #include <xen/perfc.h>
 #include <asm/current.h>
+#include <asm/domain.h>
 #include <asm/io.h>
 #include <asm/iocap.h>
 #include <asm/regs.h>
@@ -51,7 +52,6 @@
 #include <asm/hvm/trace.h>
 #include <asm/hvm/monitor.h>
 #include <asm/xenoprof.h>
-#include <asm/debugger.h>
 #include <asm/apic.h>
 #include <asm/hvm/nestedhvm.h>
 #include <asm/altp2m.h>
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index ab94a96c4d..11d5f5a917 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -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>
 
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index d0a4c0ea74..5947ed25d6 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -63,6 +63,7 @@
 #include <asm/i387.h>
 #include <asm/xstate.h>
 #include <asm/debugger.h>
+#include <asm/domain.h>
 #include <asm/msr.h>
 #include <asm/nmi.h>
 #include <asm/xenoprof.h>
diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h
index ed4d5c829b..8f6222956e 100644
--- a/xen/include/asm-x86/debugger.h
+++ b/xen/include/asm-x86/debugger.h
@@ -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>
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 92d54de0b9..de854b5bfa 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -672,6 +672,8 @@ void update_guest_memory_policy(struct vcpu *v,
 
 void domain_cpu_policy_changed(struct domain *d);
 
+void domain_pause_for_debugger(void);
+
 bool update_runstate_area(struct vcpu *);
 bool update_secondary_system_time(struct vcpu *,
                                   struct vcpu_time_info *);
-- 
2.32.0


Re: [PATCH v3 5/6] arch/x86: move domain_pause_for_debugger() to domain.h
Posted by Jan Beulich 3 years, 3 months ago
On 18.08.2021 22:29, Bobby Eshleman wrote:
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -36,6 +36,7 @@
>  #include <asm/processor.h>
>  #include <asm/amd.h>
>  #include <asm/debugreg.h>
> +#include <asm/domain.h>
>  #include <asm/msr.h>
>  #include <asm/i387.h>
>  #include <asm/iocap.h>
> @@ -58,7 +59,6 @@
>  #include <asm/hvm/trace.h>
>  #include <asm/hap.h>
>  #include <asm/apic.h>
> -#include <asm/debugger.h>
>  #include <asm/hvm/monitor.h>
>  #include <asm/monitor.h>
>  #include <asm/xstate.h>

While it's generally a good idea to explicitly #include headers that a
source file depends upon, I'm not convinced in this case: sched.h
includes xen/domain.h, which in turn includes asm/domain.h. And this
dependency chain is very unlikely to go away, as sched.h needs to see
full struct domain and struct vcpu, all of which come from */domain.h.

Jan