From: Luigi Leonardi <leonardi@redhat.com>
To: Oliver Steffen <osteffen@redhat.com>
Cc: qemu-devel@nongnu.org,
Richard Henderson <richard.henderson@linaro.org>,
Igor Mammedov <imammedo@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Ani Sinha <anisinha@redhat.com>,
Stefano Garzarella <sgarzare@redhat.com>,
Zhao Liu <zhao1.liu@intel.com>,
Joerg Roedel <joerg.roedel@amd.com>,
Gerd Hoffmann <kraxel@redhat.com>,
kvm@vger.kernel.org, Eduardo Habkost <eduardo@habkost.net>,
"Michael S. Tsirkin" <mst@redhat.com>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Subject: Re: [PATCH v3 5/6] igvm: Pass machine state to IGVM file processing
Date: Mon, 12 Jan 2026 10:09:40 +0100 [thread overview]
Message-ID: <aWS51gJnoQTIDIaO@leonardi-redhat> (raw)
In-Reply-To: <20260109143413.293593-6-osteffen@redhat.com>
On Fri, Jan 09, 2026 at 03:34:12PM +0100, Oliver Steffen wrote:
>Add a new MachineState* parameter to qigvm_process_file()
>to make the machine state available in the IGVM processing
>context. We will use it later to generate MADT data there
>to pass to the guest as IGVM parameter.
>
>Signed-off-by: Oliver Steffen <osteffen@redhat.com>
>---
> backends/igvm-cfg.c | 2 +-
> backends/igvm.c | 6 +++++-
> include/system/igvm-cfg.h | 3 ++-
> include/system/igvm.h | 3 ++-
> target/i386/sev.c | 2 +-
> 5 files changed, 11 insertions(+), 5 deletions(-)
>
>diff --git a/backends/igvm-cfg.c b/backends/igvm-cfg.c
>index c1b45401f4..d79bdecab1 100644
>--- a/backends/igvm-cfg.c
>+++ b/backends/igvm-cfg.c
>@@ -51,7 +51,7 @@ static void igvm_reset_hold(Object *obj, ResetType type)
>
> trace_igvm_reset_hold(type);
>
>- qigvm_process_file(igvm, ms->cgs, false, &error_fatal);
>+ qigvm_process_file(igvm, ms->cgs, false, ms, &error_fatal);
> }
>
> static void igvm_reset_exit(Object *obj, ResetType type)
>diff --git a/backends/igvm.c b/backends/igvm.c
>index a797bd741c..7390dee734 100644
>--- a/backends/igvm.c
>+++ b/backends/igvm.c
>@@ -11,6 +11,7 @@
>
> #include "qemu/osdep.h"
>
>+#include "hw/boards.h"
> #include "qapi/error.h"
> #include "qemu/target-info-qapi.h"
> #include "system/igvm.h"
>@@ -93,6 +94,7 @@ typedef struct QIgvm {
> unsigned region_start_index;
> unsigned region_last_index;
> unsigned region_page_count;
>+ MachineState *machine_state;
> } QIgvm;
>
> static QIgvmParameterData *qigvm_find_param_entry(QIgvm *igvm, const IGVM_VHS_PARAMETER *param) {
>@@ -906,7 +908,7 @@ IgvmHandle qigvm_file_init(char *filename, Error **errp)
> }
>
> int qigvm_process_file(IgvmCfg *cfg, ConfidentialGuestSupport *cgs,
>- bool onlyVpContext, Error **errp)
>+ bool onlyVpContext, MachineState *machine_state, Error **errp)
> {
> int32_t header_count;
> QIgvmParameterData *parameter;
>@@ -929,6 +931,8 @@ int qigvm_process_file(IgvmCfg *cfg, ConfidentialGuestSupport *cgs,
> ctx.cgs = cgs;
> ctx.cgsc = cgs ? CONFIDENTIAL_GUEST_SUPPORT_GET_CLASS(cgs) : NULL;
>
>+ ctx.machine_state = machine_state;
>+
> /*
> * Check that the IGVM file provides configuration for the current
> * platform
>diff --git a/include/system/igvm-cfg.h b/include/system/igvm-cfg.h
>index 7dc48677fd..2783fc542e 100644
>--- a/include/system/igvm-cfg.h
>+++ b/include/system/igvm-cfg.h
>@@ -12,6 +12,7 @@
> #ifndef QEMU_IGVM_CFG_H
> #define QEMU_IGVM_CFG_H
>
>+#include "hw/boards.h"
> #include "qom/object.h"
> #include "hw/resettable.h"
>
>@@ -43,7 +44,7 @@ typedef struct IgvmCfgClass {
> * Returns 0 for ok and -1 on error.
> */
> int (*process)(IgvmCfg *cfg, ConfidentialGuestSupport *cgs,
>- bool onlyVpContext, Error **errp);
>+ bool onlyVpContext, MachineState *machine_state, Error **errp);
>
> } IgvmCfgClass;
>
>diff --git a/include/system/igvm.h b/include/system/igvm.h
>index ec2538daa0..0afe784a17 100644
>--- a/include/system/igvm.h
>+++ b/include/system/igvm.h
>@@ -14,11 +14,12 @@
>
> #include "system/confidential-guest-support.h"
> #include "system/igvm-cfg.h"
>+#include "hw/boards.h"
> #include "qapi/error.h"
>
> IgvmHandle qigvm_file_init(char *filename, Error **errp);
> int qigvm_process_file(IgvmCfg *igvm, ConfidentialGuestSupport *cgs,
>- bool onlyVpContext, Error **errp);
>+ bool onlyVpContext, MachineState *machine_state, Error **errp);
>
> /* x86 native */
> int qigvm_x86_get_mem_map_entry(int index,
>diff --git a/target/i386/sev.c b/target/i386/sev.c
>index fd2dada013..a733868043 100644
>--- a/target/i386/sev.c
>+++ b/target/i386/sev.c
>@@ -1892,7 +1892,7 @@ static int sev_common_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
> */
> if (x86machine->igvm) {
> if (IGVM_CFG_GET_CLASS(x86machine->igvm)
>- ->process(x86machine->igvm, machine->cgs, true, errp) ==
>+ ->process(x86machine->igvm, machine->cgs, true, machine, errp) ==
`cgs` is part of the machine state. WDYT about dropping it?
Luigi
next prev parent reply other threads:[~2026-01-12 9:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 14:34 [PATCH v3 0/6] igvm: Supply MADT via IGVM parameter Oliver Steffen
2026-01-09 14:34 ` [PATCH v3 1/6] hw/acpi: Make BIOS linker optional Oliver Steffen
2026-01-12 9:47 ` Gerd Hoffmann
2026-01-09 14:34 ` [PATCH v3 2/6] hw/acpi: Add standalone function to build MADT Oliver Steffen
2026-01-09 14:34 ` [PATCH v3 3/6] igvm: Add missing NULL check Oliver Steffen
2026-01-09 17:37 ` Luigi Leonardi
2026-01-12 9:41 ` Gerd Hoffmann
2026-01-12 9:49 ` Luigi Leonardi
2026-01-12 9:57 ` Gerd Hoffmann
2026-01-13 9:36 ` Oliver Steffen
2026-01-13 7:21 ` Ani Sinha
2026-01-13 9:04 ` Oliver Steffen
2026-01-09 14:34 ` [PATCH v3 4/6] igvm: Add common function for finding parameter entries Oliver Steffen
2026-01-12 9:43 ` Gerd Hoffmann
2026-01-09 14:34 ` [PATCH v3 5/6] igvm: Pass machine state to IGVM file processing Oliver Steffen
2026-01-12 9:09 ` Luigi Leonardi [this message]
2026-01-09 14:34 ` [PATCH v3 6/6] igvm: Fill MADT IGVM parameter field Oliver Steffen
2026-01-12 9:57 ` Luigi Leonardi
2026-01-12 12:34 ` [PATCH v3 0/6] igvm: Supply MADT via IGVM parameter Igor Mammedov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aWS51gJnoQTIDIaO@leonardi-redhat \
--to=leonardi@redhat.com \
--cc=anisinha@redhat.com \
--cc=eduardo@habkost.net \
--cc=imammedo@redhat.com \
--cc=joerg.roedel@amd.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=osteffen@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sgarzare@redhat.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox