qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/loader: Don't update kernel header for CoCo VMs
@ 2025-08-14  9:21 Xiaoyao Li
  2025-08-14 10:28 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaoyao Li @ 2025-08-14  9:21 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Gerd Hoffmann, Philippe Mathieu-Daudé, qemu-devel,
	Vikrant Garg, Xiaoyao Li

Update the header makes it different from the original kernel that user
provides via "-kernel", which leads to a different hash and breaks the
attestation, e.g., for TDX.

We already skip it for SEV VMs. Instead of adding another check of
is_tdx_vm() to cover the TDX case, check machine->cgs to cover all the
confidential computing case for x86.

Reported-by: Vikrant Garg <vikrant1garg@gmail.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 hw/i386/x86-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index b1b5f11e7396..7512be64d67b 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -952,7 +952,7 @@ void x86_load_linux(X86MachineState *x86ms,
      * kernel on the other side of the fw_cfg interface matches the hash of the
      * file the user passed in.
      */
-    if (!sev_enabled() && protocol > 0) {
+    if (!MACHINE(x86ms)->cgs && protocol > 0) {
         memcpy(setup, header, MIN(sizeof(header), setup_size));
     }
 
-- 
2.43.0



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

end of thread, other threads:[~2025-08-14 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14  9:21 [PATCH] x86/loader: Don't update kernel header for CoCo VMs Xiaoyao Li
2025-08-14 10:28 ` Paolo Bonzini

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).