[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 2/2] x86/svm: Use the virtual NMI when available


  • To: Teddy Astie <teddy.astie@xxxxxxxxxx>, Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 16 Feb 2026 10:14:24 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ki1UHin1Xk/+GuLaOf2MIjw8v0BY//wyyAupNa/EDDI=; b=TxL4ZJ11ZxpLpkVLJoCIbh2oNhIv4nwJblnnTVtd2UD6emlssDdSAFLhXAJDxaZOhJpm9SHGynbbSYmE153DFyOBQLX7nw/8nICvrEjJ/rJQR0Ja8nLanalVIJRU7vK/lkIsuGCyXY0j04Y7Id6aXZfjg9AaZ9k96YWaOoIeWiyvrbNkBmcZiF3A7BNvr0Uwrxb4+zEi9Ku5j7I7uGoarZ7vZig4jTayR61ZmULLXG0MuYuz5kGAWUhEm1QEJBmGJflRyXbCf94+qp0506zB8CCOCNeXteibrqMQNpMV8OFoW2WIgCg1nC6gn/CD/yhDGlCbvejESUoOwqZyVFj7jw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GM6UOQxSUY+R9Vume5lJvcffALa+qoZjQPMQs0m4t87nSCHjPKiyeH/fWetJfBktxCnPuP0l5mNGeYd+JrjlHud0t6iDlim+8FRpVuOp/V631M2vRnt6wTLjVn/e5Zne2HY4k06TZjyASzdoNYhDGTcDt5d10i2TMy9B32wo/eyrlmDlt54HOzhZ6+/iQk8Di3hPgzAgENoqaqMM89O1xLmERSj/GyFz6H5VUIbvo1PAMG/CV41IPjXnVLEug89zTBajaleR78KlAsz+NOEDjsbmo27eCBBLfbKlCr6l7/uVrNkhw+nXhxtlESpZ2Qm2MkhtbzmCId8MZWAUnAmFPg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, roger.pau@xxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>
  • Delivery-date: Mon, 16 Feb 2026 10:14:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16/02/2026 10:07 am, Teddy Astie wrote:
> Le 15/02/2026 à 19:24, Abdelkareem Abdelsaamad a écrit :
>> 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 tracking
>> of the NMI handling completion with the IRET instruction interception.
>>
>> Adjust the svm_inject_nmi to rather inject the NMIs using the vNMI Hardware
>> accelerated feature when the AMD platform support the vNMI.
>>
>> Adjust the svm_get_interrupt_shadow to check if the vNMI is currently blocked
>> by servicing another in-progress NMI.
>>
>> Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@xxxxxxxxxx>
>> ---
>>   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 = 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 = 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?  The APM states otherwise.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.