From nobody Fri Nov 14 19:39:56 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=1761122749; cv=none; d=zohomail.com; s=zohoarc; b=e9hZkvkD+5pbSRTfxw2SQL9nrn5Pq+v4FaWxYBU7jRyzHX7EYaO+uLNeqsC17oLqJJhD6vGaGbbNhSOR8LpxuCWLvUmascgNP0JcB2YC0xsTaldR1FnoW2isQlUbGXT2QaifqeugKYTMHAAzaFS0B+22pp/FX2FWjHGdEK2uhu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761122749; 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=h6cRB5dCtdTgGYe6KYMm24m1SHZt4IiI4xZx8x3q93Y=; b=lgd0iIH9zU8E1nZffikEO7RIEgUnMn/AQsmaKsziIalwx3k2QeUht0RPZ8KfR1Q5bx1stwOMDeENC9lWvWlPlk7G+tVvVy6jBuAN8P/9CTuLssoVIhWUjk8eiA1iuKwN5LgY8K9B2nrbUzszz5TYdTA+dTtR0XLEaDShTvRirQA= 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 1761122749898209.7442840474356; Wed, 22 Oct 2025 01:45:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vBUSk-00016i-P1; Wed, 22 Oct 2025 04:44:54 -0400 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 1vBUSh-00016U-SK for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:44:51 -0400 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 1vBUSf-0006jY-Q8 for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:44:51 -0400 Received: from mx-prod-mc-04.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-70-4LOqvGjlPs2bc8VR4nxxPA-1; Wed, 22 Oct 2025 04:44:44 -0400 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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 626F81954190; Wed, 22 Oct 2025 08:44:43 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.27]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 766993000235; Wed, 22 Oct 2025 08:44:42 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C4D6B18003A0; Wed, 22 Oct 2025 10:44:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761122688; 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=h6cRB5dCtdTgGYe6KYMm24m1SHZt4IiI4xZx8x3q93Y=; b=I5XBNKFiSo5bpAbvzRLXZ9Oxv3vq/aMOxdfmIr+oaZR5LmWjLYDTx/BOrem8maqdK3Grhk 6yTBLGiHTWkFqVt2PNerU6aJRCfiXAeU52PYaHnyLvVcVErbxTNNuLOZsOMvyuEUzRi1Mq GrEXx+M8dgHl8zqf+5GvXmFmMRxkZ7E= X-MC-Unique: 4LOqvGjlPs2bc8VR4nxxPA-1 X-Mimecast-MFC-AGG-ID: 4LOqvGjlPs2bc8VR4nxxPA_1761122683 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Stefano Garzarella , Paolo Bonzini , Ani Sinha , Luigi Leonardi , Gerd Hoffmann , Zhao Liu , Roy Hopkins Subject: [PATCH v4 1/5] igvm: move igvm.h file to include/system Date: Wed, 22 Oct 2025 10:44:35 +0200 Message-ID: <20251022084439.242476-2-kraxel@redhat.com> In-Reply-To: <20251022084439.242476-1-kraxel@redhat.com> References: <20251022084439.242476-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: 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: 1761122752547154100 Content-Type: text/plain; charset="utf-8" Prepare for arch-specific igvm code being added to the code base. Signed-off-by: Gerd Hoffmann Reviewed-by: Ani Sinha Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi --- {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.0 From nobody Fri Nov 14 19:39:56 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=1761122775; cv=none; d=zohomail.com; s=zohoarc; b=ClubUf2AR0lmHKGc/8SdBvU6P4rZorlbpwwTy4rvZWMaeWIRLpdEXUSNgUBspY6Gp4lkZ+5TAYeG239NMLAuI0771hLVLD1b7KWku76Gq/+Gsn72I/WrWTiOUIt9UDWvVuGvPBRuq11oscdr+Uima3kioA++1qgQv9riCiVDzPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761122775; 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=oK4tMACLr7ZGG4TcoGnKHpQhrPD/YeyX3lPt+FRIloM=; b=iEmLr2nYMowNfNDuESh4qO7k6XQf0gWxClM9XEKgVRR9wrqvQUDy69YN3Y/n3+RRkaCwrmPTaiG3Xk77K03aZNrXI1zQN6KaE/G5qxvgF6eCH0dOO5OLUd5BYVTU4MXdQbmHuOiFeTR1aknbEHv6FRUtEFrryflQjxlHY3/s9oc= 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 1761122775800499.0948666219389; Wed, 22 Oct 2025 01:46:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vBUSp-00017H-8b; Wed, 22 Oct 2025 04:44:59 -0400 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 1vBUSk-00016o-JI for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:44:54 -0400 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 1vBUSi-0006jk-R7 for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:44:54 -0400 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-253-f8-BmydoNeC1KZ0B_XuFdA-1; Wed, 22 Oct 2025 04:44:48 -0400 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 3EE4C1955D94; Wed, 22 Oct 2025 08:44:47 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.27]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 01531180059F; Wed, 22 Oct 2025 08:44:45 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D4AFE18003AA; Wed, 22 Oct 2025 10:44:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761122691; 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=oK4tMACLr7ZGG4TcoGnKHpQhrPD/YeyX3lPt+FRIloM=; b=GcsQkRrlo2R6Z1c86cW+r0qN6mdvjqeNV3ks+MibmETi/FYSfvV7hkFUuqxfJK8vqqQbbm MMKsuy0Fo9Vxwz9iCwlFGQfrI5e1Y66hFv9z5fElFwMyfobBXk8L9Rvivdl0j/fKsMlQxC 975/sbhL3lWC45AXvKOJZFloe6ZNNoo= X-MC-Unique: f8-BmydoNeC1KZ0B_XuFdA-1 X-Mimecast-MFC-AGG-ID: f8-BmydoNeC1KZ0B_XuFdA_1761122687 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Stefano Garzarella , Paolo Bonzini , Ani Sinha , Luigi Leonardi , Gerd Hoffmann , Zhao Liu , Roy Hopkins Subject: [PATCH v4 2/5] igvm: fix off by one bug in memmap entry count checking Date: Wed, 22 Oct 2025 10:44:36 +0200 Message-ID: <20251022084439.242476-3-kraxel@redhat.com> In-Reply-To: <20251022084439.242476-1-kraxel@redhat.com> References: <20251022084439.242476-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.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1761122776809154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Luigi Leonardi Reviewed-by: Stefano Garzarella --- 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.0 From nobody Fri Nov 14 19:39:56 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=1761122759; cv=none; d=zohomail.com; s=zohoarc; b=U/PwjHdyeMV6tHQRS4fjdxYy/ybbHjPtZ25QFImmFhVYARCy7x7WPVhlmmdO41wZiwCP+IN/liae2QBSN+0Hf/lCGueFHxd95yueMnxjE9p7Q//tktZ+QCLyveFHqIZSCRwdNEckgwHGojIQFSxGg+OSzQRmyPMnJGvHuPHVAsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761122759; 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=REwtwdBnrn7/pIsSE0ceuLVkkF2/Lof5H6hVtnoiitU=; b=CqJ8FOCFDhwASfcPIvBSVBuApBhv/c56zfjFSB9u6j2Vk4F8FhyU/pJeu/taksfyfppQS9amj/pl7w6v8JwarNkwSEECm79FME0fHXv3SQuGscvMVSalnpN8C0UHNzyUhf3+UWSv8FCpa3ekjDs14uI0C+jqRkqpvI3Yu8jNpJM= 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 1761122759153251.41372664275957; Wed, 22 Oct 2025 01:45:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vBUSu-000196-Kl; Wed, 22 Oct 2025 04:45:04 -0400 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 1vBUSn-00017G-K7 for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:44:59 -0400 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 1vBUSl-0006k6-PP for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:44:57 -0400 Received: from mx-prod-mc-02.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-548-tdUALlZ2OpmpU1-AbVhjqg-1; Wed, 22 Oct 2025 04:44:51 -0400 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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C2D69195608E; Wed, 22 Oct 2025 08:44:50 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.27]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D009C19560B9; Wed, 22 Oct 2025 08:44:46 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id F03701800784; Wed, 22 Oct 2025 10:44:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761122694; 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=REwtwdBnrn7/pIsSE0ceuLVkkF2/Lof5H6hVtnoiitU=; b=gFie9/GaiEUv63s1uPCgZ2d5dyFq7Yl0xEmJg67ovWCEIksm4qPsh4RCVgPf1N5gksdNLP D8eJgNaa+E/7Ed5uVVnXyY3adh3AI3u3n7M13jTM0ypFgPbqcXDeY+ouwaPpw0jS/KvLPF x6dkn9d5jNESJCKLR7LFtszktE/xU1g= X-MC-Unique: tdUALlZ2OpmpU1-AbVhjqg-1 X-Mimecast-MFC-AGG-ID: tdUALlZ2OpmpU1-AbVhjqg_1761122691 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Stefano Garzarella , Paolo Bonzini , Ani Sinha , Luigi Leonardi , Gerd Hoffmann , Zhao Liu , Roy Hopkins Subject: [PATCH v4 3/5] igvm: add support for igvm memory map parameter in native mode Date: Wed, 22 Oct 2025 10:44:37 +0200 Message-ID: <20251022084439.242476-4-kraxel@redhat.com> In-Reply-To: <20251022084439.242476-1-kraxel@redhat.com> References: <20251022084439.242476-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: 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: 1761122760472154100 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. Signed-off-by: Gerd Hoffmann Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi --- 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.0 From nobody Fri Nov 14 19:39:56 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=1761122755; cv=none; d=zohomail.com; s=zohoarc; b=KKJ0bNFiYRLuc3Pi6N0Sln1ZU6rGLDeIbtA7+dWSBOzd0bR3evxZ+kJbnOhQjDTbk+nALpbbJUnCgO9k76R1pmQPOO6gHe+TI34r40LuwC4n/3J9fb6goTrVMKwz9LH8ILYwsrCPjKjqBwpnwDMmY9sRYI9HLuw5fZs8kdyx2Xk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761122755; 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=d3twQ0krWMMyUsVJCBriSgLhaDk3cZfluj+ubR8cgYk=; b=IulAcPt3+t9QzhhTbrOrVfb8XD9AwzOwDYYraawHUBfmJCiYswD1OFobI6uBvM8/mqd4dEseFbInTMvfYN+tPGzBG7lZbueaErjRVcghLI936wv+d7r+XQifFd9yf0JVwxu6pzdKY1SC2nPr8QvhXrDfwQqUhTiSCmaR0JzHSCA= 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 1761122755433394.0305138567744; Wed, 22 Oct 2025 01:45:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vBUSw-00019t-Ud; Wed, 22 Oct 2025 04:45:07 -0400 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 1vBUSu-00019I-Q1 for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:45:04 -0400 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 1vBUSs-0006kW-7J for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:45:04 -0400 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-640-tT2FY9r8Oo6GkqMS3io_XA-1; Wed, 22 Oct 2025 04:44:58 -0400 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 7FF54189C327; Wed, 22 Oct 2025 08:44:50 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.27]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D11EA3000221; Wed, 22 Oct 2025 08:44:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 17F8318007B0; Wed, 22 Oct 2025 10:44:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761122701; 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=d3twQ0krWMMyUsVJCBriSgLhaDk3cZfluj+ubR8cgYk=; b=M3P4zGVrDN2Uc0gt2Bqp/emVuhiSgzW96SJEgaR7Rs0Jo/UAO/v34/khyOOrKoJYGwuNtR X7/siEe9eogtZAQzVm0ufuDewYs32q2dTs8Pubf6s/AtNUFYih7VTXZVASgymU9P2egPgE z8Kx1bvV33pE/MqV4bWpDbUEW564Y/U= X-MC-Unique: tT2FY9r8Oo6GkqMS3io_XA-1 X-Mimecast-MFC-AGG-ID: tT2FY9r8Oo6GkqMS3io_XA_1761122697 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Stefano Garzarella , Paolo Bonzini , Ani Sinha , Luigi Leonardi , Gerd Hoffmann , Zhao Liu , Roy Hopkins Subject: [PATCH v4 4/5] igvm: add support for initial register state load in native mode Date: Wed, 22 Oct 2025 10:44:38 +0200 Message-ID: <20251022084439.242476-5-kraxel@redhat.com> In-Reply-To: <20251022084439.242476-1-kraxel@redhat.com> References: <20251022084439.242476-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: 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: 1761122756490154100 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. Signed-off-by: Gerd Hoffmann Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi --- 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 ce948861a765..78d4b427c67a 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2867,6 +2867,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 455caff6b230..e00936e4b542 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.0 From nobody Fri Nov 14 19:39:56 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=1761122766; cv=none; d=zohomail.com; s=zohoarc; b=ip+jSlpGqlNOeGzsEeCRBFr5Mco/XKEHYzeMoGywvGaFDrrOxOere7se1vhKiWuqrslbwvnJ1qgOaLt9/syDgKM2s3I+F5FPyqQCTAS9kJB1NUII77i+4cV3J7TdtqDygiFYhXgAO8jSzfkRaSFnljyJVZ2TGKgw3a9aN4y4hqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761122766; 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=ynI0aaSbuyKviKYJOg1UW9wzQ4Ffq+ygTNJwJrxfprQ=; b=cc5C9NsYPHNkX/UEhrpLFaqkEybaxU7pcgPXzv2DC+9W7faN2trp/T87xI6wGTl+ubTH07yh3xM9Ebsu32Oq1tNC4CyAUwmiGtZtRDvIlRDOoCfchn9lSMdKzYNWRpeCV1J+F26PpzIkxXnH6/n27ywFdYBOv0+88EFmDsAhIDA= 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 1761122766000318.84997279349454; Wed, 22 Oct 2025 01:46:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vBUSr-00018F-E5; Wed, 22 Oct 2025 04:45:01 -0400 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 1vBUSq-000180-Ho for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:45:00 -0400 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 1vBUSp-0006kH-0z for qemu-devel@nongnu.org; Wed, 22 Oct 2025 04:45:00 -0400 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-42-3ZIRgN6eNPiQwIRazDIKzA-1; Wed, 22 Oct 2025 04:44:54 -0400 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 70C701956050; Wed, 22 Oct 2025 08:44:53 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.44.32.27]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0EA7D18003FC; Wed, 22 Oct 2025 08:44:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2649D1800841; Wed, 22 Oct 2025 10:44:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761122698; 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=ynI0aaSbuyKviKYJOg1UW9wzQ4Ffq+ygTNJwJrxfprQ=; b=epzpG7Ovxvsr9kW7znNHP98XRcPrCq5TK5XalWLM9LAeU5RU9q+lERdpeTedFiVZk+pnnY hnAEtN3NxzYLetIFNVWXl+SileMdViRLXiXTq0mvMGG+IUpDoYzTTpPYbu+ZyfZcur/evr ja44zKuRWIyvYyBBEoF5Ue5cp1/Uuqc= X-MC-Unique: 3ZIRgN6eNPiQwIRazDIKzA-1 X-Mimecast-MFC-AGG-ID: 3ZIRgN6eNPiQwIRazDIKzA_1761122693 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: Stefano Garzarella , Paolo Bonzini , Ani Sinha , Luigi Leonardi , Gerd Hoffmann , Zhao Liu , Roy Hopkins Subject: [PATCH v4 5/5] igvm: add MAINTAINERS entry Date: Wed, 22 Oct 2025 10:44:39 +0200 Message-ID: <20251022084439.242476-6-kraxel@redhat.com> In-Reply-To: <20251022084439.242476-1-kraxel@redhat.com> References: <20251022084439.242476-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: 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: 1761122768415154100 Content-Type: text/plain; charset="utf-8" Add Roy (being the original author) as maintainer. Add myself and Ani as reviewer. Status to be decided. Signed-off-by: Gerd Hoffmann --- MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0c766961f39a..1c4904ad9187 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3892,6 +3892,16 @@ F: roms/edk2-* F: tests/data/uefi-boot-images/ F: tests/uefi-test-tools/ =20 +IGVM Firmware +M: Roy Hopkins +R: Gerd Hoffmann +R: Ani Sinha +S: TBD +F: backends/igvm*.c +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.0