public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Radim Krcmar <rkrcmar@redhat.com>
To: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
Cc: kvm@vger.kernel.org, x86@kernel.org,
	linux-kernel@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Joerg Roedel <joro@8bytes.org>, Andy Lutomirski <luto@kernel.org>,
	Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@suse.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>
Subject: Re: [PATCH 2/2] KVM: SVM: Enable Virtual GIF feature
Date: Wed, 16 Aug 2017 21:53:12 +0200	[thread overview]
Message-ID: <20170816195312.GB32542@flask> (raw)
In-Reply-To: <34f2f25e05496f4212c622ecce999dabb0bd2357.1502896608.git.Janakarajan.Natarajan@amd.com>

2017-08-16 10:54-0500, Janakarajan Natarajan:
> Enable the Virtual GIF feature. This is done by setting bit 25 at position
> 60h in the vmcb.
> 
> With this feature enabled, the processor uses bit 9 at position 60h as the
> virtual GIF when executing STGI/CLGI instructions.
> 
> Since the execution of STGI by the L1 hypervisor does not cause a return to
> the outermost (L0) hypervisor, the enable_irq_window and enable_nmi_window
> are modified.
> 
> The IRQ and NMI windows will be opened even if GIF is not set, under the
> assumption that on resuming the L1 hypervisor the IRQ and NMI will be
> held pending until the processor executes the STGI instruction.
> 
> Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
> ---
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> @@ -4702,8 +4735,8 @@ static void enable_nmi_window(struct kvm_vcpu *vcpu)
>  	    == HF_NMI_MASK)
>  		return; /* IRET will cause a vm exit */
>  
> -	if ((svm->vcpu.arch.hflags & HF_GIF_MASK) == 0)
> -		return; /* STGI will cause a vm exit */
> +	if (!vgif_enabled(svm) && !gif_set(svm))
> +		return; /* STGI will cause a vm exit or HW will set VGIF*/

Why don't we enable STGI interception to get notified that the window
has opened?  (I doubt that single stepping would be faster ...)

Thanks.

  reply	other threads:[~2017-08-16 19:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-08-16 22:04     ` Natarajan, Janakarajan
2017-08-16 22:07       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170816195312.GB32542@flask \
    --to=rkrcmar@redhat.com \
    --cc=Janakarajan.Natarajan@amd.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yazen.ghannam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox