From nobody Mon Feb 9 16:35:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767969337; cv=none; d=zohomail.com; s=zohoarc; b=fCJn4VGd2uZHmQNDbgBF/2m1WkbvTeEdRs0QKol83APj70lsUMJLTKbf3ytFzcXPVcUz0lo5ulvoQRkYBLL48ElBN+UCidnwLZRPmdxlnIvUu8jf3slFNK5RFAHEJ46SF1L/l62HWqgI2P9FyB+pH1SHHiT0IcCXV3niMYIxCHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767969337; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=StFbEp2ry1WOmdUB9ftIGUAuXNqoomLenoPBUoiEMBQ=; b=O+gXetAQKGedJp0DZrtK5AvEzQ9cVhHRzUpuAwpRsWiwQqQF9uutol1rIf+1vD+gl+hvoZ2cBP35jap9qlFuiLVM7J3ed1puh/9qmgEk7IyqhloEm1WXLMyqaRShwKExcuEnm407TqJPfu6p9AaxUq848ZU8IkEXo7DfV5Nbb2w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1767969337491811.6952604378286; Fri, 9 Jan 2026 06:35:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1veDZy-00059x-Sk; Fri, 09 Jan 2026 09:35:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1veDZw-00052X-07 for qemu-devel@nongnu.org; Fri, 09 Jan 2026 09:35:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1veDZs-0005U1-BB for qemu-devel@nongnu.org; Fri, 09 Jan 2026 09:35:02 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-616-XjbkymKgPxO-HutGHKDT4w-1; Fri, 09 Jan 2026 09:34:54 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 745A41956088; Fri, 9 Jan 2026 14:34:52 +0000 (UTC) Received: from osteffen-laptop.redhat.com (unknown [10.45.225.84]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1ECAD18001D5; Fri, 9 Jan 2026 14:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767969298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=StFbEp2ry1WOmdUB9ftIGUAuXNqoomLenoPBUoiEMBQ=; b=NvCR3dopTsQuX8hEiHiJUntv/+lLJSvgAiEeyTZKV/UNCYm5kSaYv/URfKM0XvR9nS9Tlu Tf6+xbLGlmsRINh5XitX3hoc/6ArjSY3Y65EKFtmm+du9J06Kjd2Zd9cwm3pbmGKG7wSBd /roqZcBobs3qvkkmfcrsSk4/8YPkwkc= X-MC-Unique: XjbkymKgPxO-HutGHKDT4w-1 X-Mimecast-MFC-AGG-ID: XjbkymKgPxO-HutGHKDT4w_1767969292 From: Oliver Steffen To: qemu-devel@nongnu.org Cc: Richard Henderson , Igor Mammedov , Paolo Bonzini , Marcelo Tosatti , Ani Sinha , Stefano Garzarella , Luigi Leonardi , Zhao Liu , Joerg Roedel , Gerd Hoffmann , kvm@vger.kernel.org, Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Oliver Steffen Subject: [PATCH v3 5/6] igvm: Pass machine state to IGVM file processing Date: Fri, 9 Jan 2026 15:34:12 +0100 Message-ID: <20260109143413.293593-6-osteffen@redhat.com> In-Reply-To: <20260109143413.293593-1-osteffen@redhat.com> References: <20260109143413.293593-1-osteffen@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=osteffen@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1767969339295158500 Content-Type: text/plain; charset="utf-8" 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 --- 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) =20 trace_igvm_reset_hold(type); =20 - qigvm_process_file(igvm, ms->cgs, false, &error_fatal); + qigvm_process_file(igvm, ms->cgs, false, ms, &error_fatal); } =20 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 @@ =20 #include "qemu/osdep.h" =20 +#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; =20 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) } =20 int qigvm_process_file(IgvmCfg *cfg, ConfidentialGuestSupport *cgs, - bool onlyVpContext, Error **errp) + bool onlyVpContext, MachineState *machine_state, Er= ror **errp) { int32_t header_count; QIgvmParameterData *parameter; @@ -929,6 +931,8 @@ int qigvm_process_file(IgvmCfg *cfg, ConfidentialGuestS= upport *cgs, ctx.cgs =3D cgs; ctx.cgsc =3D cgs ? CONFIDENTIAL_GUEST_SUPPORT_GET_CLASS(cgs) : NULL; =20 + ctx.machine_state =3D 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 =20 +#include "hw/boards.h" #include "qom/object.h" #include "hw/resettable.h" =20 @@ -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); =20 } IgvmCfgClass; =20 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 @@ =20 #include "system/confidential-guest-support.h" #include "system/igvm-cfg.h" +#include "hw/boards.h" #include "qapi/error.h" =20 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, Err= or **errp); =20 /* 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(ConfidentialGuestSuppo= rt *cgs, Error **errp) */ if (x86machine->igvm) { if (IGVM_CFG_GET_CLASS(x86machine->igvm) - ->process(x86machine->igvm, machine->cgs, true, errp) = =3D=3D + ->process(x86machine->igvm, machine->cgs, true, machin= e, errp) =3D=3D -1) { return -1; } --=20 2.52.0