qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Xiaoyao Li <xiaoyao.li@intel.com>, Vikrant Garg <vikrant1garg@gmail.com>
Subject: [PULL 06/14] x86/loader: Don't update kernel header for CoCo VMs
Date: Wed, 27 Aug 2025 20:25:24 +0200	[thread overview]
Message-ID: <20250827182533.854476-7-pbonzini@redhat.com> (raw)
In-Reply-To: <20250827182533.854476-1-pbonzini@redhat.com>

From: Xiaoyao Li <xiaoyao.li@intel.com>

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>
Link: https://lore.kernel.org/r/20250814092111.2353598-1-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.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 b1b5f11e739..7512be64d67 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.51.0



  parent reply	other threads:[~2025-08-27 18:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
2025-08-27 18:25 ` [PULL 01/14] target/i386: Add support for save/load of exception error code Paolo Bonzini
2025-08-27 18:25 ` [PULL 02/14] scripts/minikconf.py: fix invalid attribute access Paolo Bonzini
2025-08-27 18:25 ` [PULL 03/14] scripts/minikconf.py: s/Error/KconfigParserError Paolo Bonzini
2025-08-27 18:25 ` [PULL 04/14] python: mkvenv: fix messages printed by mkvenv Paolo Bonzini
2025-08-27 18:25 ` [PULL 05/14] MAINTAINERS: add a few more files to "Top Level Makefile and configure" Paolo Bonzini
2025-08-27 18:25 ` Paolo Bonzini [this message]
2025-08-27 18:25 ` [PULL 07/14] i386/tcg/svm: fix incorrect canonicalization Paolo Bonzini
2025-08-27 18:25 ` [PULL 08/14] kvm/kvm-all: make kvm_park/unpark_vcpu local to kvm-all.c Paolo Bonzini
2025-08-27 18:25 ` [PULL 09/14] rust: disable borrow_as_ptr warning Paolo Bonzini
2025-08-27 18:25 ` [PULL 10/14] rust: qemu-api-macros: support matching more than one error Paolo Bonzini
2025-08-27 18:25 ` [PULL 11/14] subprojects: update proc-macro2 and syn Paolo Bonzini
2025-08-27 18:25 ` [PULL 12/14] rust/qemu-api-macros: make derive(Object) friendly when missing parent Paolo Bonzini
2025-08-27 18:25 ` [PULL 13/14] rust: declare self as qemu_api for proc-macros Paolo Bonzini
2025-08-27 18:25 ` [PULL 14/14] rust: move dependencies to rust/Cargo.toml Paolo Bonzini
2025-08-27 22:50 ` [PULL 00/14] QEMU patches for 2025-08-27 Richard Henderson

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=20250827182533.854476-7-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vikrant1garg@gmail.com \
    --cc=xiaoyao.li@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;
as well as URLs for NNTP newsgroup(s).