From nobody Sat Feb 7 05:53:21 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=1769431128; cv=none; d=zohomail.com; s=zohoarc; b=bRIwpu/ySwFyRx/dc6o3LAYWuhgjOcCwwVe57hz7b3HeGE2ZvbTkWQCHUVvi9I3a8vk/kD0WmRqFtEdGwz5y//LLiISPOl529B9Q2qnnRB4tklcufkYx+c0R8Y18W5j3NdJqWcXAibd0HuFl4kRA2Yz4rvkeqP+3rtL9IDR1XjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769431128; 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=A5NLJ5UD5+dnMvS26Q1Yp6YYAXAb+3d9nW4A6QdHp54=; b=Lq8tjHw1TRSc4hH6SUMZVnGpk14hOxujNfDrBryan1JaatiSgKxCx+q/raAHA0PTDUaD1HU/sUbowgAKYpu3UDD5r+8rZSJ0ksmhuqwT4Kk8wXr1M9sbQ1t59gig3WuMQqwpQshPQcjLQUG4pfa00taJ/CJliyEdt8N8NefB1ag= 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 176943112840711.523638109871058; Mon, 26 Jan 2026 04:38:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkLrH-0002d5-3X; Mon, 26 Jan 2026 07:38:19 -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 1vkLr3-0000gT-IZ for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:05 -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 1vkLr1-0004co-Ms for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:05 -0500 Received: from mx-prod-mc-08.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-679-85jpDyZ2MYGjWmErD9SJKg-1; Mon, 26 Jan 2026 07:37:59 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C23D31800370; Mon, 26 Jan 2026 12:37:58 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.34.28]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E07891958DC4; Mon, 26 Jan 2026 12:37:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B14D318000A4; Mon, 26 Jan 2026 13:37:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769431082; 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=A5NLJ5UD5+dnMvS26Q1Yp6YYAXAb+3d9nW4A6QdHp54=; b=C3/FSxfB5sI5JDWf5lqa9Mhm1YCQOhS3/RUgWj/6raUF9fpaTuQChVQ1Pr8/m+WBId+3kI 1gqhyCDG1FodNoQyiztFB6/60RgWSKYVxC0sdxxAJ9FjR66t768oBAXVr9c5P9KHfCpYqN QfkM69B5yoLna7kYbwrZTFhVOViWpi8= X-MC-Unique: 85jpDyZ2MYGjWmErD9SJKg-1 X-Mimecast-MFC-AGG-ID: 85jpDyZ2MYGjWmErD9SJKg_1769431078 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Richard Henderson , Luigi Leonardi , Eduardo Habkost , Ani Sinha , Paolo Bonzini , "Michael S. Tsirkin" , Oliver Steffen , Marcel Apfelbaum , Stefano Garzarella Subject: [PATCH v3 1/5] igvm: reorganize headers Date: Mon, 26 Jan 2026 13:37:51 +0100 Message-ID: <20260126123755.357378-2-kraxel@redhat.com> In-Reply-To: <20260126123755.357378-1-kraxel@redhat.com> References: <20260126123755.357378-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_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: qemu development 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: 1769431132108154100 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 Sat Feb 7 05:53:21 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=1769431151; cv=none; d=zohomail.com; s=zohoarc; b=OBy2Gypq9jKNV76LY2qQvk8l4CLMuZeu73s4S81XNznzeTcfGfINJCfPtos11WcCUUgxaVCUiaItZyYOZvqSgl7Dkypfk2CHtJC+ZRKuvLLK4119OQvSSZzCYWPSfp+pEmvXtzgmMBH8wKVHxm2vyFfJ2Bj+teU9cKFqBIp4k5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769431151; 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=P3jwtFLrRsoSD7kJHtLbFVxmVb0Jk1JceBA+qOlBQYs=; b=fRvw5+5eRDTdZPP1arw6V7PLfdVRY1TMQ7f3n2nKCyIJeJkcn2TYTrJ1/jVeT9yDHgi2ahufY3E15wNb43HBdgb/YmBm2XHZ9BQNT7UocuwKEV6FoM3r6W3luidLiVoF++fY98gcniQ337Dk7sLdwUAdxR9oTLAURYX8arJ/tOk= 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 1769431151483980.1250970096578; Mon, 26 Jan 2026 04:39:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkLrO-0007bM-9K; Mon, 26 Jan 2026 07:38:26 -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 1vkLr5-0001YJ-4W for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:11 -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 1vkLr3-0004d4-AR for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:06 -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-482-aOnVLEx_NO2jUcUDTOxdOA-1; Mon, 26 Jan 2026 07:38:03 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 320EE18005B6; Mon, 26 Jan 2026 12:38:02 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.34.28]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1C06F1800240; Mon, 26 Jan 2026 12:38:01 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C749B18000A9; Mon, 26 Jan 2026 13:37:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769431084; 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=P3jwtFLrRsoSD7kJHtLbFVxmVb0Jk1JceBA+qOlBQYs=; b=XHewMATZMyg8sT3IVerEBWEGNgf8iDJF+wq5CKXqn8WESM8S6F2AR72s9Ncrcd3W+Vxkr9 sSSBPMHTzdYVb6aPpe7RlGnzCxLxXv0aWomjuqHAqzuRD9hGmOPQOhYNyXWfcToT23zDX1 x4lVY0Ciko/WE1KKoXsaCRMyasXp//o= X-MC-Unique: aOnVLEx_NO2jUcUDTOxdOA-1 X-Mimecast-MFC-AGG-ID: aOnVLEx_NO2jUcUDTOxdOA_1769431082 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Richard Henderson , Luigi Leonardi , Eduardo Habkost , Ani Sinha , Paolo Bonzini , "Michael S. Tsirkin" , Oliver Steffen , Marcel Apfelbaum , Stefano Garzarella Subject: [PATCH v3 2/5] igvm: make igvm-cfg object resettable Date: Mon, 26 Jan 2026 13:37:52 +0100 Message-ID: <20260126123755.357378-3-kraxel@redhat.com> In-Reply-To: <20260126123755.357378-1-kraxel@redhat.com> References: <20260126123755.357378-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.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_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: qemu development 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: 1769431153630154100 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-internal.h | 2 ++ backends/igvm-cfg.c | 35 +++++++++++++++++++++++++++++++++- backends/trace-events | 5 +++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h index 475a29bbf3d7..ac9e5683cc63 100644 --- a/include/system/igvm-internal.h +++ b/include/system/igvm-internal.h @@ -11,6 +11,7 @@ =20 #include "qemu/typedefs.h" #include "qom/object.h" +#include "hw/core/resettable.h" =20 struct IgvmCfg { ObjectClass parent_class; @@ -21,6 +22,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 e1992ba12f04..62a2f6cc72d0 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 flags, uint64_t page_size, int ret) " iommufd= =3D%d hwpt=3D%u iova=3D0x%"PRIx64" size=3D0x%"PRIx64" flags=3D0x%"PRIx64" p= age_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 Sat Feb 7 05:53:21 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=1769431133; cv=none; d=zohomail.com; s=zohoarc; b=k58DvxF7iB2YR2MyyoJ1OF2QL5cjqAPzVPQee4wdA2wdfwVpupUhDotetFtM+1dRZUc0xer9+A0B3SHotTX7OhZG5kmgSNXQ4VCbuGIQcxgdx1qxBb2O8TS3BBoRQqiI3chsilOrA7ft5OgrecvHFgPr8Bxa0lxvKGrwYHXqDP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769431133; 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=iUpp9/5MK/9rOTV+JoLYPs0Mz7pBOU04NRMcUG9gvbk=; b=cFGEEzBZDA3P4OhU8Jkp7bxOwDN3Fq0VqF8CnM30ycDQsrjt+/YJu6uz+3yo8bnnzNNEK9Fmp67EZ0WiuSKE0QsTrxLr7F4FXBamfRckdv3ggkpiUjfC6hklPQHlHHsm2vO3UE245+2O7iC0bw4Sp2iU3ZjXVbBhmnL5mXE/SIM= 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 1769431133058390.08975629856866; Mon, 26 Jan 2026 04:38:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkLrM-0006Jc-Si; Mon, 26 Jan 2026 07:38:24 -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 1vkLr8-00027q-Sj for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:11 -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 1vkLr7-0004df-55 for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:10 -0500 Received: from mx-prod-mc-08.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-544-HJgXrQd7Ok22jlXRKOolSQ-1; Mon, 26 Jan 2026 07:38:03 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 25CAC18003FC; Mon, 26 Jan 2026 12:38:02 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.34.28]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0860B1956053; Mon, 26 Jan 2026 12:38:01 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DBF281800397; Mon, 26 Jan 2026 13:37:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769431087; 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=iUpp9/5MK/9rOTV+JoLYPs0Mz7pBOU04NRMcUG9gvbk=; b=DPbqM5XXIbQC6Jtqm7CLXR+24ciDHG3J41uBH5l37m5AfyjySj+winXnL0jTDo04tTz+gF 0pKpvu9VxM00Hq7T0q8mNM5QksLvBSWd0yqDvBtbEsru0sWVDm3KeGTfQwmJi/YfLYzqmj 47ZfA+RGrGkJ1TWYutaa7w+sYklr0oc= X-MC-Unique: HJgXrQd7Ok22jlXRKOolSQ-1 X-Mimecast-MFC-AGG-ID: HJgXrQd7Ok22jlXRKOolSQ_1769431082 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Richard Henderson , Luigi Leonardi , Eduardo Habkost , Ani Sinha , Paolo Bonzini , "Michael S. Tsirkin" , Oliver Steffen , Marcel Apfelbaum , Stefano Garzarella Subject: [PATCH v3 3/5] igvm: move file load to complete callback Date: Mon, 26 Jan 2026 13:37:53 +0100 Message-ID: <20260126123755.357378-4-kraxel@redhat.com> In-Reply-To: <20260126123755.357378-1-kraxel@redhat.com> References: <20260126123755.357378-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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_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: qemu development 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: 1769431135817158500 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 ac9e5683cc63..171cec8d0f6c 100644 --- a/include/system/igvm-internal.h +++ b/include/system/igvm-internal.h @@ -13,6 +13,8 @@ #include "qom/object.h" #include "hw/core/resettable.h" =20 +#include + struct IgvmCfg { ObjectClass parent_class; =20 @@ -22,7 +24,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 Sat Feb 7 05:53:21 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=1769431153; cv=none; d=zohomail.com; s=zohoarc; b=P/RN1ZnPn14BguUWTyL3QJTl+cgVFb4rZBy75RXb6MLbu57hlwgnvYonBHW2FRi8Rq7CrYOxNhaYajoYoNOgd7vyJxNumwSDpOpMP8XdRQvQMAIa3H3jkSb29MxYz9XnilA6X0kBx/DWvtXiUvoTq6pHgtBWiasiQehtMpm+Ouo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769431153; 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=EoJX5cl8lGoDYT0vaEzZV0Rmh4wm/v8FFlQ1/pO8shc=; b=NLnwbq3Jo3EQ8EzMRLQIGB1ewWQztuJ7DvvFbTJo/mqf++pToMYOR/2kXOZY/KZ7UhP3y2GxXrtB0S97xF+O5Raw7yxipB4PSjuykbeRUjZjmcaNvn7oJ16bF6CBwd4ugfry70uILo0/e95mScT5W8xcK03RrjvnuunsXzU/cWI= 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 1769431153088385.5077967842335; Mon, 26 Jan 2026 04:39:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkLrK-0005nA-Ly; Mon, 26 Jan 2026 07:38:22 -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 1vkLr7-0001tS-Gh for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:11 -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 1vkLr5-0004da-T6 for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:09 -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-99-7jeBcrxVPDC7Rw6xR5tHoA-1; Mon, 26 Jan 2026 07:38:05 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 BBE9E19775D8; Mon, 26 Jan 2026 12:38:04 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.34.28]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C81D1956053; Mon, 26 Jan 2026 12:38:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id F107B1800601; Mon, 26 Jan 2026 13:37:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769431087; 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=EoJX5cl8lGoDYT0vaEzZV0Rmh4wm/v8FFlQ1/pO8shc=; b=a4WknVAx9fbKP3JXi+8DvfHMlHTE4ijdxi04Q9vLJrrko2BMlWxLUOLOFlTs5n887v2Ony iXSmqklacNi4DLVrvA0rlQiSf6nJXAkwBY2at10Lc5tjOjnLx3WkSgr5e3WZdQI6SIrG9D 4KAm4AxK7WULYHR7hcu80qqVqxJV0lo= X-MC-Unique: 7jeBcrxVPDC7Rw6xR5tHoA-1 X-Mimecast-MFC-AGG-ID: 7jeBcrxVPDC7Rw6xR5tHoA_1769431084 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Richard Henderson , Luigi Leonardi , Eduardo Habkost , Ani Sinha , Paolo Bonzini , "Michael S. Tsirkin" , Oliver Steffen , Marcel Apfelbaum , Stefano Garzarella Subject: [PATCH v3 4/5] igvm: add trace points for igvm file loading and processing Date: Mon, 26 Jan 2026 13:37:54 +0100 Message-ID: <20260126123755.357378-5-kraxel@redhat.com> In-Reply-To: <20260126123755.357378-1-kraxel@redhat.com> References: <20260126123755.357378-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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_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: qemu development 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: 1769431155263158500 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 62a2f6cc72d0..6692d54d1346 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 Sat Feb 7 05:53:21 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=1769431146; cv=none; d=zohomail.com; s=zohoarc; b=kfKpVjh+heIBym8WX+4F+0YqrVklo81ZyoNH3B3IxiKtChySbhnGslP0KZPxUGBkEOSNmevkILk31hRsz5qtIiT68ErCTw35e9JR8TG2nwBJbp4nBxaFm3TyPFgHf0lrsc+bjmad2N8R9s3cYgPjq7RxYuwKNQUNb0lnUMs9Z7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769431146; 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=eG76UtdNuETi+vbhjS1uSVE1rLfPeT7xhnfPao0pqK8=; b=YIgF1m6pHoZdk8Q9RzsggYanutVc627nvF8QiHoAiW5FOlTJ7rxjafZVXm2eJtk6bt2IAPLZ3pd5hOJ/w2e6bEjAHFwc8xQTgmGv9QgZBD8NIaT5hdTOBh+nSYZMALqBilz61ApnqTIby7ztoHZO4S09KqTcGnPSbR+S9MPn158= 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 1769431146233944.3651089509941; Mon, 26 Jan 2026 04:39:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkLrP-000841-5W; Mon, 26 Jan 2026 07:38:27 -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 1vkLrD-0004LW-6l for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:18 -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 1vkLr8-0004dy-96 for qemu-devel@nongnu.org; Mon, 26 Jan 2026 07:38:11 -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-74-OWtBDYY_O_W5TNP5adXUNA-1; Mon, 26 Jan 2026 07:38:06 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 526001944F11; Mon, 26 Jan 2026 12:38:05 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.34.28]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 58E3A180009E; Mon, 26 Jan 2026 12:38:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 12A8F180060B; Mon, 26 Jan 2026 13:37:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769431089; 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=eG76UtdNuETi+vbhjS1uSVE1rLfPeT7xhnfPao0pqK8=; b=K7xYttuxhO/yXr+Ml1254PpzCsE+cE4Nre2W9G7IrCH4ZVICUBzASLJ12pDnEsqoK7yV4Q zX5nDY6H2oqa6z2V0mv78PksFhXeTQMDLQYD8GoZf+eUqvvNueIwCA/EjgDheHhTiDluVK OwnwBxrz6XqUfMHnxuFVpbCZ/KXl1EI= X-MC-Unique: OWtBDYY_O_W5TNP5adXUNA-1 X-Mimecast-MFC-AGG-ID: OWtBDYY_O_W5TNP5adXUNA_1769431085 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Richard Henderson , Luigi Leonardi , Eduardo Habkost , Ani Sinha , Paolo Bonzini , "Michael S. Tsirkin" , Oliver Steffen , Marcel Apfelbaum , Stefano Garzarella Subject: [PATCH v3 5/5] igvm: move igvm file processing to reset callbacks Date: Mon, 26 Jan 2026 13:37:55 +0100 Message-ID: <20260126123755.357378-6-kraxel@redhat.com> In-Reply-To: <20260126123755.357378-1-kraxel@redhat.com> References: <20260126123755.357378-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.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_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: qemu development 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: 1769431147213158500 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..f236b523df3b 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/core/qdev.h" +#include "hw/core/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 fea158fc4bfe..878db5721b78 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 4d6046e47b0d..6e5a23d718f1 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