Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH v2 0/5] igvm/sev: apply the IGVM guest policy before launch
@ 2026-09-07 15:56 Luigi Leonardi
  2026-09-07 15:56 ` [PATCH v2 1/5] sev: split set_guest_policy into set_guest_policy and set_id_block Luigi Leonardi
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Luigi Leonardi @ 2026-09-07 15:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Gerd Hoffmann, Stefano Garzarella, Ani Sinha, Paolo Bonzini,
	Zhao Liu, Marcelo Tosatti, Daniel P. Berrange, kvm,
	Luigi Leonardi

The guest policy from an IGVM file never actually made it to the platform
before launch. The callback that was supposed to forward it ran after
LAUNCH_START, so it did nothing and the guest was launched with the
default policy instead of the one requested by the file.

The policy is part of the attestation report, so this quietly breaks
attestation: the resulting measurement does not match what the IGVM file
was built for.

Patches 1 to 4 are cleanups needed to get there: dropping an overloaded
callback, moving the SNP ID block handling, giving the policy properties
proper accessors, and adding a way to read back the platform's current
guest policy. Patch 5 is the actual fix.

One thing worth calling out: if a policy is also passed on the command
line and it differs from the IGVM one, the command-line value takes
precedence and we print a warning instead of silently picking one over
the other.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
---
Changes in v2:
- Rework the callback split. Now we don't have an unimplemented callback [Stefano, Gerd]
- Reject a command-line/IGVM policy that doesn't fit in the 32-bit
  SEV/SEV-ES policy field instead of truncating it [Stefano]
- On a mismatch between the command-line and IGVM policy, print a warning and
  keep the command-line value instead of returning an error. [Daniel,
  Gerd, Stefano]
- Picked up RoB
- Rebased to latest upstream
- Link to v1: https://lore.kernel.org/qemu-devel/20260901-fix_igvm_policy-v1-0-e93a6cf8c5ac@redhat.com

---
Luigi Leonardi (5):
      sev: split set_guest_policy into set_guest_policy and set_id_block
      igvm: move set_id_block call into the SNP ID block directive handler
      i386/sev: convert the guest policy properties to custom accessors
      i386/sev: add a get_guest_policy callback
      igvm/sev: forward the IGVM guest policy to the platform before launch

 backends/confidential-guest-support.c       |  24 +++-
 backends/igvm.c                             |  91 ++++++------
 include/system/confidential-guest-support.h |  36 +++--
 include/system/igvm-internal.h              |   3 -
 target/i386/sev.c                           | 215 ++++++++++++++++++----------
 5 files changed, 230 insertions(+), 139 deletions(-)
---
base-commit: cacd3462963a0a4f5bab4263ce79c2aa4b32692d
change-id: 20260831-fix_igvm_policy-0b92de52dd6a

Best regards,
-- 
Luigi Leonardi <leonardi@redhat.com>


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

end of thread, other threads:[~2026-09-08  6:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 15:56 [PATCH v2 0/5] igvm/sev: apply the IGVM guest policy before launch Luigi Leonardi
2026-09-07 15:56 ` [PATCH v2 1/5] sev: split set_guest_policy into set_guest_policy and set_id_block Luigi Leonardi
2026-09-08  6:24   ` Ani Sinha
2026-09-07 15:56 ` [PATCH v2 2/5] igvm: move set_id_block call into the SNP ID block directive handler Luigi Leonardi
2026-09-07 15:56 ` [PATCH v2 3/5] i386/sev: convert the guest policy properties to custom accessors Luigi Leonardi
2026-09-07 15:57 ` [PATCH v2 4/5] i386/sev: add a get_guest_policy callback Luigi Leonardi
2026-09-07 15:57 ` [PATCH v2 5/5] igvm/sev: forward the IGVM guest policy to the platform before launch Luigi Leonardi

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