public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
* [PULL 0/3] Firmware 20260310 patches
@ 2026-03-10 13:21 Gerd Hoffmann
  2026-03-10 13:21 ` [PULL 1/3] docs/interop: Add AMD SEV-SNP SVSM interface to firmware.json Gerd Hoffmann
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2026-03-10 13:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, Pierrick Bouvier, Stefano Garzarella, Zhao Liu,
	Gerd Hoffmann, Paolo Bonzini, Ani Sinha, Marcelo Tosatti,
	Daniel P. Berrangé, Philippe Mathieu-Daudé,
	Kashyap Chamarthy

The following changes since commit de61484ec39f418e5c0d4603017695f9ffb8fe24:

  Merge tag 'linux-user-for-v11-pull-request' of https://github.com/hdeller/qemu-hppa into staging (2026-03-09 14:53:42 +0000)

are available in the Git repository at:

  https://gitlab.com/kraxel/qemu.git tags/firmware-20260310-pull-request

for you to fetch changes up to 470ccb470b33bedede0100fdb703228a3f2683a5:

  i386/sev/igvm: do not reset guest policy if IGVM does not set it (2026-03-10 14:20:41 +0100)

----------------------------------------------------------------
- firmware.json spec update for svsm.
- igvm bugfixes.

----------------------------------------------------------------

Ani Sinha (1):
  i386/sev/igvm: do not reset guest policy if IGVM does not set it

Luigi Leonardi (1):
  igvm: fix build when igvm is not installed in a well known path

Oliver Steffen (1):
  docs/interop: Add AMD SEV-SNP SVSM interface to firmware.json

 include/qemu/typedefs.h        |  1 +
 include/system/igvm-internal.h |  9 ++-------
 include/system/igvm.h          |  5 +++++
 stubs/igvm.c                   |  1 -
 target/i386/sev.c              | 12 ++++++++++--
 docs/interop/firmware.json     |  4 +++-
 6 files changed, 21 insertions(+), 11 deletions(-)

-- 
2.53.0



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

* [PULL 1/3] docs/interop: Add AMD SEV-SNP SVSM interface to firmware.json
  2026-03-10 13:21 [PULL 0/3] Firmware 20260310 patches Gerd Hoffmann
@ 2026-03-10 13:21 ` Gerd Hoffmann
  2026-03-10 13:21 ` [PULL 2/3] igvm: fix build when igvm is not installed in a well known path Gerd Hoffmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2026-03-10 13:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, Pierrick Bouvier, Stefano Garzarella, Zhao Liu,
	Gerd Hoffmann, Paolo Bonzini, Ani Sinha, Marcelo Tosatti,
	Daniel P. Berrangé, Philippe Mathieu-Daudé,
	Kashyap Chamarthy, Oliver Steffen

From: Oliver Steffen <osteffen@redhat.com>

AMD SEV-SNP defines a guest to Secure VM Service Module (SVSM) firmware
[1] interface. Add a corresponding item to the FirmwareOSInterface
enum.

[1]
https://docs.amd.com/api/khub/documents/Al5Q~fSl~kWKkJ3zC0vk_g/content

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Message-ID: <20260123083204.999920-3-osteffen@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 docs/interop/firmware.json | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
index 3c71914a526c..421bee0e5ed4 100644
--- a/docs/interop/firmware.json
+++ b/docs/interop/firmware.json
@@ -40,10 +40,12 @@
 #     example, firmware built from the edk2 (EFI Development Kit II)
 #     project usually provides this interface.
 #
+# @svsm: AMD SEV-SNP Secure VM Service Module (SVSM) guest protocol.
+#
 # Since: 3.0
 ##
 { 'enum' : 'FirmwareOSInterface',
-  'data' : [ 'bios', 'openfirmware', 'uboot', 'uefi' ] }
+  'data' : [ 'bios', 'openfirmware', 'svsm', 'uboot', 'uefi' ] }
 
 ##
 # @FirmwareDevice:
-- 
2.53.0



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

* [PULL 2/3] igvm: fix build when igvm is not installed in a well known path
  2026-03-10 13:21 [PULL 0/3] Firmware 20260310 patches Gerd Hoffmann
  2026-03-10 13:21 ` [PULL 1/3] docs/interop: Add AMD SEV-SNP SVSM interface to firmware.json Gerd Hoffmann
@ 2026-03-10 13:21 ` Gerd Hoffmann
  2026-03-10 13:21 ` [PULL 3/3] i386/sev/igvm: do not reset guest policy if IGVM does not set it Gerd Hoffmann
  2026-03-10 14:52 ` [PULL 0/3] Firmware 20260310 patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2026-03-10 13:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, Pierrick Bouvier, Stefano Garzarella, Zhao Liu,
	Gerd Hoffmann, Paolo Bonzini, Ani Sinha, Marcelo Tosatti,
	Daniel P. Berrangé, Philippe Mathieu-Daudé,
	Kashyap Chamarthy, Luigi Leonardi

From: Luigi Leonardi <leonardi@redhat.com>

`stubs/igvm.c` includes `igvm-internal.h`, that in turn includes the igvm library.
This is required just for the QIgvm declaration and creates an
unnecessary dependency on the library.

Since igvm is not listed as a dependency of stubs, this results in build
failing when the library is not installed in a "well known" path of the
system.

Add a forward declaration for QIgvm and move the definition of
`qigvm_directive_madt` to `igvm.h` so that we can drop `igvm-internal.h` from
`stubs/igvm.c`.

Fixes: dea1f68a5c ("igvm: Fill MADT IGVM parameter field on x86_64")
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Message-ID: <20260309-master-v2-1-7e02f07a1096@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/qemu/typedefs.h        | 1 +
 include/system/igvm-internal.h | 9 ++-------
 include/system/igvm.h          | 5 +++++
 stubs/igvm.c                   | 1 -
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 416a8c9acead..cbe6f7f4c7c1 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -102,6 +102,7 @@ typedef struct QEMUSGList QEMUSGList;
 typedef struct QemuSpin QemuSpin;
 typedef struct QEMUTimer QEMUTimer;
 typedef struct QEMUTimerListGroup QEMUTimerListGroup;
+typedef struct QIgvm QIgvm;
 typedef struct QList QList;
 typedef struct QNull QNull;
 typedef struct QNum QNum;
diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h
index 38004bd908e7..76ae1bc3be92 100644
--- a/include/system/igvm-internal.h
+++ b/include/system/igvm-internal.h
@@ -42,7 +42,7 @@ typedef struct QIgvmParameterData {
  * QIgvm contains the information required during processing of a single IGVM
  * file.
  */
-typedef struct QIgvm {
+struct QIgvm {
     IgvmHandle file;
     MachineState *machine_state;
     ConfidentialGuestSupportClass *cgsc;
@@ -67,16 +67,11 @@ typedef struct QIgvm {
     unsigned region_start_index;
     unsigned region_last_index;
     unsigned region_page_count;
-} QIgvm;
+};
 
 IgvmHandle qigvm_file_init(char *filename, Error **errp);
 
 QIgvmParameterData*
 qigvm_find_param_entry(QIgvm *igvm, uint32_t parameter_area_index);
 
-/*
- *  IGVM parameter handlers
- */
-int qigvm_directive_madt(QIgvm *ctx, const uint8_t *header_data, Error **errp);
-
 #endif
diff --git a/include/system/igvm.h b/include/system/igvm.h
index 5573a6111ae7..f9231f03ec80 100644
--- a/include/system/igvm.h
+++ b/include/system/igvm.h
@@ -27,4 +27,9 @@ int qigvm_x86_get_mem_map_entry(int index,
 int qigvm_x86_set_vp_context(void *data, int index,
                              Error **errp);
 
+/*
+ *  IGVM parameter handlers
+ */
+int qigvm_directive_madt(QIgvm *ctx, const uint8_t *header_data, Error **errp);
+
 #endif
diff --git a/stubs/igvm.c b/stubs/igvm.c
index 47d5130d9d74..9e9f683fc960 100644
--- a/stubs/igvm.c
+++ b/stubs/igvm.c
@@ -12,7 +12,6 @@
 #include "qemu/osdep.h"
 
 #include "system/igvm.h"
-#include "system/igvm-internal.h"
 
 int qigvm_x86_get_mem_map_entry(int index,
                                 ConfidentialGuestMemoryMapEntry *entry,
-- 
2.53.0



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

* [PULL 3/3] i386/sev/igvm: do not reset guest policy if IGVM does not set it
  2026-03-10 13:21 [PULL 0/3] Firmware 20260310 patches Gerd Hoffmann
  2026-03-10 13:21 ` [PULL 1/3] docs/interop: Add AMD SEV-SNP SVSM interface to firmware.json Gerd Hoffmann
  2026-03-10 13:21 ` [PULL 2/3] igvm: fix build when igvm is not installed in a well known path Gerd Hoffmann
@ 2026-03-10 13:21 ` Gerd Hoffmann
  2026-03-10 14:52 ` [PULL 0/3] Firmware 20260310 patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2026-03-10 13:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: kvm, Pierrick Bouvier, Stefano Garzarella, Zhao Liu,
	Gerd Hoffmann, Paolo Bonzini, Ani Sinha, Marcelo Tosatti,
	Daniel P. Berrangé, Philippe Mathieu-Daudé,
	Kashyap Chamarthy

From: Ani Sinha <anisinha@redhat.com>

The guest policy is set either through command-line or through IGVM. If none of
the above applies, default guest policy applies. However, if IGVM does not set
the guest policy, currently the policy gets set to 0 regardless of whether it
was previously set to default value or command line. This change fixes this by
checking if IGVM indeed has set a policy value. If not, do not reset existing
value.

This avoids guest crashes such as the following during reset when the IGVM
has not explicitly set any guest policies:

qemu-system-x86_64: sev_snp_launch_start: SNP_LAUNCH_START ret=-22 fw_error=0 ''
qemu-system-x86_64: sev_common_kvm_init: failed to create encryption context
qemu-system-x86_64: unable to rebuild guest: Operation not permitted(-1)

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Message-ID: <20260310094450.35861-3-anisinha@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 target/i386/sev.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/target/i386/sev.c b/target/i386/sev.c
index 549e6241769b..cddffe0da8dd 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -2760,7 +2760,11 @@ static int cgs_set_guest_policy(ConfidentialGuestPolicyType policy_type,
                 id_auth->author_key[0] ? 1 : 0;
             finish->id_block_en = 1;
         }
-        sev_snp_guest->kvm_start_conf.policy = policy;
+
+        /* do not reset existing policy if policy was not set in IGVM  */
+        if (policy != 0) {
+            sev_snp_guest->kvm_start_conf.policy = policy;
+        }
     } else {
         SevGuestState *sev_guest = SEV_GUEST(MACHINE(qdev_get_machine())->cgs);
         /* Only the policy flags are supported for SEV and SEV-ES */
@@ -2769,7 +2773,11 @@ static int cgs_set_guest_policy(ConfidentialGuestPolicyType policy_type,
                              "but SEV-SNP is not enabled", __func__);
             return -1;
         }
-        sev_guest->policy = policy;
+
+        /* do not reset existing policy if policy was not set in IGVM  */
+        if (policy != 0) {
+            sev_guest->policy = policy;
+        }
     }
     return 0;
 }
-- 
2.53.0



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

* Re: [PULL 0/3] Firmware 20260310 patches
  2026-03-10 13:21 [PULL 0/3] Firmware 20260310 patches Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2026-03-10 13:21 ` [PULL 3/3] i386/sev/igvm: do not reset guest policy if IGVM does not set it Gerd Hoffmann
@ 2026-03-10 14:52 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2026-03-10 14:52 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: qemu-devel, kvm, Pierrick Bouvier, Stefano Garzarella, Zhao Liu,
	Paolo Bonzini, Ani Sinha, Marcelo Tosatti,
	Daniel P. Berrangé, Philippe Mathieu-Daudé,
	Kashyap Chamarthy

On Tue, 10 Mar 2026 at 13:22, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> The following changes since commit de61484ec39f418e5c0d4603017695f9ffb8fe24:
>
>   Merge tag 'linux-user-for-v11-pull-request' of https://github.com/hdeller/qemu-hppa into staging (2026-03-09 14:53:42 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/kraxel/qemu.git tags/firmware-20260310-pull-request
>
> for you to fetch changes up to 470ccb470b33bedede0100fdb703228a3f2683a5:
>
>   i386/sev/igvm: do not reset guest policy if IGVM does not set it (2026-03-10 14:20:41 +0100)
>
> ----------------------------------------------------------------
> - firmware.json spec update for svsm.
> - igvm bugfixes.
>
> ----------------------------------------------------------------



Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/11.0
for any user-visible changes.

-- PMM


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

end of thread, other threads:[~2026-03-10 14:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 13:21 [PULL 0/3] Firmware 20260310 patches Gerd Hoffmann
2026-03-10 13:21 ` [PULL 1/3] docs/interop: Add AMD SEV-SNP SVSM interface to firmware.json Gerd Hoffmann
2026-03-10 13:21 ` [PULL 2/3] igvm: fix build when igvm is not installed in a well known path Gerd Hoffmann
2026-03-10 13:21 ` [PULL 3/3] i386/sev/igvm: do not reset guest policy if IGVM does not set it Gerd Hoffmann
2026-03-10 14:52 ` [PULL 0/3] Firmware 20260310 patches Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox