From nobody Sat Feb 7 05:53:59 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=1770120263; cv=none; d=zohomail.com; s=zohoarc; b=mv/7jQm/Tt3+gVA7qO59y7eDiPg+qlwolXM995n5cgnhg9VlJuYQWqBZOgL0gxxwIRuM5HFkywKIwEyeyT/HgftUN07/2lKnIvKcrX/sfA0FcePl1OilS7VIgQDrkwgBmGdAZ3MDpwJi2T9hEPSqXe8SNapAi+zUtm895SQrRQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120263; 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=50eLgHjC/pRtKcjo/0ngsF0jANwn8Iv9jNM2r9PWzZQ=; b=c5ejYVi8bBhg2Ww7j2KbqejmQmiz1qd0glXEcJ8UYTeD+L9NhQK4TA6PEPUaznbS74rM6x7N+dkOWeVTTeG4xK3sFTLG5cfGVt+Kg1Kv+wPTNOXWrWvytujmTa+/okW/2+Bc2hJZsamjvDzpVhtazXTPyMZ9nifAcBvU5xnv8oU= 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 1770120263619739.148716155965; Tue, 3 Feb 2026 04:04:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8Y-0007jo-Nt; Tue, 03 Feb 2026 07:04:11 -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 1vnF8N-0007ih-6M for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:55 -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 1vnF8K-0007dP-Fo for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:54 -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-382-CzjAfwm1MqCbnoxzsYSuWw-1; Tue, 03 Feb 2026 07:03:48 -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 AD98F1954B0B; Tue, 3 Feb 2026 12:03:46 +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 9D31E19560B2; Tue, 3 Feb 2026 12:03:45 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7828718003B5; Tue, 03 Feb 2026 13:03:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120231; 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=50eLgHjC/pRtKcjo/0ngsF0jANwn8Iv9jNM2r9PWzZQ=; b=eNQ9YyGmZyehmDDG7pI56L/hjqocm4IKSS+LLajcKcxUcG0aCFtQ7SSeGuZajD53/znwAN juFCAm8tgVQ0QxGvbjbTimYH/aEqELD9QEersJZrTYkOIc47BI5r3fTcCKSLxjJGtuNpe4 hYTMcvnDqDbwgBRWid92h+EM9qEZ2Ho= X-MC-Unique: CzjAfwm1MqCbnoxzsYSuWw-1 X-Mimecast-MFC-AGG-ID: CzjAfwm1MqCbnoxzsYSuWw_1770120226 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Jim MacArthur , Luigi Leonardi Subject: [PULL 01/17] docs/system/igvm.rst: Update external links Date: Tue, 3 Feb 2026 13:03:26 +0100 Message-ID: <20260203120343.656961-2-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: -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: 1770120264847154100 Content-Type: text/plain; charset="utf-8" From: Jim MacArthur * Fixes link to AMD64 Architecture Programmer's Manual and bumps version to 3.43. * Updates link to buildigvm to new home on GitLab. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3247 Signed-off-by: Jim MacArthur Reviewed-by: Luigi Leonardi Message-ID: <20260119-igvm-documentation-fix-v2-1-b2f6174e3f4f@linaro.org> Signed-off-by: Gerd Hoffmann --- docs/system/igvm.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/system/igvm.rst b/docs/system/igvm.rst index 79508d958802..9db8ae43d21d 100644 --- a/docs/system/igvm.rst +++ b/docs/system/igvm.rst @@ -166,8 +166,8 @@ References ---------- =20 [1] AMD64 Architecture Programmer's Manual, Volume 2: System Programming - Rev 3.41 - https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/pro= grammer-references/24593.pdf + Rev 3.43 + https://docs.amd.com/v/u/en-US/24593_3.43 =20 [2] ``buildigvm`` - A tool to build example IGVM files containing OVMF fir= mware - https://github.com/roy-hopkins/buildigvm \ No newline at end of file + https://gitlab.com/qemu-project/buildigvm --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120318; cv=none; d=zohomail.com; s=zohoarc; b=Fv7PUPZhwUj4cVqp3LLC9raIBvDtRO/XURe/pmJ4J/T6QQDR1C6iyhuElBL9deyYzUc/V665x7mnyJe87EnYpf98iaulWL1eprkZvs9+ztcKKrEhI+w6t52/G5UoPr/FrF+QEuFaUW7RkczARiwZPJwlf25t14Yl1UY6JDAG5/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120318; 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=Xy03svltU4Y5GVcVkCL5E2/K3QxUGGXfGHcqgu8QIGQ=; b=OZb6Bk/OK/xC6ZSmlTL3vztXHy7LsafyLghLYOT9eeQypcE0cr8a2mnamwsP9DoAorTHqgdhG+osxHHPCzXk3sUBtnpMrQAjpS6dMVpx1tCCcVui4sXlnLUUVWqGYM4Ev3F983DQ7rrUfP//MJYb7vQsMdHiBznAvTutfQ9cp7E= 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 1770120318827389.57843653288774; Tue, 3 Feb 2026 04:05:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8j-0007yF-TU; Tue, 03 Feb 2026 07:04:18 -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 1vnF8N-0007in-W0 for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:57 -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 1vnF8L-0007dg-Ux for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:55 -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-146-EUMjdSCPO76xXldnEZT6-w-1; Tue, 03 Feb 2026 07:03:50 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0F0881956089; Tue, 3 Feb 2026 12:03:49 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.34.28]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7CA8A30001A7; Tue, 3 Feb 2026 12:03:48 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 88D281800606; Tue, 03 Feb 2026 13:03:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120233; 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=Xy03svltU4Y5GVcVkCL5E2/K3QxUGGXfGHcqgu8QIGQ=; b=chkpbzVe2LTUIUTcHwk/Sx9PWc0FkNYZhCmHyJKG24V3vChsvjCYd2+jPqpeKGTnjtV6hn n7AOcATELA2FyfZdEe19hnE3nPCDKa0050MiC4bwL0a+roUEj72I+06x0RIPxtY1e5Ml/Q kT3Fo7JFY3be5QnuANSA+l12+0ryzVQ= X-MC-Unique: EUMjdSCPO76xXldnEZT6-w-1 X-Mimecast-MFC-AGG-ID: EUMjdSCPO76xXldnEZT6-w_1770120229 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann Subject: [PULL 02/17] hw/uefi: skip time check for append-write updates. Date: Tue, 3 Feb 2026 13:03:27 +0100 Message-ID: <20260203120343.656961-3-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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_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: 1770120321478154100 Content-Type: text/plain; charset="utf-8" Only execute the time time check if the EFI_VARIABLE_APPEND_WRITE bit is clear. For append-write updates the timestamp verification is not needed. See uefi spec, section "8.2.6 Using the EFI_VARIABLE_AUTHENTICATION_2 descriptor" Fixes: db1ecfb473ac ("hw/uefi: add var-service-vars.c") Signed-off-by: Gerd Hoffmann Message-ID: <20251104102714.733078-1-kraxel@redhat.com> --- hw/uefi/var-service-vars.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/uefi/var-service-vars.c b/hw/uefi/var-service-vars.c index 8533533ea5c8..52845e9723d3 100644 --- a/hw/uefi/var-service-vars.c +++ b/hw/uefi/var-service-vars.c @@ -475,7 +475,8 @@ static size_t uefi_vars_mm_set_variable(uefi_vars_state= *uv, mm_header *mhdr, goto rollback; } if (old_var && new_var) { - if (uefi_time_compare(&old_var->time, &new_var->time) > 0)= { + if ((va->attributes & EFI_VARIABLE_APPEND_WRITE) =3D=3D 0 = && + uefi_time_compare(&old_var->time, &new_var->time) > 0)= { trace_uefi_vars_security_violation("time check failed"= ); mvar->status =3D EFI_SECURITY_VIOLATION; goto rollback; --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120262; cv=none; d=zohomail.com; s=zohoarc; b=KWJCUxkp38B2itrD/Ftt4qLpS4v1NqdOfOA+5UBzd6hsnVY/NhRqdTVxlYfPtH8mcCI8MBp4HFnMhuXRdopPMb7tCEqZ3uk9C/+ZdX4LL3KsoMGTtOR7Y8YbSrr4Zr8xP7NS+GIGN050n/SEmEtFbg5xwAL1PR9j9fRjflwJ8Ko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120262; 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=aeUdPIwin4GXCOHm1PtZBkwiEuXj89BYMFu+KGQfKm4=; b=hyVQ+SeUn5Elg583O49KVgLkzV3Y6ZOTgkGlp8HU1s+9ro7vdST6GOIC8HY2Z5F57cTxFwdX+cEg5XSFMf1JZ94uNnscwSOMxw1yrqWjSmbIdZDETu4nuseOCaiFJMLjROkqUOwygDWZ5ijr0mb28CfU4n0h3qCLwN/M0BusFbw= 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 1770120262977233.879787975843; Tue, 3 Feb 2026 04:04:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8f-0007lV-Js; Tue, 03 Feb 2026 07:04:15 -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 1vnF8O-0007iu-5N for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:57 -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 1vnF8M-0007dt-N5 for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:55 -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-107-fqGLuXVfO1mIKDGwsjPA-w-1; Tue, 03 Feb 2026 07:03:50 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D2981956052; Tue, 3 Feb 2026 12:03:49 +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 DA334180094B; Tue, 3 Feb 2026 12:03:48 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 981191800623; Tue, 03 Feb 2026 13:03:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120233; 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=aeUdPIwin4GXCOHm1PtZBkwiEuXj89BYMFu+KGQfKm4=; b=CYBtD5+z1yEs7J5mqG7l2aMRDQgFu5Fkdm/jD9nB1r8tI3rvWm6C2qseNWwmMg2vQM/B35 5JfmaOX/d/iwXq3KTs2/OKJmdoiVLNHozqwVOlvnTGtKnpkKOmUsgschAwspyWoTxUmwkf zdZLikLdiqRyAPmI9FuzCx+zJC2etMA= X-MC-Unique: fqGLuXVfO1mIKDGwsjPA-w-1 X-Mimecast-MFC-AGG-ID: fqGLuXVfO1mIKDGwsjPA-w_1770120229 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann Subject: [PULL 03/17] hw/uefi: fix size negotiation Date: Tue, 3 Feb 2026 13:03:28 +0100 Message-ID: <20260203120343.656961-4-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: -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: 1770120264954158500 Content-Type: text/plain; charset="utf-8" Payload size is the variable request size, not the total buffer size. Take that into account and subtract header sizes. Fixes: db1ecfb473ac ("hw/uefi: add var-service-vars.c") Signed-off-by: Gerd Hoffmann Message-ID: <20260114104745.3465860-1-kraxel@redhat.com> --- hw/uefi/var-service-vars.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/uefi/var-service-vars.c b/hw/uefi/var-service-vars.c index 52845e9723d3..94f40ef23684 100644 --- a/hw/uefi/var-service-vars.c +++ b/hw/uefi/var-service-vars.c @@ -593,7 +593,7 @@ uefi_vars_mm_get_payload_size(uefi_vars_state *uv, mm_h= eader *mhdr, return uefi_vars_mm_error(mhdr, mvar, EFI_BAD_BUFFER_SIZE); } =20 - ps->payload_size =3D uv->buf_size; + ps->payload_size =3D uv->buf_size - sizeof(*mhdr) - sizeof(*mvar); mvar->status =3D EFI_SUCCESS; return length; } --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120327; cv=none; d=zohomail.com; s=zohoarc; b=B5Nk+O0290p/R4DVIj/oD5F5ce6Ti3ZOP1i0bgCoBIva68kwOy6EmsOkcLK7wQvr7HVAe0E5sbaNpjaIEaPgFdMucGoOt9CO0tpMlvtIHgCtad9XvNQbL6lldVQPlZDBb/Wr/QANSzPabiO5gjYk5/5DCjxkTCvjDRXBxaGvUFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120327; 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=94g7mivH60rDzW0871uzSXpoDqoV+knONpW2UR0CSeY=; b=M4opw+zz3AlHkcL+vxi1plzYXS0Xe1GJ6TykEhBgd0yNNWKVMixT/qm7F9TMzd886EWiorZc2RXEM/dKeX/RV/KsWr82zygWgkvEWIm1IMG7zZOZUKVScUHqJYpMjFenXuMNRjU/GuKTAggSuhXK+PnZ6nvOgskKBjfJC6e4+a4= 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 1770120327432173.8165473794047; Tue, 3 Feb 2026 04:05:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8j-0007x4-Ma; Tue, 03 Feb 2026 07:04:17 -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 1vnF8R-0007jX-8U for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:59 -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 1vnF8P-0007eW-ON for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:59 -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-308-cXuFFGVLMrCKma1HhIpk2Q-1; Tue, 03 Feb 2026 07:03:53 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F2E871956094; Tue, 3 Feb 2026 12:03:51 +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 4633618004D8; Tue, 3 Feb 2026 12:03:51 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B43F81800635; Tue, 03 Feb 2026 13:03:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120236; 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=94g7mivH60rDzW0871uzSXpoDqoV+knONpW2UR0CSeY=; b=NyPIm86J3iVxWePRuFjhXneiUbKdu2aDZn2D0Qg0MAch6TpK1Zt6sjXDOsGq/ZOI6cpH6a K5sFdYwfprdYBttW4qb4Zxhp0FO0QYIjoJ9MTDUrkDCMZhHvVKWdAMx+P7hzLfdyhekbW1 tY9L0HXnBypjvEzw5f5b72pDREcSGss= X-MC-Unique: cXuFFGVLMrCKma1HhIpk2Q-1 X-Mimecast-MFC-AGG-ID: cXuFFGVLMrCKma1HhIpk2Q_1770120232 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann Subject: [PULL 04/17] igvm: reorganize headers Date: Tue, 3 Feb 2026 13:03:29 +0100 Message-ID: <20260203120343.656961-5-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: 1770120329666154100 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. Reviewed-by: Stefano Garzarella Signed-off-by: Gerd Hoffmann Message-ID: <20260126123755.357378-2-kraxel@redhat.com> --- 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:59 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=1770120281; cv=none; d=zohomail.com; s=zohoarc; b=dH2yhLuxPUG00YthCyVXdKJhYljMkzdQepXTApnejzs4LBw8bzbwULuACUdN4YxFCzL2BAe+7RwtwlTujwviDVDhziXovfvkk9M9uRPr6Mfx0xHNwiVg6cTYQgrs6JjQXIln3DzLdL+9qNKMhpnFO0ga9IYJqEuc+KTTbHKndl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120281; 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=sRLBbgFTDogr0mxQlU7Ar0SmLCofwAXBKtnT/vctrJQ=; b=S6t9ZJdSOGt24UUW+4tH5PgkVyjRsQ4Ed+lwcb5Og/RYq64LpCuVhRh7BaU3Cbrg51A3jXFsbnirM9bZWnNyfbGQa9PB+HbMrQ21mvcVORio55i5sn3pLFojM4x65bQmHowAHNwowQHhKQcjnNT9wzbqYkhujqadIIWBPSiV7m8= 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 1770120281671608.4715048744741; Tue, 3 Feb 2026 04:04:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF95-0000Jp-Pa; Tue, 03 Feb 2026 07:04:39 -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 1vnF8R-0007jY-AK for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:59 -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 1vnF8P-0007eU-OT for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:03:59 -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-610-wsp-GSfcP66iktyslz1m9A-1; Tue, 03 Feb 2026 07:03:53 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3591E18003FD; Tue, 3 Feb 2026 12:03:52 +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 6115018007D2; Tue, 3 Feb 2026 12:03:51 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C8F6B1800637; Tue, 03 Feb 2026 13:03:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120236; 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=sRLBbgFTDogr0mxQlU7Ar0SmLCofwAXBKtnT/vctrJQ=; b=PFktVqv0/8jS7l07fOe97mXHA9DIxnKDY3DlYkN3wEM7ayxh4dfSmhVfBAWsj1f6VSSaN+ iuLouIbuSBH0EL7pEnETWSMQvojaKzg97emJXjCweJCZWwpSoRCsydgR4wUfgW0pLhIGTl sYKOiQko3KINPkwvmKbmhMOLZLy7mmg= X-MC-Unique: wsp-GSfcP66iktyslz1m9A-1 X-Mimecast-MFC-AGG-ID: wsp-GSfcP66iktyslz1m9A_1770120232 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann Subject: [PULL 05/17] igvm: make igvm-cfg object resettable Date: Tue, 3 Feb 2026 13:03:30 +0100 Message-ID: <20260203120343.656961-6-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: 1770120283132158500 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. Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella Signed-off-by: Gerd Hoffmann Message-ID: <20260126123755.357378-3-kraxel@redhat.com> --- 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 14a7ecf5aaf4..87e0c636ec02 100644 --- a/backends/trace-events +++ b/backends/trace-events @@ -23,3 +23,8 @@ iommufd_backend_get_dirty_bitmap(int iommufd, uint32_t hw= pt_id, uint64_t iova, u 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)" iommufd_backend_alloc_viommu(int iommufd, uint32_t dev_id, uint32_t type, = uint32_t hwpt_id, uint32_t viommu_id, int ret) " iommufd=3D%d type=3D%u dev= _id=3D%u hwpt_id=3D%u viommu_id=3D%u (%d)" iommufd_backend_alloc_vdev(int iommufd, uint32_t dev_id, uint32_t viommu_i= d, uint64_t virt_id, uint32_t vdev_id, int ret) " iommufd=3D%d dev_id=3D%u = viommu_id=3D%u virt_id=3D0x%"PRIx64" vdev_id=3D%u (%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:59 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=1770120321; cv=none; d=zohomail.com; s=zohoarc; b=Jdo5wmAUOw/qb/33CWHfyl/OMGUyyiRCokWQ1Iz+aE1neDUJ525NCyZyRpEXz58nyWcs9IPAPqdvYoBJekgDXRzd3bWvmHy/QotrwobQrcNb95biNcclRmoQ1FSKDzNSzrvKt0r35zRttvgaaw4iz3ozMKW0r0HKphi07IFUixc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120321; 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=O2yAZjsvESraEcG8eDAOsyuG+02DfRy5k2L12yW5XDU=; b=HN07wFRW1QQqz4Z5unvChMmseLVo2gHX+X2LI1qH41CeWoTzewZ6/I8D6+UQquTG+C6AhUY4vB2ecFYexnSxlh7b2T8Ype4Bx7OHWxOWBqfoR6ILHyz0EQkJ4aFBe8hguEEu+Z/MePYMrvJUq+jHCD75bhyLLo4kqeMGOeiJLQw= 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 1770120321368795.6065630692725; Tue, 3 Feb 2026 04:05:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8j-0007wT-Le; Tue, 03 Feb 2026 07:04:17 -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 1vnF8T-0007jp-IM for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:01 -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 1vnF8S-0007eo-13 for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:01 -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-408-9rXH_ywQNcKrvCavLQOqmA-1; Tue, 03 Feb 2026 07:03:56 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0904C1955F34; Tue, 3 Feb 2026 12:03:55 +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 4A9A81956053; Tue, 3 Feb 2026 12:03:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DDA2D1800639; Tue, 03 Feb 2026 13:03:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120239; 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=O2yAZjsvESraEcG8eDAOsyuG+02DfRy5k2L12yW5XDU=; b=U528B35sTX/UkSlnUpsfLTNmv35e5ZwzOo537upw8nX6xF0AZNBjsqINPq4jiXb05VllZF hz4wHIiIIjZhs2e4GrvKFL1hIaFe5mXKIM1Aa49TcLHL3cfJHUhe5s4RLaVR0wkocOfeA6 /Gs33QmKdHaUe6yuFME5iG05eYtu0CM= X-MC-Unique: 9rXH_ywQNcKrvCavLQOqmA-1 X-Mimecast-MFC-AGG-ID: 9rXH_ywQNcKrvCavLQOqmA_1770120235 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann Subject: [PULL 06/17] igvm: move file load to complete callback Date: Tue, 3 Feb 2026 13:03:31 +0100 Message-ID: <20260203120343.656961-7-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: 1770120323233158500 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. Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella Signed-off-by: Gerd Hoffmann Message-ID: <20260126123755.357378-4-kraxel@redhat.com> --- 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:59 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=1770120280; cv=none; d=zohomail.com; s=zohoarc; b=Sc45JaN2vAZyUuBjAkR8oTz2IpEybw9mq9gE+wpfY73KVl7QO4GaEYAuwinbDOoW165knpJrVx6C3D9J8bsn/FyE5gttao6ImM/6z0WTtCqByjnMgv0lWZFgEFPIPmIGOw23vbuCg9nA4rHrG0hEiw6L/I4itVVfZWsLOd5twJU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120280; 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=qkdoZn+iKo45E0fUEaUBU7em89paVKCLSORYybGXFeU=; b=G18vQF6tcgRcf6C6d3CbBJy6FLqoTcvFdOgyur5dww3QYeF6UA3+PwyzyMgcsK0FCSrchSbUnYVOO9Jhqswd3f2QK4V2Tj0r06q+X4fE9zTDJr7M4Pjk3vg3F/qlDg3+p3Ll5ySZq56k5Ep/hRuacJMyamkvOuu9Fo2AEdk+Oh4= 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 1770120280508820.459344405366; Tue, 3 Feb 2026 04:04:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8l-00083D-3t; Tue, 03 Feb 2026 07:04: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 1vnF8T-0007jq-Up for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04: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 1vnF8S-0007eu-Gv for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:01 -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-359-sHcz83X3P3-8Trh607mlOw-1; Tue, 03 Feb 2026 07:03:56 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4AA85195422D; Tue, 3 Feb 2026 12:03:55 +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 606811955F16; Tue, 3 Feb 2026 12:03:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EFBAD1800988; Tue, 03 Feb 2026 13:03:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120239; 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=qkdoZn+iKo45E0fUEaUBU7em89paVKCLSORYybGXFeU=; b=RL/NZkiv7ysaXZA6DDLXc4VbBs+jRAQaJgWmYwVL639+/Zfor3u+jLPBT+G4SDDqcchZ/U PIilA2QSg5/ZlNnsXkUnErGsvs3NGrh274lxauDvIRmuuSNR1Fj91j2tug95XYIQho1ktw QEPQymJP4WHEr3RrHzUXH74JcWu+GXM= X-MC-Unique: sHcz83X3P3-8Trh607mlOw-1 X-Mimecast-MFC-AGG-ID: sHcz83X3P3-8Trh607mlOw_1770120235 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Luigi Leonardi Subject: [PULL 07/17] igvm: add trace points for igvm file loading and processing Date: Tue, 3 Feb 2026 13:03:32 +0100 Message-ID: <20260203120343.656961-8-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: 1770120283084154100 Content-Type: text/plain; charset="utf-8" Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi Signed-off-by: Gerd Hoffmann Message-ID: <20260126123755.357378-5-kraxel@redhat.com> --- 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 87e0c636ec02..8dc64a20d3d9 100644 --- a/backends/trace-events +++ b/backends/trace-events @@ -28,3 +28,5 @@ iommufd_backend_alloc_vdev(int iommufd, uint32_t dev_id, = uint32_t viommu_id, uin 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:59 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=1770120318; cv=none; d=zohomail.com; s=zohoarc; b=YVXZJaV4LzMjLu3HzpqGPEiq79r3L8twR90lsnrQb1Aqy/T4aXgQLCT8KnNl88UY+DmutAEf4zajzU87XkR/eFIKBKftxXReRfhFFaLnenyyGMt8L1GCg5IGtYOcU6m9mCujBKIH3vDACRVrcyFH/oZ6rw3+aGhGuFKzWqsQWsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120318; 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=RmXmcEqa3262D5qIjCHLmaAOTgx6BTKLMY37a3LazWY=; b=XslW7ZU/sQ7rRvJ2ZeByOOjc2IZ7KtNdr/19Ex8L0y9ZDJy7Mk83CxsmtQdAnBi8t46pmKfYX4l5jospruC8f2bhg+XAwt+2xbiM7wwzqTGh+YHCpTKJ34vc3ScdI9XRjXejeg5aIdp0904/Raj0e8UAyY7USyEbT3pTQo9t+1A= 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 1770120318378687.6607004678604; Tue, 3 Feb 2026 04:05:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8v-0008QN-5a; Tue, 03 Feb 2026 07:04:30 -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 1vnF8Y-0007le-57 for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:09 -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 1vnF8W-0007fJ-G3 for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:05 -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-32-mTO2un3sPhi48GGBvGocSQ-1; Tue, 03 Feb 2026 07:03:58 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9D18619560B5; Tue, 3 Feb 2026 12:03:57 +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 53EDE1955F16; Tue, 3 Feb 2026 12:03:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 116741800990; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120243; 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=RmXmcEqa3262D5qIjCHLmaAOTgx6BTKLMY37a3LazWY=; b=hQlzr288p3ipuIJdhYZ8cHceVMpaqfil50jpMMJONbJAx7AhbryyO7WQH2YlnVG0BidgB/ 3vjByJ4rPNNwpevcGkOsOJEih5NHzn0i0jGQkshnzPT2z0rMMCWpp5tjTCxxpXOIRvXFIV p0dussBkBO8ZYRXo7V/PnG2/zzLmbRw= X-MC-Unique: mTO2un3sPhi48GGBvGocSQ-1 X-Mimecast-MFC-AGG-ID: mTO2un3sPhi48GGBvGocSQ_1770120237 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann Subject: [PULL 08/17] igvm: move igvm file processing to reset callbacks Date: Tue, 3 Feb 2026 13:03:33 +0100 Message-ID: <20260203120343.656961-9-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: 1770120319465154100 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. Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella Signed-off-by: Gerd Hoffmann Message-ID: <20260126123755.357378-6-kraxel@redhat.com> --- 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 From nobody Sat Feb 7 05:53:59 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=1770120280; cv=none; d=zohomail.com; s=zohoarc; b=lrOCBeu09blPRGxa1sIeP2xlxqY29SUAQXDx/R3kOmwYndZ83zGTKzl9nN1/6352jFesLqnE6v0UNHptOLXLrljzUS/ExJzekuymJA6klg2vx447JcGFJloENOJtN5NhNzsb+MuQDCEZ1gBjKnvDQFV39jhDVHI5+4E3bphOCJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120280; 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=1agyvkjrIJh1mqxFUhB4jvdperkHnQ8oP0vEdyLunIg=; b=lG5AEckx4dDX0zFW8oRuyLB0+bC12GqBBhiFvLDOgpcYxB9iB5J0WmL0bJSO5avfxBtmcBGSUdjkdCkk4hEG6Y45+ytX/Dhm5fTUTpkqwP0vhxsiPWzMN+gG53F9P/ga10jvKHQrEI2ml8uwbhgYJIkBcUx05029Q83QKKCr/Ws= 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 1770120280148755.4089085315549; Tue, 3 Feb 2026 04:04:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8n-00088S-3b; Tue, 03 Feb 2026 07:04:21 -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 1vnF8W-0007lU-FU for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:07 -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 1vnF8V-0007fA-4b for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:04 -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-519-viQ6p2EEN5W2cgpBKk7Ncg-1; Tue, 03 Feb 2026 07:03: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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A54DB18005BA; Tue, 3 Feb 2026 12:03:57 +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 5E82E19560B2; Tue, 3 Feb 2026 12:03:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 241C01807DDE; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120242; 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=1agyvkjrIJh1mqxFUhB4jvdperkHnQ8oP0vEdyLunIg=; b=XehmvBbFR15vvpwFpXVQKapl8mnDGRPRFM4tIcRna6neNSVDVuPKmA9ciQJgquUtq0YOWr bjz0894dU079exkjxgQ9J8tNm3S3/G67MVpzGXy23RjVbXedkkHR1WgINaJ6GnBqiQ9UHu GFNsIakpugjbX9dGgienex5xBspUP74= X-MC-Unique: viQ6p2EEN5W2cgpBKk7Ncg-1 X-Mimecast-MFC-AGG-ID: viQ6p2EEN5W2cgpBKk7Ncg_1770120237 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Oliver Steffen Subject: [PULL 09/17] hw/acpi: Make acpi_checksum() public Date: Tue, 3 Feb 2026 13:03:34 +0100 Message-ID: <20260203120343.656961-10-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: 1770120283078154100 Content-Type: text/plain; charset="utf-8" From: Oliver Steffen Make the ACPI table checksum calculation function (in core.c) public so it can be reused in other parts of the ACPI code. Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-2-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- include/hw/acpi/acpi.h | 3 +++ hw/acpi/core.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h index 4b8ee094c419..b036116dfb87 100644 --- a/include/hw/acpi/acpi.h +++ b/include/hw/acpi/acpi.h @@ -203,4 +203,7 @@ struct AcpiSlicOem { }; int acpi_get_slic_oem(AcpiSlicOem *oem); =20 +/* core.c */ +int acpi_checksum(const uint8_t *data, int len); + #endif /* QEMU_HW_ACPI_H */ diff --git a/hw/acpi/core.c b/hw/acpi/core.c index d9979b0da949..6b65e587f2a5 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -83,7 +83,10 @@ bool acpi_builtin(void) return true; } =20 -static int acpi_checksum(const uint8_t *data, int len) +/* Calculate the ACPI checksum value so that if used in the corresponding + * header field, the ACPI checksum verification will be successful. + */ +int acpi_checksum(const uint8_t *data, int len) { int sum, i; sum =3D 0; --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120328; cv=none; d=zohomail.com; s=zohoarc; b=ZwS5h30FW/uSZtjfaNlTQ2rxVo+VwHcy+6sREMaT9eTflSVVvqyUi6vT0k77rOJ6NexPC+h3v34keVvXL3YfKKBNH9TsbTKx4rgq6AnODAne1djIzHz2/1pjBj+dbmuD61y7Xk/naSwo6UA2DPTGrPJ0//XoPOIutnFc40WdwRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120328; 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=loXsmGiHRJkptDEGOD1FfWEs1PUecmUMq7dO8U3G78k=; b=aFOo1Zjx0Xi0sGYZnTfZMpn5N1ANZsbvvUdZUXcGtPUns9/0ONKYZriKAp/0vWhxSvOGkAnq7G9KB8JTX0DykYYvrkfTIUz4ATOADgp91ThN6xvgg4UwuRLqyOgWOOy1iTzlpCle7TxioYg8HSifL1gjSMMguOJ46qEhpDAmy4Q= 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 1770120328128497.691035561218; Tue, 3 Feb 2026 04:05:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF95-0000Jk-Ov; Tue, 03 Feb 2026 07:04:39 -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 1vnF8Z-0007lg-Ax for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:12 -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 1vnF8X-0007fk-UE for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:07 -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-599-N_6GyYj4OmS5QqCHGo2Kzg-1; Tue, 03 Feb 2026 07:04:01 -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 7891718005B6; Tue, 3 Feb 2026 12:04:00 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.34.28]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C9B0F30001A7; Tue, 3 Feb 2026 12:03:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 344DB1807DE5; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120244; 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=loXsmGiHRJkptDEGOD1FfWEs1PUecmUMq7dO8U3G78k=; b=gYCI/neDhFqMJsuDMLcrTMe60LgYf0EmgGbXPvMjRYSKfIMKLYuHAtUbFLe/I1UKdtmejp GUrOVXRRWd72FbqodLLSpznta4XKThv6g/idVLlW7ramKfQNlJgzLA91FBkh+XYl3WeRKH s4IOJcSGJwIqsiPDFOBMGD3tg8hnm90= X-MC-Unique: N_6GyYj4OmS5QqCHGo2Kzg-1 X-Mimecast-MFC-AGG-ID: N_6GyYj4OmS5QqCHGo2Kzg_1770120240 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Oliver Steffen Subject: [PULL 10/17] hw/acpi: Make BIOS linker optional Date: Tue, 3 Feb 2026 13:03:35 +0100 Message-ID: <20260203120343.656961-11-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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.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: 1770120329222158500 Content-Type: text/plain; charset="utf-8" From: Oliver Steffen Make the BIOS linker optional in acpi_table_end() and calculate the ACPI table checksum directly if no linker is provided. This makes it possible to call for example acpi_build_madt() from outside the ACPI table builder context. Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-3-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- hw/acpi/aml-build.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index dad4cfcc7d80..ea1c415b211b 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -22,6 +22,7 @@ #include "qemu/osdep.h" #include #include "hw/acpi/aml-build.h" +#include "hw/acpi/acpi.h" #include "qemu/bswap.h" #include "qemu/bitops.h" #include "system/numa.h" @@ -1741,6 +1742,7 @@ void acpi_table_end(BIOSLinker *linker, AcpiTable *de= sc) uint32_t table_len =3D desc->array->len - desc->table_offset; uint32_t table_len_le =3D cpu_to_le32(table_len); gchar *len_ptr =3D &desc->array->data[desc->table_offset + 4]; + uint8_t *table; =20 /* patch "Length" field that has been reserved by acpi_table_begin() * to the actual length, i.e. accumulated table length from @@ -1748,8 +1750,14 @@ void acpi_table_end(BIOSLinker *linker, AcpiTable *d= esc) */ memcpy(len_ptr, &table_len_le, sizeof table_len_le); =20 - bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE, - desc->table_offset, table_len, desc->table_offset + checksum_offse= t); + if (linker !=3D NULL) { + bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE, + desc->table_offset, table_len, + desc->table_offset + checksum_offs= et); + } else { + table =3D (uint8_t *) &desc->array->data[desc->table_offset]; + table[checksum_offset] =3D acpi_checksum(table, table_len); + } } =20 void *acpi_data_push(GArray *table_data, unsigned size) --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120329; cv=none; d=zohomail.com; s=zohoarc; b=MQUuv1/pwlMrkbWwWZU5DXcTSkB+d/RSsHVdwhL8e1Aliyt91vGV3gfdjNxoGRMIVpUF1kLD9iMs2u95oq4NIwTX8T1XF7zwO59cQPSQoMC/lEHbzmPpAsZ3NsaUOtB1DMtYXtOjC7t6/IUnzLXuZEEKnDlpdw9QaRgVLCfKwoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120329; 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=ULBT82r83PakWzRBR3bZIimvFJnaS5GsrH66SL5Ftko=; b=asDwhI4mJ+9Afuel6Hl0IUGkgw1X0HuTxROAeNnt/wUUPBlg4/M22oIBvO8mSUA4abxJHDvbH8ES3MZ1lKbB0iewji1cEFiFwI7InmfCgaOsqJAAg0HZrB78iY0QAIU0SEF+J3SVtIGlAsf7zSZIeFXPcyhuiEDQPhkHow8yu6Q= 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 1770120329011357.48987356675445; Tue, 3 Feb 2026 04:05:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF97-0000T6-AY; Tue, 03 Feb 2026 07:04:41 -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 1vnF8Y-0007lf-Ew for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:09 -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 1vnF8X-0007ff-6i for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:06 -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-110-NjpDmlDmMIOhX3JJFdah3g-1; Tue, 03 Feb 2026 07:04:01 -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 0ABF01954234; Tue, 3 Feb 2026 12:04:00 +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 B879719560B2; Tue, 3 Feb 2026 12:03:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 47F2A180AC1C; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120244; 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=ULBT82r83PakWzRBR3bZIimvFJnaS5GsrH66SL5Ftko=; b=cPeJJfVyz3wMbVI9ZjibRKVUlxN1gGQ7ugwmoNPckzOZ3IGQ9YdllLf5l7nPCgSiF/I4yA TwjGqT18iyxgprjiqsZX11sNXvCd/9UymlmcxlStOZEGN7LbdBmLBHgm/5V6lsO+nOjJVJ jqsKbG8FLw2v45XEjkGB28z2+C0+i+c= X-MC-Unique: NjpDmlDmMIOhX3JJFdah3g-1 X-Mimecast-MFC-AGG-ID: NjpDmlDmMIOhX3JJFdah3g_1770120240 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Oliver Steffen Subject: [PULL 11/17] hw/acpi: Add standalone function to build MADT Date: Tue, 3 Feb 2026 13:03:36 +0100 Message-ID: <20260203120343.656961-12-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: -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: 1770120331192158500 Content-Type: text/plain; charset="utf-8" From: Oliver Steffen Add a function called `acpi_build_madt_standalone()` that builds a MADT without the rest of the ACPI table structure. Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-4-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- hw/i386/acpi-build.h | 2 ++ hw/i386/acpi-build.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h index 8ba3c33e4831..00e19bbe5edf 100644 --- a/hw/i386/acpi-build.h +++ b/hw/i386/acpi-build.h @@ -8,4 +8,6 @@ extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmi= o; void acpi_setup(void); Object *acpi_get_i386_pci_host(void); =20 +GArray *acpi_build_madt_standalone(MachineState *machine); + #endif diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 9446a9f862ca..19c62362e31d 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2249,3 +2249,12 @@ void acpi_setup(void) */ acpi_build_tables_cleanup(&tables, false); } + +GArray *acpi_build_madt_standalone(MachineState *machine) +{ + X86MachineState *x86ms =3D X86_MACHINE(machine); + GArray *table =3D g_array_new(false, true, 1); + acpi_build_madt(table, NULL, x86ms, x86ms->oem_id, + x86ms->oem_table_id); + return table; +} --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120328; cv=none; d=zohomail.com; s=zohoarc; b=B9mp5/drEko0ZGr914GeTgfAYZ8ea21++0yVwlj7758AxVz0Brazzod9VQm9bDYxop8hsKeJg1FpK4qXQvBd8uEFHweAttZuq1Hze+Xf/B02Bk3fxk+AflORcI4HmvE/HPzUgs51AikTZT6Qu45e/aWmMtsHj0Tr3AwIJMw/cFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120328; 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=zpyf+w17AybpMWTXFwJ3HLZT/fuObdabqNF+kg5kjEw=; b=MA0EK6y7WNdQk9VBAUrVbazNxHon/Fu4/TiFxJyJ45K+IuKnD39Av6FHmUB3rARnLKtGOBylIaqkvbtabbL5+xEHBidcLBN3emEKqLtM5p0eZyfQ46WHeKGQeJL6SbXIT/ZtfN4Mb4SWGoBo/ON94p89BGiSW4CepiBNCPUM3MU= 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 1770120328186731.3302514033049; Tue, 3 Feb 2026 04:05:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF98-0000b6-9U; Tue, 03 Feb 2026 07:04:42 -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 1vnF8b-0007qk-Ty for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:12 -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 1vnF8a-0007gE-Dt for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:09 -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-509-3L6RRDOjMK6v_AYp3S_m3g-1; Tue, 03 Feb 2026 07:04:04 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C8E57180035C; Tue, 3 Feb 2026 12:04:02 +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 4197F18004D8; Tue, 3 Feb 2026 12:04:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5A6EA1826266; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120247; 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=zpyf+w17AybpMWTXFwJ3HLZT/fuObdabqNF+kg5kjEw=; b=QgiGrGOTs9D+eALjWgN3V7G4js1Sg+JP05Z8jYWBHZR5sMeEpr0QjtqVuaGg8HWDdEGBwl j1lgIdqvJeGaQqcTYHSANTLUeViylqzqHZRsEoftp8E/fbRJ+P9OgZiRmikL7EVYDut9MG PWAl9nuYXpOmWFz/qkZ7kE+hMf+yvlE= X-MC-Unique: 3L6RRDOjMK6v_AYp3S_m3g-1 X-Mimecast-MFC-AGG-ID: 3L6RRDOjMK6v_AYp3S_m3g_1770120242 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Oliver Steffen Subject: [PULL 12/17] igvm: Move structs to internal header Date: Tue, 3 Feb 2026 13:03:37 +0100 Message-ID: <20260203120343.656961-13-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: -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: 1770120329665154100 Content-Type: text/plain; charset="utf-8" From: Oliver Steffen Move QIgvm and QIgvmParameter struct definitions from the source file into an IGVM internal header file to allow implementing architecture specific IGVM code in other places, for example target/i386/igvm.c. Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-5-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- include/system/igvm-internal.h | 40 ++++++++++++++++++++++++++++++++++ backends/igvm.c | 37 ------------------------------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h index 171cec8d0f6c..9c8e887d6f60 100644 --- a/include/system/igvm-internal.h +++ b/include/system/igvm-internal.h @@ -9,10 +9,12 @@ #ifndef QEMU_IGVM_INTERNAL_H #define QEMU_IGVM_INTERNAL_H =20 +#include "qemu/queue.h" #include "qemu/typedefs.h" #include "qom/object.h" #include "hw/core/resettable.h" =20 +#include "system/confidential-guest-support.h" #include =20 struct IgvmCfg { @@ -28,6 +30,44 @@ struct IgvmCfg { ResettableState reset_state; }; =20 +typedef struct QIgvmParameterData { + QTAILQ_ENTRY(QIgvmParameterData) next; + uint8_t *data; + uint32_t size; + uint32_t index; +} QIgvmParameterData; + +/* + * QIgvm contains the information required during processing of a single I= GVM + * file. + */ +typedef struct QIgvm { + IgvmHandle file; + ConfidentialGuestSupport *cgs; + ConfidentialGuestSupportClass *cgsc; + uint32_t compatibility_mask; + unsigned current_header_index; + QTAILQ_HEAD(, QIgvmParameterData) parameter_data; + IgvmPlatformType platform_type; + + /* + * SEV-SNP platforms can contain an ID block and authentication + * that should be verified by the guest. + */ + struct sev_id_block *id_block; + struct sev_id_authentication *id_auth; + + /* Define the guest policy for SEV guests */ + uint64_t sev_policy; + + /* These variables keep track of contiguous page regions */ + IGVM_VHS_PAGE_DATA region_prev_page_data; + uint64_t region_start; + unsigned region_start_index; + unsigned region_last_index; + unsigned region_page_count; +} QIgvm; + IgvmHandle qigvm_file_init(char *filename, Error **errp); =20 #endif diff --git a/backends/igvm.c b/backends/igvm.c index 4cf7b572347c..3a3832dc2dde 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -25,12 +25,6 @@ #include #include =20 -typedef struct QIgvmParameterData { - QTAILQ_ENTRY(QIgvmParameterData) next; - uint8_t *data; - uint32_t size; - uint32_t index; -} QIgvmParameterData; =20 /* * Some directives are specific to particular confidential computing platf= orms. @@ -66,37 +60,6 @@ struct QEMU_PACKED sev_id_authentication { =20 #define IGVM_SEV_ID_BLOCK_VERSION 1 =20 -/* - * QIgvm contains the information required during processing - * of a single IGVM file. - */ -typedef struct QIgvm { - IgvmHandle file; - ConfidentialGuestSupport *cgs; - ConfidentialGuestSupportClass *cgsc; - uint32_t compatibility_mask; - unsigned current_header_index; - QTAILQ_HEAD(, QIgvmParameterData) parameter_data; - IgvmPlatformType platform_type; - - /* - * SEV-SNP platforms can contain an ID block and authentication - * that should be verified by the guest. - */ - struct sev_id_block *id_block; - struct sev_id_authentication *id_auth; - - /* Define the guest policy for SEV guests */ - uint64_t sev_policy; - - /* These variables keep track of contiguous page regions */ - IGVM_VHS_PAGE_DATA region_prev_page_data; - uint64_t region_start; - unsigned region_start_index; - unsigned region_last_index; - unsigned region_page_count; -} QIgvm; - static int qigvm_directive_page_data(QIgvm *ctx, const uint8_t *header_dat= a, Error **errp); static int qigvm_directive_vp_context(QIgvm *ctx, const uint8_t *header_da= ta, --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120295; cv=none; d=zohomail.com; s=zohoarc; b=Jvf6PgsIJwGqhfEvxqnwuY3qqUUcrkiMR0RxW1Ja+9f2NQa+9miFQPBs3KJf2FQK/poHyRO3bFlhH6CqzPOdqqHqYVVCIGBoAAXZuSNaxpwz03VZFWTlrE9+zAeA7GGejp7wDy34wOqaUl+mB145igJa/40pMSF9PFy3d1EJ/vU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120295; 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=MrSw04nlkdlYcIirhB7fqJ0J28GwLGgUnBPN7bI9HoA=; b=QPUk9fIzSZqrdaszt9AFMjWRsnAgLH033N6SsXy2LHyVAdRFzGz5dYpSXKgd5BpHcvEcJMeRU1k7qA+IqA45eJiCor8IrJKIBJHaNlyO/zRwzyAvxhKxaRioTilXnF6q67Q7Nw4NP1FzyHWq2op8v2439NOuZJejGrgVKKTaqfA= 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 1770120295378229.70031942155686; Tue, 3 Feb 2026 04:04:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8p-0008DB-4k; Tue, 03 Feb 2026 07:04:23 -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 1vnF8d-0007th-JD for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:12 -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 1vnF8a-0007gI-FJ for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:11 -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-5-TnnP8uwxMCWj0pkguosPBA-1; Tue, 03 Feb 2026 07:04:04 -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 2F48F18002C4; Tue, 3 Feb 2026 12:04:03 +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 8BEB51956053; Tue, 3 Feb 2026 12:04:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6EDD31826267; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120247; 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=MrSw04nlkdlYcIirhB7fqJ0J28GwLGgUnBPN7bI9HoA=; b=LyagRKoQ5gc4ghqMq5iAFjWm2VA2EhdMMN2a73TBWFk/AhZ6cKqxaJcrs6Nm+9iTYHMKso +e9YR83g1ohFyBp3fVGdAYv5giF87rwzp78TskFf4Q0l1Zvo+ghuT4t9cdjeS243ewx+9X rsDKcfdGnTRW4cfZ4EbqyS7KQFidGaE= X-MC-Unique: TnnP8uwxMCWj0pkguosPBA-1 X-Mimecast-MFC-AGG-ID: TnnP8uwxMCWj0pkguosPBA_1770120243 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Oliver Steffen , Luigi Leonardi Subject: [PULL 13/17] igvm: Add common function for finding parameter entries Date: Tue, 3 Feb 2026 13:03:38 +0100 Message-ID: <20260203120343.656961-14-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: 1770120297245154100 Content-Type: text/plain; charset="utf-8" From: Oliver Steffen Move repeating code for finding the parameter entries in the IGVM backend out of the parameter handlers into a common function. A warning message is emitted in case a no parameter entry can be found for a given index. Reviewed-by: Luigi Leonardi Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-6-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- include/system/igvm-internal.h | 3 + backends/igvm.c | 139 ++++++++++++++++++--------------- 2 files changed, 78 insertions(+), 64 deletions(-) diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h index 9c8e887d6f60..019f95e86615 100644 --- a/include/system/igvm-internal.h +++ b/include/system/igvm-internal.h @@ -70,4 +70,7 @@ typedef struct QIgvm { =20 IgvmHandle qigvm_file_init(char *filename, Error **errp); =20 +QIgvmParameterData* +qigvm_find_param_entry(QIgvm *igvm, uint32_t parameter_area_index); + #endif diff --git a/backends/igvm.c b/backends/igvm.c index 3a3832dc2dde..ea3f9d6b008f 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" =20 #include "qapi/error.h" +#include "qemu/error-report.h" #include "qemu/target-info-qapi.h" #include "system/igvm.h" #include "system/igvm-cfg.h" @@ -60,6 +61,20 @@ struct QEMU_PACKED sev_id_authentication { =20 #define IGVM_SEV_ID_BLOCK_VERSION 1 =20 +QIgvmParameterData* +qigvm_find_param_entry(QIgvm *igvm, uint32_t parameter_area_index) +{ + QIgvmParameterData *param_entry; + QTAILQ_FOREACH(param_entry, &igvm->parameter_data, next) + { + if (param_entry->index =3D=3D parameter_area_index) { + return param_entry; + } + } + warn_report("IGVM: No parameter area for index %u", parameter_area_ind= ex); + return NULL; +} + static int qigvm_directive_page_data(QIgvm *ctx, const uint8_t *header_dat= a, Error **errp); static int qigvm_directive_vp_context(QIgvm *ctx, const uint8_t *header_da= ta, @@ -534,58 +549,54 @@ static int qigvm_directive_memory_map(QIgvm *ctx, con= st uint8_t *header_data, } =20 /* Find the parameter area that should hold the memory map */ - QTAILQ_FOREACH(param_entry, &ctx->parameter_data, next) - { - if (param_entry->index =3D=3D param->parameter_area_index) { - max_entry_count =3D - param_entry->size / sizeof(IGVM_VHS_MEMORY_MAP_ENTRY); - mm_entry =3D (IGVM_VHS_MEMORY_MAP_ENTRY *)param_entry->data; + param_entry =3D qigvm_find_param_entry(ctx, param->parameter_area_inde= x); + if (param_entry =3D=3D NULL) { + return 0; + } =20 - retval =3D get_mem_map_entry(entry, &cgmm_entry, errp); - while (retval =3D=3D 0) { - if (entry >=3D max_entry_count) { - error_setg( - errp, - "IGVM: guest memory map size exceeds parameter are= a defined in IGVM file"); - return -1; - } - mm_entry[entry].starting_gpa_page_number =3D cgmm_entry.gp= a >> 12; - mm_entry[entry].number_of_pages =3D cgmm_entry.size >> 12; + max_entry_count =3D param_entry->size / sizeof(IGVM_VHS_MEMORY_MAP_ENT= RY); + mm_entry =3D (IGVM_VHS_MEMORY_MAP_ENTRY *)param_entry->data; =20 - switch (cgmm_entry.type) { - case CGS_MEM_RAM: - mm_entry[entry].entry_type =3D - IGVM_MEMORY_MAP_ENTRY_TYPE_MEMORY; - break; - case CGS_MEM_RESERVED: - mm_entry[entry].entry_type =3D - IGVM_MEMORY_MAP_ENTRY_TYPE_PLATFORM_RESERVED; - break; - case CGS_MEM_ACPI: - mm_entry[entry].entry_type =3D - IGVM_MEMORY_MAP_ENTRY_TYPE_PLATFORM_RESERVED; - break; - case CGS_MEM_NVS: - mm_entry[entry].entry_type =3D - IGVM_MEMORY_MAP_ENTRY_TYPE_PERSISTENT; - break; - case CGS_MEM_UNUSABLE: - mm_entry[entry].entry_type =3D - IGVM_MEMORY_MAP_ENTRY_TYPE_PLATFORM_RESERVED; - break; - } - retval =3D get_mem_map_entry(++entry, &cgmm_entry, errp); - } - if (retval < 0) { - return retval; - } - /* The entries need to be sorted */ - qsort(mm_entry, entry, sizeof(IGVM_VHS_MEMORY_MAP_ENTRY), - qigvm_cmp_mm_entry); + retval =3D get_mem_map_entry(entry, &cgmm_entry, errp); + while (retval =3D=3D 0) { + if (entry >=3D max_entry_count) { + error_setg( + errp, + "IGVM: guest memory map size exceeds parameter area define= d " + "in IGVM file"); + return -1; + } + mm_entry[entry].starting_gpa_page_number =3D cgmm_entry.gpa >> 12; + mm_entry[entry].number_of_pages =3D cgmm_entry.size >> 12; =20 + switch (cgmm_entry.type) { + case CGS_MEM_RAM: + mm_entry[entry].entry_type =3D IGVM_MEMORY_MAP_ENTRY_TYPE_MEMO= RY; + break; + case CGS_MEM_RESERVED: + mm_entry[entry].entry_type =3D + IGVM_MEMORY_MAP_ENTRY_TYPE_PLATFORM_RESERVED; + break; + case CGS_MEM_ACPI: + mm_entry[entry].entry_type =3D + IGVM_MEMORY_MAP_ENTRY_TYPE_PLATFORM_RESERVED; + break; + case CGS_MEM_NVS: + mm_entry[entry].entry_type =3D IGVM_MEMORY_MAP_ENTRY_TYPE_PERS= ISTENT; + break; + case CGS_MEM_UNUSABLE: + mm_entry[entry].entry_type =3D + IGVM_MEMORY_MAP_ENTRY_TYPE_PLATFORM_RESERVED; break; } + retval =3D get_mem_map_entry(++entry, &cgmm_entry, errp); + } + if (retval < 0) { + return retval; } + /* The entries need to be sorted */ + qsort(mm_entry, entry, sizeof(IGVM_VHS_MEMORY_MAP_ENTRY), + qigvm_cmp_mm_entry); return 0; } =20 @@ -597,18 +608,18 @@ static int qigvm_directive_vp_count(QIgvm *ctx, const= uint8_t *header_data, uint32_t *vp_count; CPUState *cpu; =20 - QTAILQ_FOREACH(param_entry, &ctx->parameter_data, next) + param_entry =3D qigvm_find_param_entry(ctx, param->parameter_area_inde= x); + if (param_entry =3D=3D NULL) { + return 0; + } + + vp_count =3D (uint32_t *)(param_entry->data + param->byte_offset); + *vp_count =3D 0; + CPU_FOREACH(cpu) { - if (param_entry->index =3D=3D param->parameter_area_index) { - vp_count =3D (uint32_t *)(param_entry->data + param->byte_offs= et); - *vp_count =3D 0; - CPU_FOREACH(cpu) - { - (*vp_count)++; - } - break; - } + (*vp_count)++; } + return 0; } =20 @@ -620,15 +631,15 @@ static int qigvm_directive_environment_info(QIgvm *ct= x, QIgvmParameterData *param_entry; IgvmEnvironmentInfo *environmental_state; =20 - QTAILQ_FOREACH(param_entry, &ctx->parameter_data, next) - { - if (param_entry->index =3D=3D param->parameter_area_index) { - environmental_state =3D - (IgvmEnvironmentInfo *)(param_entry->data + param->byte_of= fset); - environmental_state->memory_is_shared =3D 1; - break; - } + param_entry =3D qigvm_find_param_entry(ctx, param->parameter_area_inde= x); + if (param_entry =3D=3D NULL) { + return 0; } + + environmental_state =3D + (IgvmEnvironmentInfo *)(param_entry->data + param->byte_offset); + environmental_state->memory_is_shared =3D 1; + return 0; } =20 --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120305; cv=none; d=zohomail.com; s=zohoarc; b=Ujyxo8ZWYtbrgmVtTcEoFyVtIgeJhXvbMxpKBs4pMDe8HSXthdP9WKWbhaeWs0quTtZ8+kPZzcdu2JdQFSGCNwVFgXEs42Uglxw8g0B/9b7bYSmJDb9F4Jgrk/azkk9D7J1uZ91ugNzTA9voJlLgRoP9ynO1U1EbGdGB2eLJFAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120305; 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=JiiY6hdAG4pbuPdzjGdEJ5gQuntuGsJCEg5mBLcgkBI=; b=jMEYT2Lx7qH/lHjqGTJq3j7JzfSruiIdpc2+ug/bAOcGI5R8yf1uEbcWAUp/IgSXZvxbRlkyg/2e8sIRV63Xl5YycvQTmtwugdWPOx/cUgrF5NCZHWurYh5tecRi4o/GOHwfgi3XIm1tl8A2nK3Www0M4tGv6AT/66U1+1Ss0oE= 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 1770120305865157.73010406937772; Tue, 3 Feb 2026 04:05:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8w-0008RB-Lw; Tue, 03 Feb 2026 07:04:30 -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 1vnF8d-0007ti-Qf for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:12 -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 1vnF8c-0007gT-9p for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04: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-172-F-2lWMMIOTunCZmJ-JDT_g-1; Tue, 03 Feb 2026 07:04:06 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6738F1956054; Tue, 3 Feb 2026 12:04:05 +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 DD8C81800947; Tue, 3 Feb 2026 12:04:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7ED951826269; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120249; 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=JiiY6hdAG4pbuPdzjGdEJ5gQuntuGsJCEg5mBLcgkBI=; b=b6E7Zitmk0Mlk8bXHLHXg236tf/yhtM5PsFn8bs/NM8hdzMQgN3ur4lWhZMOfMnAQbAs9e sOnePn31pIdPXwjbsCzSDStolvup5VKdGIfsfTTg0w+zLZuKHBWtjp/wb5t4hyZMO5tG0/ HJbO/OI+Lg3+IGnT8sllBE4J38MfC40= X-MC-Unique: F-2lWMMIOTunCZmJ-JDT_g-1 X-Mimecast-MFC-AGG-ID: F-2lWMMIOTunCZmJ-JDT_g_1770120245 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Oliver Steffen , Luigi Leonardi Subject: [PULL 14/17] igvm: Refactor qigvm_parameter_insert Date: Tue, 3 Feb 2026 13:03:39 +0100 Message-ID: <20260203120343.656961-15-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: 1770120307306154100 Content-Type: text/plain; charset="utf-8" From: Oliver Steffen Use qigvm_find_param_entry() also in qigvm_parameter_insert(). This changes behavior: Processing now stops after the first parameter entry found. That is OK, because we expect only one matching entry anyway. Reviewed-by: Luigi Leonardi Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-7-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- backends/igvm.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/backends/igvm.c b/backends/igvm.c index ea3f9d6b008f..ffd1c325b661 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -476,31 +476,31 @@ static int qigvm_directive_parameter_insert(QIgvm *ct= x, return 0; } =20 - QTAILQ_FOREACH(param_entry, &ctx->parameter_data, next) - { - if (param_entry->index =3D=3D param->parameter_area_index) { - region =3D qigvm_prepare_memory(ctx, param->gpa, param_entry->= size, - ctx->current_header_index, errp); - if (!region) { - return -1; - } - memcpy(region, param_entry->data, param_entry->size); - g_free(param_entry->data); - param_entry->data =3D NULL; + param_entry =3D qigvm_find_param_entry(ctx, param->parameter_area_inde= x); + if (param_entry =3D=3D NULL) { + return 0; + } =20 - /* - * If a confidential guest support object is provided then use= it to - * set the guest state. - */ - if (ctx->cgs) { - result =3D ctx->cgsc->set_guest_state(param->gpa, region, - param_entry->size, - CGS_PAGE_TYPE_UNMEASUR= ED, 0, - errp); - if (result < 0) { - return -1; - } - } + region =3D qigvm_prepare_memory(ctx, param->gpa, param_entry->size, + ctx->current_header_index, errp); + if (!region) { + return -1; + } + memcpy(region, param_entry->data, param_entry->size); + g_free(param_entry->data); + param_entry->data =3D NULL; + + /* + * If a confidential guest support object is provided then use it to + * set the guest state. + */ + if (ctx->cgs) { + result =3D ctx->cgsc->set_guest_state(param->gpa, region, + param_entry->size, + CGS_PAGE_TYPE_UNMEASURED, 0, + errp); + if (result < 0) { + return -1; } } return 0; --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120297; cv=none; d=zohomail.com; s=zohoarc; b=jmE6a9ZqouhMHPQOsKjdZ/ywvboKlbuKhhChitUr02SB5i0ZNPlzUL/d67ih0vhDZbo04+ylSYXkmzSRSIV8LASKGM3OwwkhEM1xZcudQX0pcGMlKufSqWM3SpDpga6E0mR3v8DNmzZEbLis3PuapdFrCql68/QRVEOsB//4Cig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120297; 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=0aCRPDrxg4NCu6mP5DGl6oPrRVZb+Wkaw1NUKhZqgnI=; b=ftEfGHm6jWjyRaG/HXkGnbu1HChH4AN6BfKNvzZMHbOlCKZdC82Gq+Jxg5TA11S0iw66d+5kO01w/V0F8SthwjY+w57Gm+b2zPzLyfU9/D+MlXwa7yXdurV5nrl/K2nU0rMjB75bQpB+UZlsrHDiVlOFX/WlbJa2g9lS+ydJrNA= 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 1770120297103374.1084855389839; Tue, 3 Feb 2026 04:04:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8l-00082q-2O; Tue, 03 Feb 2026 07:04: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 1vnF8f-0007uI-A1 for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:15 -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 1vnF8d-0007gY-En for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:13 -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-175--qBoOQ6hNIGjAyotWTN-pA-1; Tue, 03 Feb 2026 07:04:07 -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 061EC1956050; Tue, 3 Feb 2026 12:04:06 +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 4BE231800285; Tue, 3 Feb 2026 12:04:05 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9BD79182626B; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120250; 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=0aCRPDrxg4NCu6mP5DGl6oPrRVZb+Wkaw1NUKhZqgnI=; b=gWYpqh/wbIt1cBere5+I+H7ApW8mJyAbDd/HkYEM0XgE2TCymJeVkXS5f5oWGpm5kPmUzA zsdyM6iS3IZJviHM1FlE4LcueudityYVq7jhWHCIuPniPadjbgdBsOMk+kKhllJpmUtUwo UmCh4anLfKT6AzoI1xqkYB6vMaDTODA= X-MC-Unique: -qBoOQ6hNIGjAyotWTN-pA-1 X-Mimecast-MFC-AGG-ID: -qBoOQ6hNIGjAyotWTN-pA_1770120246 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Oliver Steffen , Luigi Leonardi Subject: [PULL 15/17] igvm: Pass machine state to IGVM file processing Date: Tue, 3 Feb 2026 13:03:40 +0100 Message-ID: <20260203120343.656961-16-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: -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: 1770120299138158500 Content-Type: text/plain; charset="utf-8" From: Oliver Steffen Pass the full MachineState to the IGVM backend during file processing, instead of just the ConfidentialGuestSupport struct (which is a member of the MachineState). This replaces the cgs parameter of qigvm_process_file() with the machine state to make it available in the IGVM processing context. We will use it later to generate MADT data there to pass to the guest as IGVM parameter. Reviewed-by: Luigi Leonardi Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-8-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- include/system/igvm-cfg.h | 3 ++- include/system/igvm-internal.h | 3 ++- include/system/igvm.h | 5 +++-- backends/igvm-cfg.c | 2 +- backends/igvm.c | 28 ++++++++++++++++------------ target/i386/sev.c | 3 +-- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/include/system/igvm-cfg.h b/include/system/igvm-cfg.h index 6c07f3084082..e06d611f7446 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/core/boards.h" #include "qemu/typedefs.h" #include "qom/object.h" =20 @@ -27,7 +28,7 @@ typedef struct IgvmCfgClass { * * Returns 0 for ok and -1 on error. */ - int (*process)(IgvmCfg *cfg, ConfidentialGuestSupport *cgs, + int (*process)(IgvmCfg *cfg, MachineState *machine_state, bool onlyVpContext, Error **errp); =20 } IgvmCfgClass; diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h index 019f95e86615..1d36519ab082 100644 --- a/include/system/igvm-internal.h +++ b/include/system/igvm-internal.h @@ -12,6 +12,7 @@ #include "qemu/queue.h" #include "qemu/typedefs.h" #include "qom/object.h" +#include "hw/core/boards.h" #include "hw/core/resettable.h" =20 #include "system/confidential-guest-support.h" @@ -43,7 +44,7 @@ typedef struct QIgvmParameterData { */ typedef struct QIgvm { IgvmHandle file; - ConfidentialGuestSupport *cgs; + MachineState *machine_state; ConfidentialGuestSupportClass *cgsc; uint32_t compatibility_mask; unsigned current_header_index; diff --git a/include/system/igvm.h b/include/system/igvm.h index 8355e54e95fc..5573a6111ae7 100644 --- a/include/system/igvm.h +++ b/include/system/igvm.h @@ -12,12 +12,13 @@ #ifndef BACKENDS_IGVM_H #define BACKENDS_IGVM_H =20 +#include "hw/core/boards.h" #include "qemu/typedefs.h" #include "system/confidential-guest-support.h" #include "qapi/error.h" =20 -int qigvm_process_file(IgvmCfg *igvm, ConfidentialGuestSupport *cgs, - bool onlyVpContext, Error **errp); +int qigvm_process_file(IgvmCfg *igvm, MachineState *machine_state, + bool onlyVpContext, Error **errp); =20 /* x86 native */ int qigvm_x86_get_mem_map_entry(int index, diff --git a/backends/igvm-cfg.c b/backends/igvm-cfg.c index f236b523df3b..64589ca34f24 100644 --- a/backends/igvm-cfg.c +++ b/backends/igvm-cfg.c @@ -52,7 +52,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, false, &error_fatal); } =20 static void igvm_reset_exit(Object *obj, ResetType type) diff --git a/backends/igvm.c b/backends/igvm.c index ffd1c325b661..3e7c0ea41d14 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -202,7 +202,8 @@ static void *qigvm_prepare_memory(QIgvm *ctx, uint64_t = addr, uint64_t size, g_autofree char *region_name =3D g_strdup_printf("igvm.%X", region_identifier); igvm_pages =3D g_new0(MemoryRegion, 1); - if (ctx->cgs && ctx->cgs->require_guest_memfd) { + if (ctx->machine_state->cgs && + ctx->machine_state->cgs->require_guest_memfd) { if (!memory_region_init_ram_guest_memfd(igvm_pages, NULL, region_name, size, err= p)) { return NULL; @@ -322,7 +323,7 @@ static int qigvm_process_mem_region(QIgvm *ctx, unsigne= d start_index, * If a confidential guest support object is provided then use it to s= et the * guest state. */ - if (ctx->cgs) { + if (ctx->machine_state->cgs) { cgs_page_type =3D qigvm_type_to_cgs_type(page_type, flags->unmeasured, zero); if (cgs_page_type < 0) { @@ -424,7 +425,7 @@ static int qigvm_directive_vp_context(QIgvm *ctx, const= uint8_t *header_data, =20 data =3D (uint8_t *)igvm_get_buffer(ctx->file, data_handle); =20 - if (ctx->cgs) { + if (ctx->machine_state->cgs) { result =3D ctx->cgsc->set_guest_state( vp_context->gpa, data, igvm_get_buffer_size(ctx->file, data_ha= ndle), CGS_PAGE_TYPE_VMSA, vp_context->vp_index, errp); @@ -494,7 +495,7 @@ static int qigvm_directive_parameter_insert(QIgvm *ctx, * If a confidential guest support object is provided then use it to * set the guest state. */ - if (ctx->cgs) { + if (ctx->machine_state->cgs) { result =3D ctx->cgsc->set_guest_state(param->gpa, region, param_entry->size, CGS_PAGE_TYPE_UNMEASURED, 0, @@ -535,7 +536,7 @@ static int qigvm_directive_memory_map(QIgvm *ctx, const= uint8_t *header_data, ConfidentialGuestMemoryMapEntry cgmm_entry; int retval =3D 0; =20 - if (ctx->cgs && ctx->cgsc->get_mem_map_entry) { + if (ctx->machine_state->cgs && ctx->cgsc->get_mem_map_entry) { get_mem_map_entry =3D ctx->cgsc->get_mem_map_entry; =20 } else if (target_arch() =3D=3D SYS_EMU_TARGET_X86_64) { @@ -661,7 +662,7 @@ static int qigvm_directive_required_memory(QIgvm *ctx, if (!region) { return -1; } - if (ctx->cgs) { + if (ctx->machine_state->cgs) { result =3D ctx->cgsc->set_guest_state(mem->gpa, region, mem->number_of_by= tes, CGS_PAGE_TYPE_REQUIRED_MEMORY, 0, e= rrp); @@ -779,14 +780,14 @@ static int qigvm_supported_platform_compat_mask(QIgvm= *ctx, Error **errp) sizeof( IGVM_VHS_VARIABLE_HEAD= ER)); if ((platform->platform_type =3D=3D IGVM_PLATFORM_TYPE_SEV_ES)= && - ctx->cgs) { + ctx->machine_state->cgs) { if (ctx->cgsc->check_support( CGS_PLATFORM_SEV_ES, platform->platform_version, platform->highest_vtl, platform->shared_gpa_bounda= ry)) { compatibility_mask_sev_es =3D platform->compatibility_= mask; } } else if ((platform->platform_type =3D=3D IGVM_PLATFORM_TYPE_= SEV) && - ctx->cgs) { + ctx->machine_state->cgs) { if (ctx->cgsc->check_support( CGS_PLATFORM_SEV, platform->platform_version, platform->highest_vtl, platform->shared_gpa_bounda= ry)) { @@ -794,7 +795,7 @@ static int qigvm_supported_platform_compat_mask(QIgvm *= ctx, Error **errp) } } else if ((platform->platform_type =3D=3D IGVM_PLATFORM_TYPE_SEV_SNP) && - ctx->cgs) { + ctx->machine_state->cgs) { if (ctx->cgsc->check_support( CGS_PLATFORM_SEV_SNP, platform->platform_version, platform->highest_vtl, platform->shared_gpa_bounda= ry)) { @@ -867,7 +868,7 @@ IgvmHandle qigvm_file_init(char *filename, Error **errp) return igvm; } =20 -int qigvm_process_file(IgvmCfg *cfg, ConfidentialGuestSupport *cgs, +int qigvm_process_file(IgvmCfg *cfg, MachineState *machine_state, bool onlyVpContext, Error **errp) { int32_t header_count; @@ -883,13 +884,16 @@ int qigvm_process_file(IgvmCfg *cfg, ConfidentialGues= tSupport *cgs, ctx.file =3D cfg->file; trace_igvm_process_file(cfg->file, onlyVpContext); =20 + ctx.machine_state =3D machine_state; + /* * The ConfidentialGuestSupport object is optional and allows a confid= ential * guest platform to perform extra processing, such as page measuremen= t, on * IGVM directives. */ - ctx.cgs =3D cgs; - ctx.cgsc =3D cgs ? CONFIDENTIAL_GUEST_SUPPORT_GET_CLASS(cgs) : NULL; + ctx.cgsc =3D machine_state->cgs ? + CONFIDENTIAL_GUEST_SUPPORT_GET_CLASS(machine_state->cgs= ) : + NULL; =20 /* * Check that the IGVM file provides configuration for the current diff --git a/target/i386/sev.c b/target/i386/sev.c index fef9f441c61e..acdcb9c4e681 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -1892,8 +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 - -1) { + ->process(x86machine->igvm, machine, true, errp) =3D= =3D -1) { return -1; } /* --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120271; cv=none; d=zohomail.com; s=zohoarc; b=oG4wb9Rvfn8Vywco5thH8yVEc/xqpr18QOv5geuaaf1g5gIX+8zmUd7geFu5JGZu+ESqvWCox1jgjVXczk9JA7tOl1n1xDhzQRyBTkN3IMycgN4Pl7BGt9M8JhnG3ngZTpj67H9HuC59hOoYW/VP70/YNOTTFN3MQ8qbXzCYwEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120271; 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=VLk1QYTAuX6H/ydX2gIg04GXxUxZ6ls8XqFNJjVMQmQ=; b=OmnuCPA5YSYIry3+e1LIjAVW7pZxId+E5DUiZWigp+K23jeqF07HsjS6VIsbMjc3zEIvaKDoQwHEDBHkandvpOBsD0byX7XQo20WQ6NLHP71Ju3pqApN0Uy/OOfBmP9/nII5qjIzfvDpSbTbReXsEb/XI4oVKC4JrdBVlX0+xd8= 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 1770120271257872.739051122991; Tue, 3 Feb 2026 04:04:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF8o-0008Ai-MN; Tue, 03 Feb 2026 07:04: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 1vnF8h-0007uz-Oj for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:16 -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 1vnF8e-0007gn-V4 for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:14 -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-302-PiLt5Af7NJi8D9_8GjPnfg-1; Tue, 03 Feb 2026 07:04:09 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C42B318002C4; Tue, 3 Feb 2026 12:04:07 +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 7F5AA18002A6; Tue, 3 Feb 2026 12:04:07 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AB4AF182626C; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120252; 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=VLk1QYTAuX6H/ydX2gIg04GXxUxZ6ls8XqFNJjVMQmQ=; b=WVu2UezxM4At98iS6pXCSJV+ygqJj2jWdXyPjJhEtrPCdHv5bL7Y3+6k1BNafMb9sWjbsl ldQu0ZO7oNHVhK+Nwd/IO4/w1WL6pxvxL/D4D0/YUAtn6X/ZzhpkQALkeOOhuMZYY0WkaN 2JoQyrTsI+03uF6izsY6lw/JAY4J1bM= X-MC-Unique: PiLt5Af7NJi8D9_8GjPnfg-1 X-Mimecast-MFC-AGG-ID: PiLt5Af7NJi8D9_8GjPnfg_1770120247 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Oliver Steffen Subject: [PULL 16/17] igvm: Only build stubs if igvm is enabled Date: Tue, 3 Feb 2026 13:03:41 +0100 Message-ID: <20260203120343.656961-17-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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: 1770120273022154100 Content-Type: text/plain; charset="utf-8" From: Oliver Steffen Change meson script to only include the IGVM stubs file if the IGVM feature is enabled. It is used to handle architecture specific differences within the IGVM backend, not to provide stubs of the backend itself. Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-9-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- stubs/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stubs/meson.build b/stubs/meson.build index 2b5fd8a88af5..8a07059500db 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -71,7 +71,9 @@ if have_system stub_ss.add(files('dump.c')) stub_ss.add(files('cmos.c')) stub_ss.add(files('fw_cfg.c')) - stub_ss.add(files('igvm.c')) + if igvm.found() + stub_ss.add(files('igvm.c')) + endif stub_ss.add(files('target-get-monitor-def.c')) stub_ss.add(files('target-monitor-defs.c')) stub_ss.add(files('win32-kbd-hook.c')) --=20 2.52.0 From nobody Sat Feb 7 05:53:59 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=1770120330; cv=none; d=zohomail.com; s=zohoarc; b=JcaJXzeAGF9SXgeB+QpN/RtO2b1W3tyehXmx10NsrkFvhKrWmM1p9mNLmhHxn21AzrQwK7EnVG2k+/VVuTuQaCtGYckZip4jYFi9noCMbm2p/M9CbjjWjRwhcwQ687+fDe9MLQDOMLPaFGQN0MHzP+aedxxwIvWrWhj/yfGuGdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770120330; 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=CnOXJUc/BoLbPslPw3aPQeYYdMXvaRXwx5lRglNofE0=; b=ZRf50KBJFDbDxf2xWg1ZZzD+NXgjrG4spPRBdmnbUMBl55GtqiChSE2dWGUPMlfjONUt6DSGJm4rY5j4O+HyvLcz+jdq44Di3b2Ka5Awc8CNOmhmC3YnJ4OkeANABJqzgkL2Zh25WQFS2q1gkuXpYzcGZgIAzutjL95OnTyz660= 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 1770120330488104.91539475688978; Tue, 3 Feb 2026 04:05:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vnF98-0000g0-OM; Tue, 03 Feb 2026 07:04:42 -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 1vnF8j-0007x1-I0 for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:17 -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 1vnF8g-0007h3-St for qemu-devel@nongnu.org; Tue, 03 Feb 2026 07:04:17 -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-468-USztDpaWNaq_aozul2U5dQ-1; Tue, 03 Feb 2026 07:04:10 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EECEA180047F; Tue, 3 Feb 2026 12:04:08 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.34.28]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3D91030001A7; Tue, 3 Feb 2026 12:04:08 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C324A182626E; Tue, 03 Feb 2026 13:03:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770120253; 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=CnOXJUc/BoLbPslPw3aPQeYYdMXvaRXwx5lRglNofE0=; b=hezH9QTW5un5GRf92obsnOYX0JWIVT94H1uAF56IVrdgzFOr+YQLAQQhorOvkLSXLMRD37 LbEMJ69nDMgysZpIbYp/l8lxSZ/XbwFuAdvuA32FdLrMZ3U9fcI8hWZL4oIFH1zRUMynFT hppjoWVlD6/4UIuY0+pdRzlq7zv0pUM= X-MC-Unique: USztDpaWNaq_aozul2U5dQ-1 X-Mimecast-MFC-AGG-ID: USztDpaWNaq_aozul2U5dQ_1770120249 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Ani Sinha , Pierrick Bouvier , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcelo Tosatti , "Michael S. Tsirkin" , Richard Henderson , kvm@vger.kernel.org, Gerd Hoffmann , Oliver Steffen Subject: [PULL 17/17] igvm: Fill MADT IGVM parameter field on x86_64 Date: Tue, 3 Feb 2026 13:03:42 +0100 Message-ID: <20260203120343.656961-18-kraxel@redhat.com> In-Reply-To: <20260203120343.656961-1-kraxel@redhat.com> References: <20260203120343.656961-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_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: 1770120331246158500 Content-Type: text/plain; charset="utf-8" From: Oliver Steffen Use the new acpi_build_madt_standalone() function to fill the MADT parameter field. The IGVM parameter can be consumed by Coconut SVSM [1], instead of relying on the fw_cfg interface, which has caused problems before due to unexpected access [2,3]. Using IGVM parameters is the default way for Coconut SVSM across hypervisors; switching over would allow removing specialized code paths for QEMU in Coconut. Coconut SVSM needs to know the SMP configuration, but does not look at any other ACPI data, nor does it interact with the PCI bus settings. Since the MADT is static and not linked with other ACPI tables, it can be supplied stand-alone like this. Generating the MADT twice (during ACPI table building and IGVM processing) seems acceptable, since there is no infrastructure to obtain the MADT out of the ACPI table memory area. In any case OVMF, which runs after SVSM has already been initialized, will continue reading all ACPI tables via fw_cfg and provide fixed up ACPI data to the OS as before without any changes. The IGVM parameter handler is implemented for the i386 machine target and stubbed for all others. [1] https://github.com/coconut-svsm/svsm/pull/858 [2] https://gitlab.com/qemu-project/qemu/-/issues/2882 [3] https://github.com/coconut-svsm/svsm/issues/646 Signed-off-by: Oliver Steffen Message-ID: <20260130054714.715928-10-osteffen@redhat.com> Signed-off-by: Gerd Hoffmann --- include/system/igvm-internal.h | 5 +++++ backends/igvm.c | 2 ++ stubs/igvm.c | 6 ++++++ target/i386/igvm.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h index 1d36519ab082..38004bd908e7 100644 --- a/include/system/igvm-internal.h +++ b/include/system/igvm-internal.h @@ -74,4 +74,9 @@ IgvmHandle qigvm_file_init(char *filename, Error **errp); QIgvmParameterData* qigvm_find_param_entry(QIgvm *igvm, uint32_t parameter_area_index); =20 +/* + * IGVM parameter handlers + */ +int qigvm_directive_madt(QIgvm *ctx, const uint8_t *header_data, Error **e= rrp); + #endif diff --git a/backends/igvm.c b/backends/igvm.c index 3e7c0ea41d14..b01a19ba46a1 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -128,6 +128,8 @@ static struct QIGVMHandler handlers[] =3D { qigvm_directive_snp_id_block }, { IGVM_VHT_GUEST_POLICY, IGVM_HEADER_SECTION_INITIALIZATION, qigvm_initialization_guest_policy }, + { IGVM_VHT_MADT, IGVM_HEADER_SECTION_DIRECTIVE, + qigvm_directive_madt }, }; =20 static int qigvm_handler(QIgvm *ctx, uint32_t type, Error **errp) diff --git a/stubs/igvm.c b/stubs/igvm.c index 17cd1e903e35..47d5130d9d74 100644 --- a/stubs/igvm.c +++ b/stubs/igvm.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" =20 #include "system/igvm.h" +#include "system/igvm-internal.h" =20 int qigvm_x86_get_mem_map_entry(int index, ConfidentialGuestMemoryMapEntry *entry, @@ -24,3 +25,8 @@ int qigvm_x86_set_vp_context(void *data, int index, Error= **errp) { return -1; } + +int qigvm_directive_madt(QIgvm *ctx, const uint8_t *header_data, Error **e= rrp) +{ + return -1; +} diff --git a/target/i386/igvm.c b/target/i386/igvm.c index 457c253b030c..f41b498b8924 100644 --- a/target/i386/igvm.c +++ b/target/i386/igvm.c @@ -13,7 +13,9 @@ =20 #include "cpu.h" #include "hw/i386/e820_memory_layout.h" +#include "hw/i386/acpi-build.h" #include "system/igvm.h" +#include "system/igvm-internal.h" =20 struct IgvmNativeVpContextX64 { uint64_t rax; @@ -178,3 +180,33 @@ void qigvm_x86_bsp_reset(CPUX86State *env) =20 qigvm_x86_load_context(bsp_context, env); } + +/* + * Process MADT IGVM parameter + */ +int qigvm_directive_madt(QIgvm *ctx, const uint8_t *header_data, Error **e= rrp) +{ + const IGVM_VHS_PARAMETER *param =3D (const IGVM_VHS_PARAMETER *)header= _data; + QIgvmParameterData *param_entry; + int result =3D 0; + + /* Find the parameter area that should hold the MADT data */ + param_entry =3D qigvm_find_param_entry(ctx, param->parameter_area_inde= x); + if (param_entry =3D=3D NULL) { + return 0; + } + + GArray *madt =3D acpi_build_madt_standalone(ctx->machine_state); + + if (madt->len <=3D param_entry->size) { + memcpy(param_entry->data, madt->data, madt->len); + } else { + error_setg( + errp, + "IGVM: MADT size exceeds parameter area defined in IGVM file"); + result =3D -1; + } + + g_array_free(madt, true); + return result; +} --=20 2.52.0