Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 21760E7BD8B for ; Mon, 16 Feb 2026 10:46:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1233963.1537337 (Exim 4.92) (envelope-from ) id 1vrw7J-0003Tm-Mj; Mon, 16 Feb 2026 10:46:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1233963.1537337; Mon, 16 Feb 2026 10:46:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vrw7J-0003Tf-IG; Mon, 16 Feb 2026 10:46:13 +0000 Received: by outflank-mailman (input) for mailman id 1233963; Mon, 16 Feb 2026 10:46:12 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vrw7I-0003TX-5j for xen-devel@lists.xenproject.org; Mon, 16 Feb 2026 10:46:12 +0000 Received: from mail187-15.suw11.mandrillapp.com (mail187-15.suw11.mandrillapp.com [198.2.187.15]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b45d2479-0b24-11f1-b163-2bf370ae4941; Mon, 16 Feb 2026 11:46:10 +0100 (CET) Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail187-15.suw11.mandrillapp.com (Mailchimp) with ESMTP id 4fDzw12HD8zPm0PWl for ; Mon, 16 Feb 2026 10:46:09 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 5d3fa0f62d8e4ffd87a929d5e8b1399c; Mon, 16 Feb 2026 10:46:09 +0000 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" X-Inumbo-ID: b45d2479-0b24-11f1-b163-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1771238769; x=1771508769; bh=97FE3cAfG4P7WeW9MfP+c96ioDn68+UIqmNFh7TtqwU=; h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=ZMzDHZoZVkqkVSLJgzCmNr9pOyWauPPgMyy05udGKfOK8EEdN9hvkhnKZgg/711y6 phyfr3gWOMin9yNcXzNA2XteUc/wtkwMm/JWgMy49Oz0y2+0Y3dFB+sjLYB7cOimUM XcOqvbghOPr+l6yMtYVIsRD3SpjyeJComT2jjcAU4lhIkHbCrgC+6LiUZGEjgZW9zf j6FzEtXHLycjbEgVkj7VEZX7BqKk0gKV+gkKckFLJd1/Lgr+CdvZVRYkjDgndICgzr xdURyb/FRvAb/6uYJzTX+T0OpfsIO6CsM4iRFd5AwU7Pd1WMWJFFeezXuNL7pQHAH0 6DgM5DBgOXZBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1771238769; x=1771499269; i=teddy.astie@vates.tech; bh=97FE3cAfG4P7WeW9MfP+c96ioDn68+UIqmNFh7TtqwU=; h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=sAt9j1qcjcoK08LfN0TQwA9+KGS4h7s8bPMzWs/T9bwrdRM+X1M0u5bHz9m4Hf1X+ bLRe6uA51tQ7M2U2Kq6iWwJ3Ae5zQvUUFw+NLf/IRd6SL52nRudiQLAscZoy3ptZzq z2Yb5E1xBl0totMotVvDkEY6IXZY/PARFfMI5+TstnYs8NKr7hufLl3+oOqRmctxkA 9l/Mq56PfHkXWRgW3DQgDhAbdoICIdsU3NYqlDW+mb32eoaeWidxUKM9LQPUm+rtAh 4CWgG5B/0KZKh7q8Y5rkBagqDTqwOxpUaP+1o+AzWbSJRNnUel6GX+tWguilztWF2v rshFvO+tKnG/g== From: "Teddy Astie" Subject: =?utf-8?Q?Re:=20[PATCH=20v3=202/2]=20x86/svm:=20Use=20the=20virtual=20NMI=20when=20available?= X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1771238767625 Message-Id: <626c3f3b-9176-493c-9d96-e2a5344e7100@vates.tech> To: "Andrew Cooper" , "Abdelkareem Abdelsaamad" , xen-devel@lists.xenproject.org Cc: roger.pau@citrix.com, "Jan Beulich" , "Jason Andryuk" References: In-Reply-To: X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.5d3fa0f62d8e4ffd87a929d5e8b1399c?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20260216:md Date: Mon, 16 Feb 2026 10:46:09 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le 16/02/2026 =C3=A0 11:16, Andrew Cooper a =C3=A9crit=C2=A0: > On 16/02/2026 10:07 am, Teddy Astie wrote: >> Le 15/02/2026 =C3=A0 19:24, Abdelkareem Abdelsaamad a =C3=A9crit=C2=A0: >>> With the Virtual NMI (vNMI), the pending NMI is simply stuffed into the= VMCB >>> and handed off to the hardware. There is no need for the artificial tra= cking >>> of the NMI handling completion with the IRET instruction interception. >>> >>> Adjust the svm_inject_nmi to rather inject the NMIs using the vNMI Hard= ware >>> accelerated feature when the AMD platform support the vNMI. >>> >>> Adjust the svm_get_interrupt_shadow to check if the vNMI is currently b= locked >>> by servicing another in-progress NMI. >>> >>> Signed-off-by: Abdelkareem Abdelsaamad >>> --- >>> xen/arch/x86/hvm/svm/intr.c | 9 +++++++++ >>> xen/arch/x86/hvm/svm/svm.c | 5 ++++- >>> xen/arch/x86/hvm/svm/vmcb.c | 2 ++ >>> 3 files changed, 15 insertions(+), 1 deletion(-) >>> >>> diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c >>> index 6453a46b85..3e8959f155 100644 >>> --- a/xen/arch/x86/hvm/svm/intr.c >>> +++ b/xen/arch/x86/hvm/svm/intr.c >>> @@ -33,6 +33,15 @@ static void svm_inject_nmi(struct vcpu *v) >>> u32 general1_intercepts =3D vmcb_get_general1_intercepts(vmcb); >>> intinfo_t event; >>> >>> + if ( vmcb->_vintr.fields.vnmi_enable ) >>> + { >>> + if ( !vmcb->_vintr.fields.vnmi_pending && >>> + !vmcb->_vintr.fields.vnmi_blocking ) >>> + vmcb->_vintr.fields.vnmi_pending =3D 1; >>> + >>> + return; >>> + } >>> + >> I think you need to update the clearbit for tpr (related to vintr) for >> the hardware to know that you modified the vnmi_pending bit. > > What makes you think this?=C2=A0 The APM states otherwise. > The APM state doesn't appears to state regarding this; it's neither a part of the "VMCB Clear Field" layout part nor the the "explicitely not cached" list. So I assume that it may be covered by the TPR clean-bit (which is the same part of vmcb); as it's actually unclear if hardware wants it or not. > ~Andrew > Teddy -- Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech