[PATCH v2 1/8] target/i386: Include missing 'svm.h' header in 'sev.h'

Philippe Mathieu-Daudé posted 8 patches 2 weeks, 6 days ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, "Dr. David Alan Gilbert" <dave@treblig.org>, Markus Armbruster <armbru@redhat.com>, Zhao Liu <zhao1.liu@intel.com>, Marcelo Tosatti <mtosatti@redhat.com>, Laurent Vivier <laurent@vivier.eu>, Nicholas Piggin <npiggin@gmail.com>, Chinmay Rath <rathc@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Max Filippov <jcmvbkbc@gmail.com>
There is a newer version of this series
[PATCH v2 1/8] target/i386: Include missing 'svm.h' header in 'sev.h'
Posted by Philippe Mathieu-Daudé 2 weeks, 6 days ago
otarget/i386/cpu.h:2820:#include "svm.h"
target/i386/sev.h:17:#include "target/i386/svm.h"

"target/i386/sev.h" uses the vmcb_seg structure type, which
is defined in "target/i386/svm.h". Current builds succeed
because the files including "target/i386/sev.h" also include
"monitor/hmp-target.h", itself including "cpu.h" and finally
"target/i386/svm.h".

Include the latter, otherwise removing "cpu.h" from
"monitor/hmp-target.h" triggers:

  ../target/i386/sev.h:62:21: error: field has incomplete type 'struct vmcb_seg'
     62 |     struct vmcb_seg es;
        |                     ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/i386/sev.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/i386/sev.h b/target/i386/sev.h
index 9db1a802f6b..4358df40e48 100644
--- a/target/i386/sev.h
+++ b/target/i386/sev.h
@@ -14,6 +14,8 @@
 #ifndef I386_SEV_H
 #define I386_SEV_H
 
+#include "target/i386/svm.h"
+
 #ifndef CONFIG_USER_ONLY
 #include CONFIG_DEVICES /* CONFIG_SEV */
 #endif
-- 
2.52.0


Re: [PATCH v2 1/8] target/i386: Include missing 'svm.h' header in 'sev.h'
Posted by Zhao Liu 2 weeks, 4 days ago
On Sat, Jan 17, 2026 at 05:29:19PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Sat, 17 Jan 2026 17:29:19 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH v2 1/8] target/i386: Include missing 'svm.h' header in
>  'sev.h'
> X-Mailer: git-send-email 2.52.0
> 
> otarget/i386/cpu.h:2820:#include "svm.h"
> target/i386/sev.h:17:#include "target/i386/svm.h"
> 
> "target/i386/sev.h" uses the vmcb_seg structure type, which
> is defined in "target/i386/svm.h". Current builds succeed
> because the files including "target/i386/sev.h" also include
> "monitor/hmp-target.h", itself including "cpu.h" and finally
> "target/i386/svm.h".
> 
> Include the latter, otherwise removing "cpu.h" from
> "monitor/hmp-target.h" triggers:
> 
>   ../target/i386/sev.h:62:21: error: field has incomplete type 'struct vmcb_seg'
>      62 |     struct vmcb_seg es;
>         |                     ^
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  target/i386/sev.h | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>