From nobody Mon Feb 9 03:56:48 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=1765450541; cv=none; d=zohomail.com; s=zohoarc; b=fxaf0kKi4Bn8srCmO/qWePd9c2Bsdp8xW+K42jAykUezdU7JvZeEBKJed8bneu05AQP2i/jZvzK+AX499d6S7hGwjJgvaaK/g2VsladSAI8r5IK1oV9/NaXIereYBrGlFZLcheEWf7XjRapjQvQTONjKRG27Beb0tKZ3kByyk2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765450541; 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=0y1grwpoA0+nEr5YXdr7c7I9+H7VqtMhVFS456ToAXw=; b=cek5pgU1yheYSEvZ8IYtL+Mpl6KVOrYgmmQ+qN9JjXzJmDw/wJcMY/YLQRLTkADV4yEnd1UM6ZyEE3z4BB3OtY/0b8ZxaPZOdHWPIbgmxKewlk6vIyFAN3o51SLRIxv+2/94t77IHRSMwTfBRCxem1506EAUjBSz6t2Ztu890lU= 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 1765450541119226.37276172278587; Thu, 11 Dec 2025 02:55:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTeJd-0007B4-9c; Thu, 11 Dec 2025 05:54:33 -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 1vTeJb-0007AF-Ux for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vTeJZ-0005WX-ME for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:31 -0500 Received: from mx-prod-mc-03.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-49-aXRwuQIRN3iTPgg-IrJA0w-1; Thu, 11 Dec 2025 05:54:24 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CD9471956071; Thu, 11 Dec 2025 10:54:22 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.156]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1ED73180057E; Thu, 11 Dec 2025 10:54:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E620918007A4; Thu, 11 Dec 2025 11:54:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765450467; 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=0y1grwpoA0+nEr5YXdr7c7I9+H7VqtMhVFS456ToAXw=; b=LaASiDKoLIkw5mHOF/Kzs+QxXSFBvAt36S6FSZfOJhnfkAT0c57k2KBnBBjHZS45ZyVRcN 6+GjGxM/1bJufW05fHtN74yVQvz1CJ0OxE57snmfez7dgBmHhEnN/vrJZadtHUEAHuTLsE xlCU7OMpbRS2RLLNixPXtoynld8gXRY= X-MC-Unique: aXRwuQIRN3iTPgg-IrJA0w-1 X-Mimecast-MFC-AGG-ID: aXRwuQIRN3iTPgg-IrJA0w_1765450463 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Ani Sinha , Marcel Apfelbaum , Gerd Hoffmann , "Michael S. Tsirkin" , Stefano Garzarella , Paolo Bonzini , Oliver Steffen , Richard Henderson , Eduardo Habkost , Luigi Leonardi Subject: [PATCH v2 1/5] igvm: reorganize headers Date: Thu, 11 Dec 2025 11:54:15 +0100 Message-ID: <20251211105419.3573449-2-kraxel@redhat.com> In-Reply-To: <20251211105419.3573449-1-kraxel@redhat.com> References: <20251211105419.3573449-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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.129.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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_H2=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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: 1765450543283158500 Content-Type: text/plain; charset="utf-8" Add a new igvm-internal.h header file. Structs and declarations which depend on the igvm library header go into that file. Also declare IgvmCfg in typedefs.h, so the type can be used without including igvm header files. Signed-off-by: Gerd Hoffmann Reviewed-by: Stefano Garzarella --- include/qemu/typedefs.h | 1 + include/system/igvm-cfg.h | 12 +----------- include/system/igvm-internal.h | 26 ++++++++++++++++++++++++++ include/system/igvm.h | 2 +- backends/igvm-cfg.c | 4 +++- backends/igvm.c | 2 ++ 6 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 include/system/igvm-internal.h diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 4a94af9665a5..416a8c9acead 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -55,6 +55,7 @@ typedef struct FWCfgState FWCfgState; typedef struct HostMemoryBackend HostMemoryBackend; typedef struct I2CBus I2CBus; typedef struct I2SCodec I2SCodec; +typedef struct IgvmCfg IgvmCfg; typedef struct IOMMUMemoryRegion IOMMUMemoryRegion; typedef struct ISABus ISABus; typedef struct ISADevice ISADevice; diff --git a/include/system/igvm-cfg.h b/include/system/igvm-cfg.h index 944f23a814dd..6c07f3084082 100644 --- a/include/system/igvm-cfg.h +++ b/include/system/igvm-cfg.h @@ -12,19 +12,9 @@ #ifndef QEMU_IGVM_CFG_H #define QEMU_IGVM_CFG_H =20 +#include "qemu/typedefs.h" #include "qom/object.h" =20 -typedef struct IgvmCfg { - ObjectClass parent_class; - - /* - * filename: Filename that specifies a file that contains the configur= ation - * of the guest in Independent Guest Virtual Machine (IGVM) - * format. - */ - char *filename; -} IgvmCfg; - typedef struct IgvmCfgClass { ObjectClass parent_class; =20 diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h new file mode 100644 index 000000000000..475a29bbf3d7 --- /dev/null +++ b/include/system/igvm-internal.h @@ -0,0 +1,26 @@ +/* + * QEMU IGVM private data structures + * + * Everything which depends on igvm library headers goes here. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_IGVM_INTERNAL_H +#define QEMU_IGVM_INTERNAL_H + +#include "qemu/typedefs.h" +#include "qom/object.h" + +struct IgvmCfg { + ObjectClass parent_class; + + /* + * filename: Filename that specifies a file that contains the configur= ation + * of the guest in Independent Guest Virtual Machine (IGVM) + * format. + */ + char *filename; +}; + +#endif diff --git a/include/system/igvm.h b/include/system/igvm.h index 48ce20604259..8355e54e95fc 100644 --- a/include/system/igvm.h +++ b/include/system/igvm.h @@ -12,8 +12,8 @@ #ifndef BACKENDS_IGVM_H #define BACKENDS_IGVM_H =20 +#include "qemu/typedefs.h" #include "system/confidential-guest-support.h" -#include "system/igvm-cfg.h" #include "qapi/error.h" =20 int qigvm_process_file(IgvmCfg *igvm, ConfidentialGuestSupport *cgs, diff --git a/backends/igvm-cfg.c b/backends/igvm-cfg.c index d00acf351249..001c4dc93346 100644 --- a/backends/igvm-cfg.c +++ b/backends/igvm-cfg.c @@ -11,8 +11,10 @@ =20 #include "qemu/osdep.h" =20 -#include "system/igvm-cfg.h" #include "system/igvm.h" +#include "system/igvm-cfg.h" +#include "system/igvm-internal.h" +#include "system/reset.h" #include "qom/object_interfaces.h" =20 static char *get_igvm(Object *obj, Error **errp) diff --git a/backends/igvm.c b/backends/igvm.c index 905bd8d98994..fbb8300b6d01 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -14,6 +14,8 @@ #include "qapi/error.h" #include "qemu/target-info-qapi.h" #include "system/igvm.h" +#include "system/igvm-cfg.h" +#include "system/igvm-internal.h" #include "system/memory.h" #include "system/address-spaces.h" #include "hw/core/cpu.h" --=20 2.52.0 From nobody Mon Feb 9 03:56:48 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=1765450516; cv=none; d=zohomail.com; s=zohoarc; b=IUnl/PF0BluhaQnit8+8nDft+mmoXll8XqOHluiUGLI99nb12Yykg+bav+lzfotB/Y8XWU+8QVE+/Vm8tLWuAesnBLsH2OQoHJryauLJeW5Y6h7+ePAagRp6UTWMhEhxNMIFLIrh4v4Bn0V1PArIaLHlQMS3aggBtD4k5ixie2Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765450516; 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=3+cJ8w1kBEnr2tvp6MvzGo5hAHspZAFdggzPGJtpZD4=; b=Wu18pNV+KmV1IdupbU9cbp4RuXHAWbNxk/GbYSgT1i0l7MEUiTIZHht+zeXQ5FfsOmRgZnOrD3s+D7ET2JNC3yC6UQ7QPi9YW8ZAqQCpdZJ5KRHQ7pBOjuOMBBGyKywLWxao2vZGmcbktP38WAif40dazPcmI1RVIPbNl5WjupA= 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 1765450516863846.9876660517633; Thu, 11 Dec 2025 02:55:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTeJg-0007Bg-Mg; Thu, 11 Dec 2025 05:54:37 -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 1vTeJe-0007BK-1z for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:34 -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 1vTeJc-0005Wm-4I for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:33 -0500 Received: from mx-prod-mc-01.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-98-0CQJvtZNMBizeGFVwDFPnA-1; Thu, 11 Dec 2025 05:54:27 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BF1AF195DE48; Thu, 11 Dec 2025 10:54:26 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.156]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 16CDA1953984; Thu, 11 Dec 2025 10:54:25 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 092251800848; Thu, 11 Dec 2025 11:54:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765450469; 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=3+cJ8w1kBEnr2tvp6MvzGo5hAHspZAFdggzPGJtpZD4=; b=PEi2pepNoSCzfs/wOBllz68S9BHeTW0IvfYq8YI1FfvQ8thFWKuxmRsZA2CrA+/5RCCkFM q198SoVY0nO2LKlqcxZzY7+eJNZ4raPj5zo3pOk50Hbfm/duMFUFyOmhIvZDVd+0ZdxE4w uN3arkRHeR0KgA2sVmuNkgzq9z93urM= X-MC-Unique: 0CQJvtZNMBizeGFVwDFPnA-1 X-Mimecast-MFC-AGG-ID: 0CQJvtZNMBizeGFVwDFPnA_1765450466 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Ani Sinha , Marcel Apfelbaum , Gerd Hoffmann , "Michael S. Tsirkin" , Stefano Garzarella , Paolo Bonzini , Oliver Steffen , Richard Henderson , Eduardo Habkost , Luigi Leonardi Subject: [PATCH v2 2/5] igvm: make igvm-cfg object resettable Date: Thu, 11 Dec 2025 11:54:16 +0100 Message-ID: <20251211105419.3573449-3-kraxel@redhat.com> In-Reply-To: <20251211105419.3573449-1-kraxel@redhat.com> References: <20251211105419.3573449-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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: 1765450520131158500 Content-Type: text/plain; charset="utf-8" Add TYPE_RESETTABLE_INTERFACE to interfaces. Register callbacks for the reset phases. Add trace points for logging and debugging. No functional change, that will come in followup patches. Signed-off-by: Gerd Hoffmann Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella --- include/system/igvm-cfg.h | 1 + include/system/igvm-internal.h | 1 + backends/igvm-cfg.c | 35 +++++++++++++++++++++++++++++++++- backends/trace-events | 5 +++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/include/system/igvm-cfg.h b/include/system/igvm-cfg.h index 6c07f3084082..b0380133b9a0 100644 --- a/include/system/igvm-cfg.h +++ b/include/system/igvm-cfg.h @@ -14,6 +14,7 @@ =20 #include "qemu/typedefs.h" #include "qom/object.h" +#include "hw/resettable.h" =20 typedef struct IgvmCfgClass { ObjectClass parent_class; diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h index 475a29bbf3d7..e0452080b127 100644 --- a/include/system/igvm-internal.h +++ b/include/system/igvm-internal.h @@ -21,6 +21,7 @@ struct IgvmCfg { * format. */ char *filename; + ResettableState reset_state; }; =20 #endif diff --git a/backends/igvm-cfg.c b/backends/igvm-cfg.c index 001c4dc93346..e0df3eaa8efd 100644 --- a/backends/igvm-cfg.c +++ b/backends/igvm-cfg.c @@ -17,6 +17,8 @@ #include "system/reset.h" #include "qom/object_interfaces.h" =20 +#include "trace.h" + static char *get_igvm(Object *obj, Error **errp) { IgvmCfg *igvm =3D IGVM_CFG(obj); @@ -30,24 +32,55 @@ static void set_igvm(Object *obj, const char *value, Er= ror **errp) igvm->filename =3D g_strdup(value); } =20 +static ResettableState *igvm_reset_state(Object *obj) +{ + IgvmCfg *igvm =3D IGVM_CFG(obj); + return &igvm->reset_state; +} + +static void igvm_reset_enter(Object *obj, ResetType type) +{ + trace_igvm_reset_enter(type); +} + +static void igvm_reset_hold(Object *obj, ResetType type) +{ + trace_igvm_reset_hold(type); +} + +static void igvm_reset_exit(Object *obj, ResetType type) +{ + trace_igvm_reset_exit(type); +} + OBJECT_DEFINE_TYPE_WITH_INTERFACES(IgvmCfg, igvm_cfg, IGVM_CFG, OBJECT, - { TYPE_USER_CREATABLE }, { NULL }) + { TYPE_USER_CREATABLE }, + { TYPE_RESETTABLE_INTERFACE }, + { NULL }) =20 static void igvm_cfg_class_init(ObjectClass *oc, const void *data) { IgvmCfgClass *igvmc =3D IGVM_CFG_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); =20 object_class_property_add_str(oc, "file", get_igvm, set_igvm); object_class_property_set_description(oc, "file", "Set the IGVM filename to use"); =20 igvmc->process =3D qigvm_process_file; + + rc->get_state =3D igvm_reset_state; + rc->phases.enter =3D igvm_reset_enter; + rc->phases.hold =3D igvm_reset_hold; + rc->phases.exit =3D igvm_reset_exit; } =20 static void igvm_cfg_init(Object *obj) { + qemu_register_resettable(obj); } =20 static void igvm_cfg_finalize(Object *obj) { + qemu_unregister_resettable(obj); } diff --git a/backends/trace-events b/backends/trace-events index 56132d3fd22b..45ac46dc2454 100644 --- a/backends/trace-events +++ b/backends/trace-events @@ -21,3 +21,8 @@ iommufd_backend_free_id(int iommufd, uint32_t id, int ret= ) " iommufd=3D%d id=3D%d (% iommufd_backend_set_dirty(int iommufd, uint32_t hwpt_id, bool start, int r= et) " iommufd=3D%d hwpt=3D%u enable=3D%d (%d)" iommufd_backend_get_dirty_bitmap(int iommufd, uint32_t hwpt_id, uint64_t i= ova, uint64_t size, uint64_t page_size, int ret) " iommufd=3D%d hwpt=3D%u i= ova=3D0x%"PRIx64" size=3D0x%"PRIx64" page_size=3D0x%"PRIx64" (%d)" iommufd_backend_invalidate_cache(int iommufd, uint32_t id, uint32_t data_t= ype, uint32_t entry_len, uint32_t entry_num, uint32_t done_num, uint64_t da= ta_ptr, int ret) " iommufd=3D%d id=3D%u data_type=3D%u entry_len=3D%u entry= _num=3D%u done_num=3D%u data_ptr=3D0x%"PRIx64" (%d)" + +# igvm-cfg.c +igvm_reset_enter(int type) "type=3D%u" +igvm_reset_hold(int type) "type=3D%u" +igvm_reset_exit(int type) "type=3D%u" --=20 2.52.0 From nobody Mon Feb 9 03:56:48 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=1765450524; cv=none; d=zohomail.com; s=zohoarc; b=N/pZEZXw2dBh+X+xJ+E9mAZ2LynsL5LvHZOE5/FlyRNDrkUDnFnPd71XO2SbBofkqztvKz52geFY+VJvzRkYigcf2xFQxbepLB53EiJhGWOLNSlQEZKObuPVlmlLQBn4eGpUX4SxHpMfGdQymKsn9P8fpE3D0gye7oKfbWfHPEE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765450524; 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=4hvxJ/XDHbHBWxofzfAF2WgNz6WnMLxtPZ7iycniK4k=; b=M4lStJiHEzhYppU91rDvakW8ZTeuGBo0NlhNBFIH4Gf0OjD1ELJhtuNdzlGAouFiOVTTdwi0csB9JV2gfg+BMzVpiGbkvOyUq7Al/JGcTSh4Db6k4s5rlsehutY3qGZHl/W6JYgEwJddBHhf5fQ7DGYxbJsZLd9ugp8dtlI1q2w= 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 1765450524888338.51673399995354; Thu, 11 Dec 2025 02:55:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTeJw-0007Iy-Gb; Thu, 11 Dec 2025 05:54:52 -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 1vTeJk-0007Dr-Jc for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:40 -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 1vTeJj-0005Xq-1Z for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:40 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-440-DElPi9aJOo-D4nHuGZ7m_w-1; Thu, 11 Dec 2025 05:54:27 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9E0F2180028B; Thu, 11 Dec 2025 10:54:25 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.156]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 551543000229; Thu, 11 Dec 2025 10:54:25 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1D9231800DD3; Thu, 11 Dec 2025 11:54:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765450478; 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=4hvxJ/XDHbHBWxofzfAF2WgNz6WnMLxtPZ7iycniK4k=; b=Rv+bKuAAzZJ4XCQwR7EpiNIEH9Hmue5cyRfRBlFVg8JTkhpRX/Q/K2i1WzsYZeio0WCq7D SlDs3FAHR48mgZmAmKI3nUpGfW4eq5g9GagJUW2rZEQSLbltyWlXiZ0nbvwReZJff02KyL x72HelEA4De5BMa10ZzoG3YbRc+jtb4= X-MC-Unique: DElPi9aJOo-D4nHuGZ7m_w-1 X-Mimecast-MFC-AGG-ID: DElPi9aJOo-D4nHuGZ7m_w_1765450465 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Ani Sinha , Marcel Apfelbaum , Gerd Hoffmann , "Michael S. Tsirkin" , Stefano Garzarella , Paolo Bonzini , Oliver Steffen , Richard Henderson , Eduardo Habkost , Luigi Leonardi Subject: [PATCH v2 3/5] igvm: move file load to complete callback Date: Thu, 11 Dec 2025 11:54:17 +0100 Message-ID: <20251211105419.3573449-4-kraxel@redhat.com> In-Reply-To: <20251211105419.3573449-1-kraxel@redhat.com> References: <20251211105419.3573449-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=kraxel@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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1765450527168158500 Content-Type: text/plain; charset="utf-8" Add UserCreatableClass->complete callback function for igvm-cfg object. Move file loading and parsing of the igvm file from the process function to the new complete() callback function. Keep the igvm file loaded after processing, release it in finalize() instead, so we parse it only once. Signed-off-by: Gerd Hoffmann Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella --- include/system/igvm-internal.h | 5 +++++ backends/igvm-cfg.c | 18 ++++++++++++++++++ backends/igvm.c | 9 ++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h index e0452080b127..d378d682b0fb 100644 --- a/include/system/igvm-internal.h +++ b/include/system/igvm-internal.h @@ -12,6 +12,8 @@ #include "qemu/typedefs.h" #include "qom/object.h" =20 +#include + struct IgvmCfg { ObjectClass parent_class; =20 @@ -21,7 +23,10 @@ struct IgvmCfg { * format. */ char *filename; + IgvmHandle file; ResettableState reset_state; }; =20 +IgvmHandle qigvm_file_init(char *filename, Error **errp); + #endif diff --git a/backends/igvm-cfg.c b/backends/igvm-cfg.c index e0df3eaa8efd..4014062e0f22 100644 --- a/backends/igvm-cfg.c +++ b/backends/igvm-cfg.c @@ -53,6 +53,13 @@ static void igvm_reset_exit(Object *obj, ResetType type) trace_igvm_reset_exit(type); } =20 +static void igvm_complete(UserCreatable *uc, Error **errp) +{ + IgvmCfg *igvm =3D IGVM_CFG(uc); + + igvm->file =3D qigvm_file_init(igvm->filename, errp); +} + OBJECT_DEFINE_TYPE_WITH_INTERFACES(IgvmCfg, igvm_cfg, IGVM_CFG, OBJECT, { TYPE_USER_CREATABLE }, { TYPE_RESETTABLE_INTERFACE }, @@ -62,6 +69,7 @@ static void igvm_cfg_class_init(ObjectClass *oc, const vo= id *data) { IgvmCfgClass *igvmc =3D IGVM_CFG_CLASS(oc); ResettableClass *rc =3D RESETTABLE_CLASS(oc); + UserCreatableClass *uc =3D USER_CREATABLE_CLASS(oc); =20 object_class_property_add_str(oc, "file", get_igvm, set_igvm); object_class_property_set_description(oc, "file", @@ -73,14 +81,24 @@ static void igvm_cfg_class_init(ObjectClass *oc, const = void *data) rc->phases.enter =3D igvm_reset_enter; rc->phases.hold =3D igvm_reset_hold; rc->phases.exit =3D igvm_reset_exit; + + uc->complete =3D igvm_complete; } =20 static void igvm_cfg_init(Object *obj) { + IgvmCfg *igvm =3D IGVM_CFG(obj); + + igvm->file =3D -1; qemu_register_resettable(obj); } =20 static void igvm_cfg_finalize(Object *obj) { + IgvmCfg *igvm =3D IGVM_CFG(obj); + qemu_unregister_resettable(obj); + if (igvm->file >=3D 0) { + igvm_free(igvm->file); + } } diff --git a/backends/igvm.c b/backends/igvm.c index fbb8300b6d01..a01e01a12a60 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -869,7 +869,7 @@ static int qigvm_handle_policy(QIgvm *ctx, Error **errp) return 0; } =20 -static IgvmHandle qigvm_file_init(char *filename, Error **errp) +IgvmHandle qigvm_file_init(char *filename, Error **errp) { IgvmHandle igvm; g_autofree uint8_t *buf =3D NULL; @@ -898,10 +898,11 @@ int qigvm_process_file(IgvmCfg *cfg, ConfidentialGues= tSupport *cgs, QIgvm ctx; =20 memset(&ctx, 0, sizeof(ctx)); - ctx.file =3D qigvm_file_init(cfg->filename, errp); - if (ctx.file < 0) { + if (cfg->file < 0) { + error_setg(errp, "No IGVM file loaded."); return -1; } + ctx.file =3D cfg->file; =20 /* * The ConfidentialGuestSupport object is optional and allows a confid= ential @@ -992,7 +993,5 @@ cleanup_parameters: g_free(ctx.id_auth); =20 cleanup: - igvm_free(ctx.file); - return retval; } --=20 2.52.0 From nobody Mon Feb 9 03:56:48 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=1765450529; cv=none; d=zohomail.com; s=zohoarc; b=Z0bh4WTaSxEv1k2QEG+ptiE49VgGgjvC5i/hMHSC/tCkTZj3KD125ggq57STAot1PU3Df+gjE6nMogaHn7/xvd1dJ7YkA4heNvfiwZ2jFeYjzoJ6qW3ZbK34m2IJrVfCgWZtg65eeVG6tpzKbU8SqRkKm0TGARdD0YUa4SMsQ0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765450529; 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=jllFb4lPPs3aua/s4mbXOmB0JJq73rvZH4XwtxYwvAY=; b=PFxs3Ncf+aqqtwKTVvYhv16HzR5nhCX6kGAWcHPjugqbLCyfC6GVCqSA1RkrhBXUjMU2r+yLbERjG4bzsBuB2yBXsspFQVawK7f36gcOpjuuE4Ow+3CSCFiUKDjvv7ORVCs3Vdi50UxY+1sxpboyg9JYwDCrTyW/yIBoZLU8/8Q= 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 1765450529488267.7468537282948; Thu, 11 Dec 2025 02:55:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTeJo-0007EP-MZ; Thu, 11 Dec 2025 05:54:44 -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 1vTeJf-0007Bf-Id for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vTeJd-0005XC-Sa for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:34 -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-695-SOMOQ7xSPwiYAGrBu4P2WA-1; Thu, 11 Dec 2025 05:54:29 -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 B69B4195609F; Thu, 11 Dec 2025 10:54:28 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.156]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CA5E1180045B; Thu, 11 Dec 2025 10:54:27 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2F3A41800DD4; Thu, 11 Dec 2025 11:54:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765450473; 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=jllFb4lPPs3aua/s4mbXOmB0JJq73rvZH4XwtxYwvAY=; b=EixUP+XMLl2XKL5Yh95t3ebuxjtALL2mu38NKx3okOzlvc7OyrvGi4lecZCRwjoNhl1yCv K0+GZBqIrXC2H6dRO808+EwcJKIrDI8YWUFK9+9AGFrEAGnpY9gh7itnyjStPS5UuKo3hE guHk30thuB6IP3n3SZ1HWD8ehqmjxVY= X-MC-Unique: SOMOQ7xSPwiYAGrBu4P2WA-1 X-Mimecast-MFC-AGG-ID: SOMOQ7xSPwiYAGrBu4P2WA_1765450468 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Ani Sinha , Marcel Apfelbaum , Gerd Hoffmann , "Michael S. Tsirkin" , Stefano Garzarella , Paolo Bonzini , Oliver Steffen , Richard Henderson , Eduardo Habkost , Luigi Leonardi Subject: [PATCH v2 4/5] igvm: add trace points for igvm file loading and processing Date: Thu, 11 Dec 2025 11:54:18 +0100 Message-ID: <20251211105419.3573449-5-kraxel@redhat.com> In-Reply-To: <20251211105419.3573449-1-kraxel@redhat.com> References: <20251211105419.3573449-1-kraxel@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 client-ip=170.10.129.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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_H2=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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: 1765450531368158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi --- backends/igvm.c | 5 +++++ backends/trace-events | 2 ++ 2 files changed, 7 insertions(+) diff --git a/backends/igvm.c b/backends/igvm.c index a01e01a12a60..4cf7b572347c 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -20,6 +20,8 @@ #include "system/address-spaces.h" #include "hw/core/cpu.h" =20 +#include "trace.h" + #include #include =20 @@ -886,6 +888,8 @@ IgvmHandle qigvm_file_init(char *filename, Error **errp) error_setg(errp, "Unable to parse IGVM file %s: %d", filename, igv= m); return -1; } + + trace_igvm_file_loaded(filename, igvm); return igvm; } =20 @@ -903,6 +907,7 @@ int qigvm_process_file(IgvmCfg *cfg, ConfidentialGuestS= upport *cgs, return -1; } ctx.file =3D cfg->file; + trace_igvm_process_file(cfg->file, onlyVpContext); =20 /* * The ConfidentialGuestSupport object is optional and allows a confid= ential diff --git a/backends/trace-events b/backends/trace-events index 45ac46dc2454..7a00e9bf6c16 100644 --- a/backends/trace-events +++ b/backends/trace-events @@ -26,3 +26,5 @@ iommufd_backend_invalidate_cache(int iommufd, uint32_t id= , uint32_t data_type, u igvm_reset_enter(int type) "type=3D%u" igvm_reset_hold(int type) "type=3D%u" igvm_reset_exit(int type) "type=3D%u" +igvm_file_loaded(const char *fn, int32_t handle) "fn=3D%s, handle=3D0x%x" +igvm_process_file(int32_t handle, bool context_only) "handle=3D0x%x contex= t-only=3D%d" --=20 2.52.0 From nobody Mon Feb 9 03:56:48 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=1765450517; cv=none; d=zohomail.com; s=zohoarc; b=UnnzV5qeNhEhI2f9WpBa1uoWks7UI9IxpNkfj01P725YMMFBJge8dblZPfCFeh/VxlFtpICCtSwAvsYo7ykmpTI13unDp4q0mfwxz0A8LDU3MuZoC+LBkrPxuCq92PSP7FJlYgbohSzmSbC6s8MrusCje4o6uNvXnCUGrDfi/8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765450517; 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=WqXqWzOc1lzy8SYeV8BoLy0ko+D2zg7uRBLNuVhkz/0=; b=XBnI0aJdYrKbNmw2xtsnUQgT1InvQ79ae4LVMkWmXkeD8OMWd2reuUGJ3NHoZlgXUBKUiU1QSKkeC7pVRq3eUeAmyoW616dDDTdgoeTV6xvEmfiIdLoF+vHycBPKTgP1Icd2NTpph7VGv5o2YJB4Vjq/4uuALM/Am8Via7N0Mbk= 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 1765450517892460.716303268832; Thu, 11 Dec 2025 02:55:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTeJo-0007F9-ON; Thu, 11 Dec 2025 05:54:44 -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 1vTeJh-0007C0-8R for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vTeJf-0005XN-Cn for qemu-devel@nongnu.org; Thu, 11 Dec 2025 05:54:36 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-19-SpNjPb0NM1OtSEtucQNCaQ-1; Thu, 11 Dec 2025 05:54:30 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 532E118001C6; Thu, 11 Dec 2025 10:54:29 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.156]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 05009195398A; Thu, 11 Dec 2025 10:54:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 444911800DD5; Thu, 11 Dec 2025 11:54:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765450474; 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=WqXqWzOc1lzy8SYeV8BoLy0ko+D2zg7uRBLNuVhkz/0=; b=VKysb8Hpq86y8XG3MKpWisqaiZ/g67z8f6JSJqC1VgeBjUAD328N7kPSQNLPJKwXCQpP5v vPzDNRSaONhX/OrNnWJgAThNhxhnwQauOJmUJ0b+50Hrllz9dKL9DnPOgNuE4TSae2UwCi p8MhIJ263Tt5WqFw6Cza7q8ikLHSvVY= X-MC-Unique: SpNjPb0NM1OtSEtucQNCaQ-1 X-Mimecast-MFC-AGG-ID: SpNjPb0NM1OtSEtucQNCaQ_1765450469 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Ani Sinha , Marcel Apfelbaum , Gerd Hoffmann , "Michael S. Tsirkin" , Stefano Garzarella , Paolo Bonzini , Oliver Steffen , Richard Henderson , Eduardo Habkost , Luigi Leonardi Subject: [PATCH v2 5/5] igvm: move igvm file processing to reset callbacks Date: Thu, 11 Dec 2025 11:54:19 +0100 Message-ID: <20251211105419.3573449-6-kraxel@redhat.com> In-Reply-To: <20251211105419.3573449-1-kraxel@redhat.com> References: <20251211105419.3573449-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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.129.124; envelope-from=kraxel@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_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1765450520113158500 Content-Type: text/plain; charset="utf-8" Move igvm file processing from machine init to reset callbacks. With that the igvm file is properly re-loaded on reset. Also the loading happens later in the init process now. This will simplify future support for some IGVM parameters which depend on initialization steps which happen after machine init. Signed-off-by: Gerd Hoffmann Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella --- backends/igvm-cfg.c | 7 +++++++ hw/i386/pc_piix.c | 10 ---------- hw/i386/pc_q35.c | 10 ---------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/backends/igvm-cfg.c b/backends/igvm-cfg.c index 4014062e0f22..8c77db8c57c6 100644 --- a/backends/igvm-cfg.c +++ b/backends/igvm-cfg.c @@ -16,6 +16,8 @@ #include "system/igvm-internal.h" #include "system/reset.h" #include "qom/object_interfaces.h" +#include "hw/qdev-core.h" +#include "hw/boards.h" =20 #include "trace.h" =20 @@ -45,7 +47,12 @@ static void igvm_reset_enter(Object *obj, ResetType type) =20 static void igvm_reset_hold(Object *obj, ResetType type) { + MachineState *ms =3D MACHINE(qdev_get_machine()); + IgvmCfg *igvm =3D IGVM_CFG(obj); + trace_igvm_reset_hold(type); + + qigvm_process_file(igvm, ms->cgs, false, &error_fatal); } =20 static void igvm_reset_exit(Object *obj, ResetType type) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7b3611e973cd..b3b71df64bfc 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -320,16 +320,6 @@ static void pc_init1(MachineState *machine, const char= *pci_type) x86_nvdimm_acpi_dsmio, x86ms->fw_cfg, OBJECT(pcms)); } - -#if defined(CONFIG_IGVM) - /* Apply guest state from IGVM if supplied */ - if (x86ms->igvm) { - if (IGVM_CFG_GET_CLASS(x86ms->igvm) - ->process(x86ms->igvm, machine->cgs, false, &error_fatal) = < 0) { - g_assert_not_reached(); - } - } -#endif } =20 typedef enum PCSouthBridgeOption { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 6015e639d7bc..f2e6ebfe294c 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -328,16 +328,6 @@ static void pc_q35_init(MachineState *machine) x86_nvdimm_acpi_dsmio, x86ms->fw_cfg, OBJECT(pcms)); } - -#if defined(CONFIG_IGVM) - /* Apply guest state from IGVM if supplied */ - if (x86ms->igvm) { - if (IGVM_CFG_GET_CLASS(x86ms->igvm) - ->process(x86ms->igvm, machine->cgs, false, &error_fatal) = < 0) { - g_assert_not_reached(); - } - } -#endif } =20 #define DEFINE_Q35_MACHINE(major, minor) \ --=20 2.52.0