From nobody Sun Dec 14 05:56:41 2025 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=1762159394; cv=none; d=zohomail.com; s=zohoarc; b=a75RDf9O6zk/XSQ5pSMGWHs1b/2RFET7LQGQpAQ68Ik0ClgDQeIBJfExg3wZRxUX9iizOHQSbkTT5/kxVssUqT1m6WF5JPJwAXlIW25g8cSYjKfKWvw9k2J+C7Gk2RMXjDQZWsir7268fZjMFHR+7oriu5AVrCaTV0glUb0ic8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762159394; 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=ZUUj32D6oHJKOccpTTerhOc8zicP0RzdsJEYLIl05DE=; b=DyNN0b5oxSWZMItJ1hLvjTTOQvrjsyvF9XhsSjjh5SNSeEdInfryYG96RAxztVPQaNVQ7agX8Avtk/KWczKFUEJliWwlppcUSLs3DLhn65/q3OUxqupPa3ww8gUuInKHMuyIDEjj1Ykheb33PR7vs4332gYWlfXi3Vdn9uHQJlc= 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 1762159394770974.4126500363185; Mon, 3 Nov 2025 00:43:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vFq8u-0007sA-J0; Mon, 03 Nov 2025 03:42:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vFq8s-0007qw-5f for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:22 -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 1vFq8m-0000GH-Qc for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:19 -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-524-risOyHrWO0y7Wnf513jJcw-1; Mon, 03 Nov 2025 03:42:05 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9696A1955F45; Mon, 3 Nov 2025 08:42:04 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.33.5]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C93201956056; Mon, 3 Nov 2025 08:42:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 810B71800606; Mon, 03 Nov 2025 09:42:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762159329; 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=ZUUj32D6oHJKOccpTTerhOc8zicP0RzdsJEYLIl05DE=; b=HccOe4JOJHT/yZVzqf9V4lk9/A6KWm7bwmdW4petCyh94t1MvHRHZT/2aE9jI35g62hajq CswbnML+qneT9RR28qld4NqvkJawJUWzxNsZdNBfeZCEz1+EVLa6Keu6GUz7P+ly5AZ7we nNMaPzGTQTceMwh7p3i/mD3Tq10ThhM= X-MC-Unique: risOyHrWO0y7Wnf513jJcw-1 X-Mimecast-MFC-AGG-ID: risOyHrWO0y7Wnf513jJcw_1762159324 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , Stefano Garzarella , Zhao Liu , Ani Sinha , Luigi Leonardi Subject: [PULL 1/5] igvm: move igvm.h file to include/system Date: Mon, 3 Nov 2025 09:41:56 +0100 Message-ID: <20251103084201.45417-2-kraxel@redhat.com> In-Reply-To: <20251103084201.45417-1-kraxel@redhat.com> References: <20251103084201.45417-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.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1762159396991154100 Content-Type: text/plain; charset="utf-8" Prepare for arch-specific igvm code being added to the code base. Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi Signed-off-by: Gerd Hoffmann Message-ID: <20251029105555.2492276-2-kraxel@redhat.com> --- {backends =3D> include/system}/igvm.h | 0 backends/igvm-cfg.c | 2 +- backends/igvm.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename {backends =3D> include/system}/igvm.h (100%) diff --git a/backends/igvm.h b/include/system/igvm.h similarity index 100% rename from backends/igvm.h rename to include/system/igvm.h diff --git a/backends/igvm-cfg.c b/backends/igvm-cfg.c index 45df63e06c1a..d00acf351249 100644 --- a/backends/igvm-cfg.c +++ b/backends/igvm-cfg.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" =20 #include "system/igvm-cfg.h" -#include "igvm.h" +#include "system/igvm.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 9ad41582ee5e..723d45b755a0 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -11,8 +11,8 @@ =20 #include "qemu/osdep.h" =20 -#include "igvm.h" #include "qapi/error.h" +#include "system/igvm.h" #include "system/memory.h" #include "system/address-spaces.h" #include "hw/core/cpu.h" --=20 2.51.1 From nobody Sun Dec 14 05:56:41 2025 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=1762159413; cv=none; d=zohomail.com; s=zohoarc; b=G4ZFZp122Yt0Vv579kPM44hk5/AZQj3dhSLBuOaI7JRyN6msllhAMY0Vs2qd6IakHTZtzPydKbuTOf7JupsAyUKwDc7GXNoCZWEo4exn/xKrKd0rgnCrGZ+UkqZLOmQSjoDSMr/WeXTFR7DEWpj2+WEne2NDiGvnB7vqpxpAsIY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762159413; 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=8bfAYTMyMm6et2tVquZZ6hQBsRImONAm++z/iMjwfy0=; b=Yp9Sw7bMfTZJ5wXOQkowsC/TdfIr1vmDB/aQ4spjhp1R2usVYBOG4wGqwu9CsALcpwvmI5GJlMa822I1H0jmWKy/XaplJyfvPG4Ray+9fuLW4SM9hsVR0L3UAJ+UWq5F+SCcMIY+NBEPT7msQ5gPfw26GYcyS9BgTR35etQexuI= 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 1762159413837399.60213347202375; Mon, 3 Nov 2025 00:43:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vFq8x-0007uF-9P; Mon, 03 Nov 2025 03:42:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vFq8v-0007tX-DU for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:25 -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 1vFq8n-0000GR-Ai for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:25 -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-677-seS1Gzx9NC2AhI3ICKjl2w-1; Mon, 03 Nov 2025 03:42:08 -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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EA0A6195420D; Mon, 3 Nov 2025 08:42:07 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.33.5]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2FD7F30001B9; Mon, 3 Nov 2025 08:42:07 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 921DC1800608; Mon, 03 Nov 2025 09:42:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762159330; 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=8bfAYTMyMm6et2tVquZZ6hQBsRImONAm++z/iMjwfy0=; b=h1Qfgq0tJnAhuF7UKQjyanh/eT6iPHmNoYnjsDD33a0C+mA9lqWheBrZW9GZtMf/gSE/LH bEaENIc3c3M8jViSoIlXptIDsxdnneemksgHuVieXp6fn70ZsXf4V1fQFP1qjzo5vrRjwi rMXj6y8sm6sq+XZOP3CkFq+lG5WeGYo= X-MC-Unique: seS1Gzx9NC2AhI3ICKjl2w-1 X-Mimecast-MFC-AGG-ID: seS1Gzx9NC2AhI3ICKjl2w_1762159328 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , Stefano Garzarella , Zhao Liu , Ani Sinha , Luigi Leonardi Subject: [PULL 2/5] igvm: fix off by one bug in memmap entry count checking Date: Mon, 3 Nov 2025 09:41:57 +0100 Message-ID: <20251103084201.45417-3-kraxel@redhat.com> In-Reply-To: <20251103084201.45417-1-kraxel@redhat.com> References: <20251103084201.45417-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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1762159414882154100 Content-Type: text/plain; charset="utf-8" Fixes: c1d466d267 ("backends/igvm: Add IGVM loader and configuration") Reviewed-by: Luigi Leonardi Reviewed-by: Stefano Garzarella Signed-off-by: Gerd Hoffmann Message-ID: <20251029105555.2492276-3-kraxel@redhat.com> --- backends/igvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/igvm.c b/backends/igvm.c index 723d45b755a0..055bbba745ad 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -567,7 +567,7 @@ static int qigvm_directive_memory_map(QIgvm *ctx, const= uint8_t *header_data, =20 retval =3D ctx->cgsc->get_mem_map_entry(entry, &cgmm_entry, er= rp); while (retval =3D=3D 0) { - if (entry > max_entry_count) { + if (entry >=3D max_entry_count) { error_setg( errp, "IGVM: guest memory map size exceeds parameter are= a defined in IGVM file"); --=20 2.51.1 From nobody Sun Dec 14 05:56:41 2025 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=1762159398; cv=none; d=zohomail.com; s=zohoarc; b=CHdRCpiQ+ppkOycI4Ec5Ty9sJskYWFF0Qv5/DkwdG7ZmS8ovz+oNFRmMA45hbuljGA1syFYmP5r25XbFNO1ZqQ+ZaAtOzd9lva8AukRAIR2ndXazo4yLszj9TXJxnlDKfPwdsRhfX1cKzK0Lw0tZGSkc24d6MAIdCiDBM8oNq7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762159398; 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=57Yk3EE+wKpzUPI9eVI1hCayXsBZXu/WC3k4uVAR9Pw=; b=EkQFmBKumMSlpDfxsfuDIH22gNCx3o+rXj+QgFI8U3hmn8DWzHD82oxhoGXfx71kW49pTlgKcwASSpwfB4M9qsFpt1rBt0gzDkA5nNzcYBByS2Bu79mJrqPVHCBfJaVJvxMfaQn/HLP6T05E1rfaLVZVONtol9PTUDWqrMc0FgU= 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 1762159398898329.09183741423146; Mon, 3 Nov 2025 00:43:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vFq8w-0007u4-90; Mon, 03 Nov 2025 03:42:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vFq8t-0007rg-F6 for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:23 -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 1vFq8n-0000GP-FG for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:23 -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-681-LWlNSGX-M8uR08hqaHzwPA-1; Mon, 03 Nov 2025 03:42:08 -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 275C21800D87; Mon, 3 Nov 2025 08:42:08 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.33.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0B3551800452; Mon, 3 Nov 2025 08:42:07 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AF49A1800609; Mon, 03 Nov 2025 09:42:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762159330; 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=57Yk3EE+wKpzUPI9eVI1hCayXsBZXu/WC3k4uVAR9Pw=; b=SLOmMd6vE/LT/uhD2oK9oAC2F8GP286iXonrqtl2GqLBIWl32ycJFq1e4+NIF0l9bR3oOf v5L/pAmFiS233A8uk1mfLxZh36I0zkbKSgQ+NlLvDhOwL3jUSziTR+MykpCfZVaQ13sNAm Fn7rmIQs1hI2cyve89IGEmYrCcRyg9Q= X-MC-Unique: LWlNSGX-M8uR08hqaHzwPA-1 X-Mimecast-MFC-AGG-ID: LWlNSGX-M8uR08hqaHzwPA_1762159328 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , Stefano Garzarella , Zhao Liu , Ani Sinha , Luigi Leonardi Subject: [PULL 3/5] igvm: add support for igvm memory map parameter in native mode Date: Mon, 3 Nov 2025 09:41:58 +0100 Message-ID: <20251103084201.45417-4-kraxel@redhat.com> In-Reply-To: <20251103084201.45417-1-kraxel@redhat.com> References: <20251103084201.45417-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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1762159403994158500 Content-Type: text/plain; charset="utf-8" Add and wire up qigvm_x86_get_mem_map_entry function which converts the e820 table into an igvm memory map parameter. This makes igvm files for the native (non-confidential) platform with memory map parameter work. Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi Signed-off-by: Gerd Hoffmann Message-ID: <20251029105555.2492276-4-kraxel@redhat.com> --- include/system/igvm.h | 5 +++++ backends/igvm.c | 16 ++++++++++---- stubs/igvm.c | 21 +++++++++++++++++++ target/i386/igvm.c | 46 +++++++++++++++++++++++++++++++++++++++++ stubs/meson.build | 1 + target/i386/meson.build | 3 +++ 6 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 stubs/igvm.c create mode 100644 target/i386/igvm.c diff --git a/include/system/igvm.h b/include/system/igvm.h index a4abab043a1f..3f72a40b8897 100644 --- a/include/system/igvm.h +++ b/include/system/igvm.h @@ -19,4 +19,9 @@ int qigvm_process_file(IgvmCfg *igvm, ConfidentialGuestSupport *cgs, bool onlyVpContext, Error **errp); =20 +/* x86 native */ +int qigvm_x86_get_mem_map_entry(int index, + ConfidentialGuestMemoryMapEntry *entry, + Error **errp); + #endif diff --git a/backends/igvm.c b/backends/igvm.c index 055bbba745ad..2ab7a9d96565 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" =20 #include "qapi/error.h" +#include "qemu/target-info-qapi.h" #include "system/igvm.h" #include "system/memory.h" #include "system/address-spaces.h" @@ -543,6 +544,8 @@ static int qigvm_directive_memory_map(QIgvm *ctx, const= uint8_t *header_data, Error **errp) { const IGVM_VHS_PARAMETER *param =3D (const IGVM_VHS_PARAMETER *)header= _data; + int (*get_mem_map_entry)(int index, ConfidentialGuestMemoryMapEntry *e= ntry, + Error **errp) =3D NULL; QIgvmParameterData *param_entry; int max_entry_count; int entry =3D 0; @@ -550,7 +553,13 @@ static int qigvm_directive_memory_map(QIgvm *ctx, cons= t uint8_t *header_data, ConfidentialGuestMemoryMapEntry cgmm_entry; int retval =3D 0; =20 - if (!ctx->cgs) { + if (ctx->cgs && ctx->cgsc->get_mem_map_entry) { + get_mem_map_entry =3D ctx->cgsc->get_mem_map_entry; + + } else if (target_arch() =3D=3D SYS_EMU_TARGET_X86_64) { + get_mem_map_entry =3D qigvm_x86_get_mem_map_entry; + + } else { error_setg(errp, "IGVM file contains a memory map but this is not suppor= ted " "by the current system."); @@ -565,7 +574,7 @@ static int qigvm_directive_memory_map(QIgvm *ctx, const= uint8_t *header_data, param_entry->size / sizeof(IGVM_VHS_MEMORY_MAP_ENTRY); mm_entry =3D (IGVM_VHS_MEMORY_MAP_ENTRY *)param_entry->data; =20 - retval =3D ctx->cgsc->get_mem_map_entry(entry, &cgmm_entry, er= rp); + retval =3D get_mem_map_entry(entry, &cgmm_entry, errp); while (retval =3D=3D 0) { if (entry >=3D max_entry_count) { error_setg( @@ -598,8 +607,7 @@ static int qigvm_directive_memory_map(QIgvm *ctx, const= uint8_t *header_data, IGVM_MEMORY_MAP_ENTRY_TYPE_PLATFORM_RESERVED; break; } - retval =3D - ctx->cgsc->get_mem_map_entry(++entry, &cgmm_entry, err= p); + retval =3D get_mem_map_entry(++entry, &cgmm_entry, errp); } if (retval < 0) { return retval; diff --git a/stubs/igvm.c b/stubs/igvm.c new file mode 100644 index 000000000000..c32058eb2a6e --- /dev/null +++ b/stubs/igvm.c @@ -0,0 +1,21 @@ +/* + * QEMU IGVM, stubs + * + * Copyright (C) 2026 Red Hat + * + * Authors: + * Gerd Hoffmann + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" + +#include "system/igvm.h" + +int qigvm_x86_get_mem_map_entry(int index, + ConfidentialGuestMemoryMapEntry *entry, + Error **errp) +{ + return -1; +} diff --git a/target/i386/igvm.c b/target/i386/igvm.c new file mode 100644 index 000000000000..2ed6cd052c79 --- /dev/null +++ b/target/i386/igvm.c @@ -0,0 +1,46 @@ +/* + * QEMU IGVM, support for native x86 guests + * + * Copyright (C) 2026 Red Hat + * + * Authors: + * Gerd Hoffmann + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" + +#include "hw/i386/e820_memory_layout.h" +#include "system/igvm.h" + +/* + * convert e820 table into igvm memory map + */ +int qigvm_x86_get_mem_map_entry(int index, + ConfidentialGuestMemoryMapEntry *entry, + Error **errp) +{ + struct e820_entry *table; + int num_entries; + + num_entries =3D e820_get_table(&table); + if ((index < 0) || (index >=3D num_entries)) { + return 1; + } + entry->gpa =3D table[index].address; + entry->size =3D table[index].length; + switch (table[index].type) { + case E820_RAM: + entry->type =3D CGS_MEM_RAM; + break; + case E820_RESERVED: + entry->type =3D CGS_MEM_RESERVED; + break; + default: + /* should not happen */ + error_setg(errp, "unknown e820 type"); + return -1; + } + return 0; +} diff --git a/stubs/meson.build b/stubs/meson.build index 5d577467bfdd..27be2dec9f9e 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -74,6 +74,7 @@ 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')) 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')) diff --git a/target/i386/meson.build b/target/i386/meson.build index 89ba4912aaeb..d385eafdf7e1 100644 --- a/target/i386/meson.build +++ b/target/i386/meson.build @@ -26,6 +26,9 @@ i386_system_ss.add(files( )) i386_system_ss.add(when: 'CONFIG_SEV', if_true: files('sev.c'), if_false: files('sev-system-stub.c'= )) +if igvm.found() + i386_system_ss.add(files('igvm.c')) +endif =20 i386_user_ss =3D ss.source_set() =20 --=20 2.51.1 From nobody Sun Dec 14 05:56:41 2025 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=1762159412; cv=none; d=zohomail.com; s=zohoarc; b=IBnOAPzJ9gqhnVNBM5+VP1A2vd2IMcluEYiAHe+zTuEIbN5ERuT/ubzgHjfio6+StqasU7rKzZNZG2XuW9Fo5xyvPqYZ0r6KQXO7ZIqPl2BSVlrbJyGMG6ZwHncXNbpvQhXoUbyExh4/fFJLmKejtmuNxFohxq1m+8s+TQuMfBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762159412; 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=Tu9ChOtvLHJzQ/alZvoTTIpst2IP8Poyt00yE04VagY=; b=Z+/CuYidvq/Uvk5HISQ967wDsxI36lobKBQKpx1DahHEJCiq5hh8JPMkGdd045H14N1fmDQQWtkk85JzCsXf0wlC30ECuFJ0/8LUzr+2M1/Nem1N25634xjeC5Lvex1RZ0b1TPw4J3otJlxVrqEH3APPys8g86r0BKjgOInGjVI= 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 1762159412204778.7790060995588; Mon, 3 Nov 2025 00:43:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vFq8v-0007sE-3O; Mon, 03 Nov 2025 03:42:25 -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 1vFq8s-0007ra-62 for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:22 -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 1vFq8o-0000H8-VF for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:21 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-679-k47vLeavMDe3jtzCzym92g-1; Mon, 03 Nov 2025 03:42:12 -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 77F951800D81; Mon, 3 Nov 2025 08:42:11 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.33.5]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A05EC30001A8; Mon, 3 Nov 2025 08:42:10 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CBB10180060A; Mon, 03 Nov 2025 09:42:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762159335; 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=Tu9ChOtvLHJzQ/alZvoTTIpst2IP8Poyt00yE04VagY=; b=Xc41tE0tk9XD9T0eb8YBSbd/CoXhPlaNpr5uTvrjnS5KKKdHWCv1QAifcgzjNHFKcHvCS2 F9DfxHhug4PbZwrTzt50lo5knFn8FzJxUpAnkGO/iyCVAn5n3Wfa3GzHYHtmUJqttbLsr4 YcPWK2PweLgSQ4llbzDUF4ypf8snPy0= X-MC-Unique: k47vLeavMDe3jtzCzym92g-1 X-Mimecast-MFC-AGG-ID: k47vLeavMDe3jtzCzym92g_1762159331 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , Stefano Garzarella , Zhao Liu , Ani Sinha , Luigi Leonardi Subject: [PULL 4/5] igvm: add support for initial register state load in native mode Date: Mon, 3 Nov 2025 09:41:59 +0100 Message-ID: <20251103084201.45417-5-kraxel@redhat.com> In-Reply-To: <20251103084201.45417-1-kraxel@redhat.com> References: <20251103084201.45417-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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1762159415654158500 Content-Type: text/plain; charset="utf-8" Add IgvmNativeVpContextX64 struct holding the register state (see igvm spec), and the qigvm_x86_load_context() function to load the register state. Wire up using two new functions: qigvm_x86_set_vp_context() is called from igvm file handling code and stores the boot processor context. qigvm_x86_bsp_reset() is called from i386 target cpu reset code and loads the context into the cpu registers. Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi Signed-off-by: Gerd Hoffmann Message-ID: <20251029105555.2492276-5-kraxel@redhat.com> --- include/system/igvm.h | 2 + target/i386/cpu.h | 3 + backends/igvm.c | 30 +++++----- stubs/igvm.c | 5 ++ target/i386/cpu.c | 6 ++ target/i386/igvm.c | 134 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 165 insertions(+), 15 deletions(-) diff --git a/include/system/igvm.h b/include/system/igvm.h index 3f72a40b8897..48ce20604259 100644 --- a/include/system/igvm.h +++ b/include/system/igvm.h @@ -23,5 +23,7 @@ int qigvm_process_file(IgvmCfg *igvm, ConfidentialGuestSu= pport *cgs, int qigvm_x86_get_mem_map_entry(int index, ConfidentialGuestMemoryMapEntry *entry, Error **errp); +int qigvm_x86_set_vp_context(void *data, int index, + Error **errp); =20 #endif diff --git a/target/i386/cpu.h b/target/i386/cpu.h index d0da9bfe58ce..cee1f692a1c3 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2868,6 +2868,9 @@ void x86_cpu_dump_local_apic_state(CPUState *cs, int = flags); =20 #endif =20 +/* igvm.c */ +void qigvm_x86_bsp_reset(CPUX86State *env); + /* cpu.c */ bool cpu_is_bsp(X86CPU *cpu); =20 diff --git a/backends/igvm.c b/backends/igvm.c index 2ab7a9d96565..905bd8d98994 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -432,18 +432,6 @@ static int qigvm_directive_vp_context(QIgvm *ctx, cons= t uint8_t *header_data, return 0; } =20 - /* - * A confidential guest support object must be provided for setting - * a VP context. - */ - if (!ctx->cgs) { - error_setg( - errp, - "A VP context is present in the IGVM file but is not supported= " - "by the current system."); - return -1; - } - data_handle =3D igvm_get_header_data(ctx->file, IGVM_HEADER_SECTION_DI= RECTIVE, ctx->current_header_index); if (data_handle < 0) { @@ -453,9 +441,21 @@ static int qigvm_directive_vp_context(QIgvm *ctx, cons= t uint8_t *header_data, } =20 data =3D (uint8_t *)igvm_get_buffer(ctx->file, data_handle); - result =3D ctx->cgsc->set_guest_state( - vp_context->gpa, data, igvm_get_buffer_size(ctx->file, data_handle= ), - CGS_PAGE_TYPE_VMSA, vp_context->vp_index, errp); + + if (ctx->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); + } else if (target_arch() =3D=3D SYS_EMU_TARGET_X86_64) { + result =3D qigvm_x86_set_vp_context(data, vp_context->vp_index, er= rp); + } else { + error_setg( + errp, + "A VP context is present in the IGVM file but is not supported= " + "by the current system."); + result =3D -1; + } + igvm_free_buffer(ctx->file, data_handle); if (result < 0) { return result; diff --git a/stubs/igvm.c b/stubs/igvm.c index c32058eb2a6e..17cd1e903e35 100644 --- a/stubs/igvm.c +++ b/stubs/igvm.c @@ -19,3 +19,8 @@ int qigvm_x86_get_mem_map_entry(int index, { return -1; } + +int qigvm_x86_set_vp_context(void *data, int index, Error **errp) +{ + return -1; +} diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 0a66e1fec939..641777578637 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -8770,6 +8770,12 @@ static void x86_cpu_reset_hold(Object *obj, ResetTyp= e type) =20 cs->halted =3D !cpu_is_bsp(cpu); =20 +#if defined(CONFIG_IGVM) + if (cpu_is_bsp(cpu)) { + qigvm_x86_bsp_reset(env); + } +#endif + if (kvm_enabled()) { kvm_arch_reset_vcpu(cpu); } diff --git a/target/i386/igvm.c b/target/i386/igvm.c index 2ed6cd052c79..457c253b030c 100644 --- a/target/i386/igvm.c +++ b/target/i386/igvm.c @@ -11,9 +11,115 @@ =20 #include "qemu/osdep.h" =20 +#include "cpu.h" #include "hw/i386/e820_memory_layout.h" #include "system/igvm.h" =20 +struct IgvmNativeVpContextX64 { + uint64_t rax; + uint64_t rcx; + uint64_t rdx; + uint64_t rbx; + uint64_t rsp; + uint64_t rbp; + uint64_t rsi; + uint64_t rdi; + uint64_t r8; + uint64_t r9; + uint64_t r10; + uint64_t r11; + uint64_t r12; + uint64_t r13; + uint64_t r14; + uint64_t r15; + uint64_t rip; + uint64_t rflags; + uint64_t idtr_base; + uint16_t idtr_limit; + uint16_t reserved[2]; + uint16_t gdtr_limit; + uint64_t gdtr_base; + + uint16_t code_selector; + uint16_t code_attributes; + uint32_t code_base; + uint32_t code_limit; + + uint16_t data_selector; + uint16_t data_attributes; + uint32_t data_base; + uint32_t data_limit; + + uint64_t gs_base; + uint64_t cr0; + uint64_t cr3; + uint64_t cr4; + uint64_t efer; +}; + +#define FLAGS_TO_SEGCACHE(flags) \ + (((unsigned int)flags) << 8) + +static void qigvm_x86_load_context(struct IgvmNativeVpContextX64 *context, + CPUX86State *env) +{ + cpu_load_efer(env, context->efer); + cpu_x86_update_cr4(env, context->cr4); + cpu_x86_update_cr0(env, context->cr0); + cpu_x86_update_cr3(env, context->cr3); + + cpu_x86_load_seg_cache( + env, R_CS, context->code_selector, + context->code_base, context->code_limit, + FLAGS_TO_SEGCACHE(context->code_attributes)); + cpu_x86_load_seg_cache( + env, R_DS, context->data_selector, + context->data_base, context->data_limit, + FLAGS_TO_SEGCACHE(context->data_attributes)); + cpu_x86_load_seg_cache( + env, R_ES, context->data_selector, + context->data_base, context->data_limit, + FLAGS_TO_SEGCACHE(context->data_attributes)); + cpu_x86_load_seg_cache( + env, R_FS, context->data_selector, + context->data_base, context->data_limit, + FLAGS_TO_SEGCACHE(context->data_attributes)); + cpu_x86_load_seg_cache( + env, R_GS, context->data_selector, + context->data_base, context->data_limit, + FLAGS_TO_SEGCACHE(context->data_attributes)); + cpu_x86_load_seg_cache( + env, R_SS, context->data_selector, + context->data_base, context->data_limit, + FLAGS_TO_SEGCACHE(context->data_attributes)); + + env->gdt.base =3D context->gdtr_base; + env->gdt.limit =3D context->gdtr_limit; + env->idt.base =3D context->idtr_base; + env->idt.limit =3D context->idtr_limit; + + env->regs[R_EAX] =3D context->rax; + env->regs[R_ECX] =3D context->rcx; + env->regs[R_EDX] =3D context->rdx; + env->regs[R_EBX] =3D context->rbx; + env->regs[R_ESP] =3D context->rsp; + env->regs[R_EBP] =3D context->rbp; + env->regs[R_ESI] =3D context->rsi; + env->regs[R_EDI] =3D context->rdi; +#ifdef TARGET_X86_64 + env->regs[R_R8] =3D context->r8; + env->regs[R_R9] =3D context->r9; + env->regs[R_R10] =3D context->r10; + env->regs[R_R11] =3D context->r11; + env->regs[R_R12] =3D context->r12; + env->regs[R_R13] =3D context->r13; + env->regs[R_R14] =3D context->r14; + env->regs[R_R15] =3D context->r15; +#endif + env->eip =3D context->rip; + env->eflags =3D context->rflags; +} + /* * convert e820 table into igvm memory map */ @@ -44,3 +150,31 @@ int qigvm_x86_get_mem_map_entry(int index, } return 0; } + +/* + * set initial cpu context + */ +static struct IgvmNativeVpContextX64 *bsp_context; + +int qigvm_x86_set_vp_context(void *data, int index, Error **errp) +{ + if (index !=3D 0) { + error_setg(errp, "context can be set for BSP only"); + return -1; + } + + if (bsp_context =3D=3D NULL) { + bsp_context =3D g_new0(struct IgvmNativeVpContextX64, 1); + } + memcpy(bsp_context, data, sizeof(struct IgvmNativeVpContextX64)); + return 0; +} + +void qigvm_x86_bsp_reset(CPUX86State *env) +{ + if (bsp_context =3D=3D NULL) { + return; + } + + qigvm_x86_load_context(bsp_context, env); +} --=20 2.51.1 From nobody Sun Dec 14 05:56:41 2025 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=1762159393; cv=none; d=zohomail.com; s=zohoarc; b=E94UDvum2lXQtTD5sTpIdi8ktgfKLB2R3OQbSytPU2KprjjYWY3I1uAjoULalKPTYsGOgZq2DTN7AszznYIwM0D+JgG8xvDZ5+jQBtp1G9Ucs/oew3hQw8yV/5tLjpOU4J+c3XL6KSbeVPmDHe6leRhT1tOng9bU8hYwp1nrwSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762159393; 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=bYk6jZsbaKjmox4r1f+JCpv408Di2ZRU+LOjH11Xq+E=; b=koh8o3bLMpkyNo+K14+Z38ZUjR7+HGuNPu8uzwZRa+BNa0YtJm7KjJ7oPHTuCr2r/Ib8LuM3Og9ssfNnHH96gy3LgVfJFWtrG3eJw4APA5uUQ4mq3ffdKwTmNQSOtvZ0/cGGS2Lmgl/SR5DoKQ+XSP+03A1UKX6Woml7YTm2rDM= 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 1762159393736831.3327763506691; Mon, 3 Nov 2025 00:43:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vFq8t-0007r2-EM; Mon, 03 Nov 2025 03:42: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 1vFq8p-0007qg-G8 for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:19 -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 1vFq8m-0000Gg-R4 for qemu-devel@nongnu.org; Mon, 03 Nov 2025 03:42:19 -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-691-WGqmHYXmMYaUe4ud_t_A0A-1; Mon, 03 Nov 2025 03:42:11 -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 1919319560A7; Mon, 3 Nov 2025 08:42:11 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.33.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 879721800451; Mon, 3 Nov 2025 08:42:10 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DA1FD180060B; Mon, 03 Nov 2025 09:42:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762159333; 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=bYk6jZsbaKjmox4r1f+JCpv408Di2ZRU+LOjH11Xq+E=; b=Hr+6KwN2ZSmC3y9+RUr8cire9lki6ioN9+kGybFbgsku1vvk5wCWT/FYbJ17puS2oW1nFB /tIfAJR3UIa6Uegnn0uGgrmsIJoOZ6t+v8Q1ocuAxEgTvlJsvMSZvcesOor0bVaBUcTe0g 7mgoUyIqrdk5UDwKMCfJn9o4bNGnb/U= X-MC-Unique: WGqmHYXmMYaUe4ud_t_A0A-1 X-Mimecast-MFC-AGG-ID: WGqmHYXmMYaUe4ud_t_A0A_1762159331 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Paolo Bonzini , Stefano Garzarella , Zhao Liu , Ani Sinha Subject: [PULL 5/5] igvm: add MAINTAINERS entry Date: Mon, 3 Nov 2025 09:42:00 +0100 Message-ID: <20251103084201.45417-6-kraxel@redhat.com> In-Reply-To: <20251103084201.45417-1-kraxel@redhat.com> References: <20251103084201.45417-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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1762159396987154100 Content-Type: text/plain; charset="utf-8" Roy Hopkins (the original author) does not respond, so the new plan going forward is that I will maintain this together with Stefano. Also add Ani as reviewer. Reviewed-by: Stefano Garzarella Signed-off-by: Gerd Hoffmann Message-ID: <20251029105555.2492276-6-kraxel@redhat.com> --- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a6a1d36f52da..ee058e2fef00 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3908,6 +3908,17 @@ F: roms/edk2-* F: tests/data/uefi-boot-images/ F: tests/uefi-test-tools/ =20 +IGVM Firmware +M: Gerd Hoffmann +M: Stefano Garzarella +R: Ani Sinha +S: Maintained +F: backends/igvm*.c +F: docs/system/igvm.rst +F: include/system/igvm*.h +F: stubs/igvm.c +F: target/i386/igvm.c + VT-d Emulation M: Michael S. Tsirkin R: Jason Wang --=20 2.51.1