From nobody Thu Jul 23 21:13:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1784122861; cv=none; d=zohomail.com; s=zohoarc; b=FvCotESfahkzoOx4or3tIzAX7F9N4PIep5P5564yLWq+NWFidYWoj7Q1K9LA0ECfC1ZaEvPFYOjjttZ29PY6OXCKaKO+75g7BPsavog1oQv4P8GX/YMBlzdRXziaJyIJk4cd4VMRjPmo8+zqwCtgGB/m/h/B63T9QW+mNVpcVgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784122861; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yS8vP9GnZ+0xzLEsAjUUqVtirNGe6IX+4wuf965rsU4=; b=a3st7bGRe6yO7VJ5qh6QizQ6xcgKpB7iytjcLI3T0AbIge72PJuExZrzx0MtuHDV2o6FGmDNtomqsE1bBOU2O+nHgE2BGchmDBnwYHW6zHnFDWibSW62WwFcUMO72uDydcQb9rPCB4ZtrxBQBwpVUI1h7Ojt/9v3fb3/hci8/6k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1784122861812510.2285594689639; Wed, 15 Jul 2026 06:41:01 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1363136.1614943 (Exim 4.92) (envelope-from ) id 1wjzqu-00089U-V4; Wed, 15 Jul 2026 13:40:44 +0000 Received: by outflank-mailman (output) from mailman id 1363136.1614943; Wed, 15 Jul 2026 13:40:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjzqu-00089N-Re; Wed, 15 Jul 2026 13:40:44 +0000 Received: by outflank-mailman (input) for mailman id 1363136; Wed, 15 Jul 2026 13:40:43 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjzqt-00089B-LB for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:40:43 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wjzqt-003NjP-1B for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 15:40:43 +0200 Received: from [10.42.69.8] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a578dd8-5cb7-0a2a0a5109dd-0a2a4508a26e-12 for ; Wed, 15 Jul 2026 15:40:42 +0200 Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net) by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a578dda-f659-0a2a45080019-b9ff1c23a4e7-3 for ; Wed, 15 Jul 2026 15:40:42 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 19f66020908000edb5.003 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 15 Jul 2026 13:40:37 +0000 Received: from localhost.localdomain (88-188-240-210.subs.proxad.net [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech) by mail2.vates.fr (Postfix) with ESMTPSA id AA2DD822E4; Wed, 15 Jul 2026 15:40:36 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=yS8vP9GnZ+0xzLEsAjUUqVtirNGe6IX+4wuf965rsU4=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=smY0Ldhnlt0ju/On5OIt31R5Kw9oUICBAsZGDGknbPWOHnkuGGLlgwE1LAiZBZDuWsEwT5qPI h25YwMzaaVMokqqroeCQ3ZAFqvCZZV8NrzgqP8iCwTR+F0Dhxy3g042+tR3pQiE0c5Cs0D+6Kh2 sHxxoSZ8SbyWlmDrMX2PvWcSq2JOEYU7PY2a8pBRJ2J0DsQp7qL59Gdnf7TNXCwkGfKgjrVY91M 7AyfnYB/7Ex9/SVoatD9GkXi5ePK5/234gdwNu6/s+apocXgybQgv+l//2TyI198u/M+z1xqyzn HXMcrEN7W+CHpYi1mjX0+dBiXUKOzOBpHodR2HZc+xWQ== X-Zone-Loop: 75f535aa9b00bfc878f48229354b4a8eeeee1c4f8d6e x-campaign-type: default x-transaction-id: 81b0573a-b0e7-4e75-ae9f-289fadeb2a04 x-swg-uid: 01-eb049795-afce-4da2-a5f4-e6cb1b6d9d17 X-Mailer: Sweego Message-ID: <1784122837.8631fc262581453bbf619ec5b2062170.19f66020908000edb5@vates.tech> x-swg-bid: 1784122837.8631fc262581453bbf619ec5b2062170.19f66020908000edb5 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Teddy Astie To: xen-devel@lists.xenproject.org Cc: Teddy Astie , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [RFC PATCH 1/2] vmx: Introduce TDX instruction exit reasons Date: Wed, 15 Jul 2026 15:38:27 +0200 In-Reply-To: <1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@vates.tech> References: <1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@vates.tech> MIME-Version: 1.0 X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.890.c5c60b1e32e264a1.19f6602075d.785637313f19f3ab=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1784122836829 X-purgate-ID: tlsNG-c1860d/1784122842-CCF4F87B-67669DB0/0/0 X-purgate-type: clean X-purgate-size: 1856 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1784122863729158500 ---=Part.890.c5c60b1e32e264a1.19f6602075d.785637313f19f3ab=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" On hardware that supports TDX, guests can cause VMEXIT related to TDX instructions (SEAMCALL and TDCALL). Signed-off-by: Teddy Astie --- xen/arch/x86/include/asm/hvm/vmx/vmx.h | 2 ++ xen/arch/x86/include/asm/perfc_defn.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/= asm/hvm/vmx/vmx.h index da04752e17..b8219e0408 100644 --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h @@ -201,6 +201,8 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc) #define EXIT_REASON_XRSTORS 64 #define EXIT_REASON_BUS_LOCK 74 #define EXIT_REASON_NOTIFY 75 +#define EXIT_REASON_SEAMCALL 76 +#define EXIT_REASON_TDCALL 77 /* Remember to also update VMX_PERF_EXIT_REASON_SIZE! */ =20 /* diff --git a/xen/arch/x86/include/asm/perfc_defn.h b/xen/arch/x86/include/a= sm/perfc_defn.h index ac7439b992..102b9be6ef 100644 --- a/xen/arch/x86/include/asm/perfc_defn.h +++ b/xen/arch/x86/include/asm/perfc_defn.h @@ -6,7 +6,7 @@ PERFCOUNTER_ARRAY(exceptions, "exceptions", 32) =20 #ifdef CONFIG_HVM =20 -#define VMX_PERF_EXIT_REASON_SIZE 76 +#define VMX_PERF_EXIT_REASON_SIZE 78 #define VMEXIT_NPF_PERFC 166 #define SVM_PERF_EXIT_REASON_SIZE (VMEXIT_NPF_PERFC + 1) PERFCOUNTER_ARRAY(vmexits, "vmexits", --=20 2.54.0 --=20 Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.890.c5c60b1e32e264a1.19f6602075d.785637313f19f3ab=--- From nobody Thu Jul 23 21:13:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1784122873; cv=none; d=zohomail.com; s=zohoarc; b=fuj9ZkVM3EkpnjMip1D6OQV1VU8YZzRXEWGPQnOHmZJAVWbmeN2aM+HKW398t2h+jcbOGNrn7/RVkV8OTqpT9IzTkDi6LxzfedrpVIjmlN/pge/BmR4wV1JrUbdBH1hCHw6vvQUif/4RZrFJEUWKCXUQ9/JyvOFNhATQ3/5hE2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784122873; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IYUxAUY+XUVrfvgMnF3AcIUyUaG4Dpyw2dYT3Z3A3Aw=; b=da67Yhzken8ioh7Dsuy9uyOSuUYSx6xtli2p+gfNX3J3h5UmaNVM4uTY3N4NKuF2/lsJW58w1uwycGxIic5ckby/dgh3ecGa3QTfpZUH+40bJDjCSh+jd9Xkb7xRBDPVU/+nrkzJUVeWSQLmzjVIGMxA78Xd2N6vELbskDiB3KQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1784122873957934.935501112064; Wed, 15 Jul 2026 06:41:13 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1363138.1614951 (Exim 4.92) (envelope-from ) id 1wjzrB-0008UC-4Z; Wed, 15 Jul 2026 13:41:01 +0000 Received: by outflank-mailman (output) from mailman id 1363138.1614951; Wed, 15 Jul 2026 13:41:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjzrB-0008U2-22; Wed, 15 Jul 2026 13:41:01 +0000 Received: by outflank-mailman (input) for mailman id 1363138; Wed, 15 Jul 2026 13:40:59 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wjzr9-0008SI-Cr for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:40:59 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wjzr8-002mfL-Od for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 15:40:58 +0200 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a578ddf-bab6-0a2a0a5309dd-0a2a45099892-40 for ; Wed, 15 Jul 2026 15:40:58 +0200 Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a578dea-be1a-0a2a45090019-b9ff1c22916f-3 for ; Wed, 15 Jul 2026 15:40:58 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 19f660249d4000edb5.003 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 15 Jul 2026 13:40:53 +0000 Received: from localhost.localdomain (88-188-240-210.subs.proxad.net [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech) by mail2.vates.fr (Postfix) with ESMTPSA id 0782381F5A; Wed, 15 Jul 2026 15:40:53 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=IYUxAUY+XUVrfvgMnF3AcIUyUaG4Dpyw2dYT3Z3A3Aw=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=BO8Z1/siGNiVLYP8MliraOfVv0WezqdHoN2ynTqNf1p/nDz5Js/dZuB903NOwoVcz2utloVQn MVf5Zx5QYIEhMbHEmJwR4HpYony9TjuQZO2UvipsCS2V/sHjr0M9NyPYslJ4YHfhrMtU8qQqKk8 2LpzQRwRPOJhDRrEdSZc9MzYyHbl29uqQrspPdxlgBLI0IEGL6/x7UrZiTZ7+yfiaFZIPGQrG+n ZGioTRQWpJkOLg40cd69+O3o1H0hTfStXQfeiuRjRIeQZE+If4kw7iU7kZMXxoBamaXpeMNdVqb cl5HkOHAnsFYW5lzwZM+JYNWXl+eztkMM2s9ykOUWtxg== X-Zone-Loop: ed2350d586bedb6d5137f39db10d58a630329a1e3aa0 x-campaign-type: default x-transaction-id: 9cbfeea0-89ee-4a48-9a2f-18f220b71af7 x-swg-uid: 01-0ac4104e-828d-4284-9190-5d09a9dc5283 X-Mailer: Sweego Message-ID: <1784122853.8631fc262581453bbf619ec5b2062170.19f660249d4000edb5@vates.tech> x-swg-bid: 1784122853.8631fc262581453bbf619ec5b2062170.19f660249d4000edb5 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Teddy Astie To: xen-devel@lists.xenproject.org Cc: Teddy Astie , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [RFC PATCH 2/2] vvmx: Reinject TDX instruction exit reasons to L1 when emitted by L2 Date: Wed, 15 Jul 2026 15:38:29 +0200 In-Reply-To: <1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@vates.tech> References: <1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@vates.tech> MIME-Version: 1.0 X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.891.1691f3a2d28ce8c7.19f66024750.264e79b43cc33c9=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1784122853200 X-purgate-ID: tlsNG-bad1c0/1784122858-BE2C4034-782739D8/0/0 X-purgate-type: clean X-purgate-size: 1197 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1784122875391158500 ---=Part.891.1691f3a2d28ce8c7.19f66024750.264e79b43cc33c9=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reinject the exit reason to L1 rather than failing on "Unhandled nested vme= xit" which leads to a L1 crash that can be caused by L2 by executing one of the = TDX instructions. Signed-off-by: Teddy Astie --- xen/arch/x86/hvm/vmx/vvmx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index e4cdfe55c1..b2ad7db332 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++ b/xen/arch/x86/hvm/vmx/vvmx.c @@ -2496,6 +2496,8 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs, case EXIT_REASON_INVEPT: case EXIT_REASON_XSETBV: case EXIT_REASON_INVVPID: + case EXIT_REASON_SEAMCALL: + case EXIT_REASON_TDCALL: /* inject to L1 */ nvcpu->nv_vmexit_pending =3D 1; break; --=20 2.54.0 --=20 Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.891.1691f3a2d28ce8c7.19f66024750.264e79b43cc33c9=---