xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: Add missing forward declaration and include to hvm/svm/vmcb.h
@ 2025-10-06 10:46 Alejandro Vallejo
  2025-10-06 11:04 ` Andrew Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Vallejo @ 2025-10-06 10:46 UTC (permalink / raw)
  To: xen-devel
  Cc: Alejandro Vallejo, Jan Beulich, Andrew Cooper,
	Roger Pau Monné

"struct segment_register" requires a prior inclusion of x86_emulate.h,
and it's missing a forward declaration of "struct vcpu" too.

Sort these out so the header can be included by itself.

Not a functional change.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
---
This dependency already exists today. I'm just making it explicit.

"segment_register" is weird. It naturally belongs in vmcb.h, but the
emulator makes use of it and must be compilable outside of Xen.

I don't like having vmcb.h depending on the emulator header, but I see
no way of breaking that dependency without breaking the emulator unit
tests.
---
 xen/arch/x86/include/asm/hvm/svm/vmcb.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/include/asm/hvm/svm/vmcb.h b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
index 28f715e376..7c599a1c39 100644
--- a/xen/arch/x86/include/asm/hvm/svm/vmcb.h
+++ b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
@@ -10,6 +10,10 @@
 
 #include <xen/types.h>
 
+#include <asm/x86_emulate.h> /* for "struct segment_register" */
+
+struct vcpu;
+
 /* general 1 intercepts */
 enum GenericIntercept1bits
 {

base-commit: b6fc307b0b00314d4e4460fcf8be2cd9e4ff8652
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-06 13:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-06 10:46 [PATCH] x86: Add missing forward declaration and include to hvm/svm/vmcb.h Alejandro Vallejo
2025-10-06 11:04 ` Andrew Cooper
2025-10-06 11:29   ` Alejandro Vallejo
2025-10-06 13:09     ` Andrew Cooper
2025-10-06 13:43       ` Alejandro Vallejo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).