public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: SVM: Virtual GIF
@ 2017-08-16 15:54 Janakarajan Natarajan
  2017-08-16 15:54 ` [PATCH 1/2] KVM: SVM: Add Virtual GIF feature definition Janakarajan Natarajan
  2017-08-16 15:54 ` [PATCH 2/2] KVM: SVM: Enable Virtual GIF feature Janakarajan Natarajan
  0 siblings, 2 replies; 8+ messages in thread
From: Janakarajan Natarajan @ 2017-08-16 15:54 UTC (permalink / raw)
  To: kvm, x86, linux-kernel
  Cc: Paolo Bonzini, Radim Krcmar, Joerg Roedel, Andy Lutomirski,
	Tony Luck, Borislav Petkov, Thomas Gleixner, Ingo Molnar,
	H . Peter Anvin, Yazen Ghannam, Janakarajan Natarajan

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 clear 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.

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                 | 47 ++++++++++++++++++++++++++++++++------
 3 files changed, 47 insertions(+), 7 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-08-17 20:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16 15:54 [PATCH 0/2] KVM: SVM: Virtual GIF Janakarajan Natarajan
2017-08-16 15:54 ` [PATCH 1/2] KVM: SVM: Add Virtual GIF feature definition Janakarajan Natarajan
2017-08-16 17:36   ` Borislav Petkov
2017-08-17 20:13     ` Natarajan, Janakarajan
2017-08-16 15:54 ` [PATCH 2/2] KVM: SVM: Enable Virtual GIF feature Janakarajan Natarajan
2017-08-16 19:53   ` Radim Krcmar
2017-08-16 22:04     ` Natarajan, Janakarajan
2017-08-16 22:07       ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox