Skip to content

KVM: SVM: Virtual GIF

Janakarajan Natarajan kvm lkml 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesApplied
  2. v12 patches 5 repliesSuperseded

Changes in v2 from the cover letter

* Updated patch description and changed cpufeature definition to be similar to AMD documentation.

* Updated NMI logic. STGI intercept added to assit in opening NMI window. Suggested by Radim.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: SVM: Add Virtual GIF feature definitionarch/x86/include/asm/cpufeatures.h+1 -01 reply
2/2KVM: SVM: Enable Virtual GIF featurearch/x86/include/asm/svm.h arch/x86/kvm/svm.c+61 -70 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchBorislav Petkov
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] KVM: SVM: Virtual GIF

This patchset adds support for the Virtual GIF (vGIF) feature. This feature allows the STGI and CLGI instructions to be executed in the Guest Mode and not require a #VMEXIT. With this, virtual interrupts can be controlled in the Guest Mode while still allowing physical interrupts to be intercepted by the hypervisor.

In order to provide this ability, two new bits are added to the VMCB at offset 60h:

* Bit 9 - VGIF value

	 : 0 -> Virtual interrupts are masked
	 : 1 -> Virtual interrupts are unmasked

* Bit 25 - AMD Virtual GIF enabled for this guest

	 : 0 -> Disabled
	 : 1 -> Enabled

When a VMRUN is executed and Bit 25 is set, the processor uses Bit 9 as the starting value of the virtual GIF. It then provides masking capability for when virtual interrupts are taken. Bit 9 is writeable by the hypervisor and loaded on VMRUN and saved on #VMEXIT. STGI/CLGI executed in the Guest Mode sets or clears the virtual GIF.

The advantage of this feature will be the greatly reduced number of world switches to support the STGI and CLGI instructions by the outermost hypervisor at Current Privilege Level (CPL) 0.

This has been tested with Xen, Hyper-V and KVM as the nested hypervisor.

v1->v2:

* Updated patch description and changed cpufeature definition to be similar to AMD documentation.

* Updated NMI logic. STGI intercept added to assit in opening NMI window. Suggested by Radim.

Janakarajan Natarajan (2):
KVM: SVM: Add Virtual GIF feature definition
KVM: SVM: Enable Virtual GIF feature

 arch/x86/include/asm/cpufeatures.h |  1 +
 arch/x86/include/asm/svm.h         |  6 ++++
 arch/x86/kvm/svm.c                 | 62 +++++++++++++++++++++++++++++++++-----
 3 files changed, 62 insertions(+), 7 deletions(-)
Signature · 1 line
2.7.4