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

Re: [PATCH 0/3] Virtual NMI


  • To: abdelkareem.abdelsaamad@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 9 Feb 2026 18:11:59 +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=29IhPBoDLG9pzMm2IF5Xg1IaTWeDQSx/ANhxSFXIjX4=; b=fiQwA1zY6fUqafl5hAngk0JPSY7uRLjIpUGkQjxroV32MFwl1BJwVQ4CDwPIh9aWvUp4ScagcFxI592ekEc/LevHMNdl6eP1TY2Ahv9JTdlAuCyhFW148O5xzJ4abv8ooL60/rPjaoUnxkKttLZ+kB6Y+tFqye82QEUHFZcDjZPOC/6K3KOwwFKsZSnRDZHWdA3VHRQApQgL7NZm5T+PgW+tcMWLWJs3n0IKbf+2dFYjVwwiitijDHhMIdzuOUyxuP8xq+Wr1XYTQe69uUnTHUMJr4Vb9Pqw7OEzx2WQEEl7FyzL2gITDAlB94MbuCsTMkiWqDtxUyXDe8XfoKwgkg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OQg5vbAIWy9Ta1SoU+xCT8onvT5JV4Wkujpw2FrHkAlVwRLvZFY+dHkEP02iZHoa9FbBFMfOJUHWOoWEoXdPXoc9PD+aONELk2rlU84semjdb1/2/7Y7u+O5GDCmjv+ZAdhz6UG0cmecNULuR3XYN6iCuoP5XluGK82ZUCcYG3Gy56RrenQ+biBZbPB4F+Lh9qXcFN0ngey4EcGHp4lbQrFGQaF8InBBi6YPg0GrTO3uqF2QaD8HXGUMdvfS0EdJ76uI5CYxRIno5oxi5z4wh0EuQAZdBcbuYy7gNuoFd0Y3DwMJD0Dtdb23Ihu4bbcubEISPLqPIiLsD1RzVNsKhw==
  • 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, 09 Feb 2026 18:12:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06/02/2026 3:53 pm, Abdelkareem@xxxxxxxxx wrote:
> Abdelkareem Abdelsaamad (3):
>   svm/vnmi: introduce the vnmi bit support in the cpuid feature set
>   svm/vnmi: add the definitions for the svm vnmi management bits in the
>     VMCB
>   svm/vnmi: Add support for the SVM Virtual NMI
>
>  xen/arch/x86/hvm/hvm.c             | 29 +++++++++++++++++++++--------
>  xen/arch/x86/hvm/svm/intr.c        | 16 ++++++++++++++--
>  xen/arch/x86/hvm/svm/svm.c         | 25 ++++++++++++++++++++++++-
>  xen/arch/x86/hvm/svm/vmcb.c        |  3 +++
>  xen/arch/x86/hvm/svm/vmcb.h        | 12 ++++++++----
>  xen/arch/x86/include/asm/hvm/hvm.h | 12 +++++++++++-
>  xen/arch/x86/include/asm/hvm/svm.h |  2 ++
>  7 files changed, 83 insertions(+), 16 deletions(-)

Patches 1 and 2 want merging.  They're both enumerations and
configuration bits, although the very first hunk of patch 1 (the P())
wants delaying until the final patch; we shouldn't print out the
capability until it's being used.

The patch subjects want to be:

    x86/svm: Enumerations for virtual NMI
and
    x86/svm: Use virtual NMI when available


Everything here is local to SVM.  Notably there should be no edits to
hvm.c or hvm.h.  By introducing hvm_intblk_vnmi, you break NMI injection
in other cases.  vNMI is just a hardware-optimised way of handling the
hvm_intblk_nmi_iret case.



svm_inject_nmi() wants to gain a check to see whether vNMI is enabled,
and in the case that it is, simply set vnmi_pending.  You have this
partially, but it needs to be dependent on the VMCB vNMI setting, not
some global idea of enablement.

svm_get_interrupt_shadow() needs a similar adjustment to read
vnmi_blocked rather than unconditionally depending on INTERCEPT_IRET.

In construct_vmcb(), you need to check cpu_has_svm_vnmi.  I think this
change is simple enough to be enabled unconditionally.  (We'll need to
change this in due course, but that's going to take other infrastructure
which we don't have yet.)

I think that's everything that needs altering.


A couple of other minor notes:

In the vintr_t union, use an anonymous 3 bit field (literally "u64 :3;",
which is valid syntax) instead of renumbering the rsvd$N fields.  That
will shrink the diff.

Xen's style has spaces inside the outermost brackets for control
structures, and {'s on new lines.  For the functions you're modifying,
just copy the surrounding style.

~Andrew



 


Rackspace

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