From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932448AbdHWQh6 (ORCPT ); Wed, 23 Aug 2017 12:37:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35698 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932243AbdHWQh4 (ORCPT ); Wed, 23 Aug 2017 12:37:56 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 08BC78125F Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com Subject: Re: [PATCH v2 0/2] KVM: SVM: Virtual GIF To: Janakarajan Natarajan , kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Radim Krcmar , Joerg Roedel , Andy Lutomirski , Tony Luck , Piotr Luc , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Yazen Ghannam References: From: Paolo Bonzini Message-ID: <0db8738e-9f33-1157-e1a8-861d6b5e178f@redhat.com> Date: Wed, 23 Aug 2017 18:37:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 23 Aug 2017 16:37:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/08/2017 16:57, Janakarajan Natarajan wrote: > 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. Applied, thanks. Paolo > 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(-) >