stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: SVM: fix NMI window after iret
@ 2014-01-17 19:52 Radim Krčmář
  2014-01-17 20:18 ` Greg KH
  2014-02-18  9:18 ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Radim Krčmář @ 2014-01-17 19:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: kvm, joro, pbonzini, stable

We should open NMI window right after an iret, but SVM exits before it.
We wanted to single step using the trap flag and then open it.
(or we could emulate the iret instead)
We don't do it since commit 3842d135ff2 (likely), because the iret exit
handler does not request an event, so NMI window remains closed until
the next exit.

Fix this by making KVM_REQ_EVENT request in the iret handler.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 (btw. kvm-unit-tests weren't executed on SVM since Nov 2010, at least)

 arch/x86/kvm/svm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index c7168a5..b5a735b 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -2829,6 +2829,7 @@ static int iret_interception(struct vcpu_svm *svm)
 	clr_intercept(svm, INTERCEPT_IRET);
 	svm->vcpu.arch.hflags |= HF_IRET_MASK;
 	svm->nmi_iret_rip = kvm_rip_read(&svm->vcpu);
+	kvm_make_request(KVM_REQ_EVENT, &svm->vcpu);
 	return 1;
 }
 
-- 
1.8.5.2


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

* Re: [PATCH] KVM: SVM: fix NMI window after iret
  2014-01-17 19:52 [PATCH] KVM: SVM: fix NMI window after iret Radim Krčmář
@ 2014-01-17 20:18 ` Greg KH
  2014-01-17 20:29   ` Radim Krčmář
  2014-02-18  9:18 ` Paolo Bonzini
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2014-01-17 20:18 UTC (permalink / raw)
  To: Radim Krčmář; +Cc: linux-kernel, kvm, joro, pbonzini, stable

On Fri, Jan 17, 2014 at 08:52:42PM +0100, Radim Krčmář wrote:
> We should open NMI window right after an iret, but SVM exits before it.
> We wanted to single step using the trap flag and then open it.
> (or we could emulate the iret instead)
> We don't do it since commit 3842d135ff2 (likely), because the iret exit
> handler does not request an event, so NMI window remains closed until
> the next exit.
> 
> Fix this by making KVM_REQ_EVENT request in the iret handler.
> 
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
>  (btw. kvm-unit-tests weren't executed on SVM since Nov 2010, at least)
> 
>  arch/x86/kvm/svm.c | 1 +
>  1 file changed, 1 insertion(+)


<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

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

* Re: [PATCH] KVM: SVM: fix NMI window after iret
  2014-01-17 20:18 ` Greg KH
@ 2014-01-17 20:29   ` Radim Krčmář
  0 siblings, 0 replies; 4+ messages in thread
From: Radim Krčmář @ 2014-01-17 20:29 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, kvm, joro, pbonzini, stable

2014-01-17 12:18-0800, Greg KH:
> On Fri, Jan 17, 2014 at 08:52:42PM +0100, Radim Krčmář wrote:
> > We should open NMI window right after an iret, but SVM exits before it.
> > We wanted to single step using the trap flag and then open it.
> > (or we could emulate the iret instead)
> > We don't do it since commit 3842d135ff2 (likely), because the iret exit
> > handler does not request an event, so NMI window remains closed until
> > the next exit.
> > 
> > Fix this by making KVM_REQ_EVENT request in the iret handler.
> > 
> > Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> > ---
> >  (btw. kvm-unit-tests weren't executed on SVM since Nov 2010, at least)
> > 
> >  arch/x86/kvm/svm.c | 1 +
> >  1 file changed, 1 insertion(+)
> 
> 
> <formletter>
> 
> This is not the correct way to submit patches for inclusion in the
> stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
> for how to do this properly.
> 
> </formletter>

Welp, at the last second, I decided it is not that critical to have it
in stable and forgot to clean the git-send-email command line too.

Please ignore this patch in stable.

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

* Re: [PATCH] KVM: SVM: fix NMI window after iret
  2014-01-17 19:52 [PATCH] KVM: SVM: fix NMI window after iret Radim Krčmář
  2014-01-17 20:18 ` Greg KH
@ 2014-02-18  9:18 ` Paolo Bonzini
  1 sibling, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2014-02-18  9:18 UTC (permalink / raw)
  To: Radim Krčmář, linux-kernel; +Cc: kvm, joro, stable

Il 17/01/2014 20:52, Radim Krčmář ha scritto:
> We should open NMI window right after an iret, but SVM exits before it.
> We wanted to single step using the trap flag and then open it.
> (or we could emulate the iret instead)
> We don't do it since commit 3842d135ff2 (likely), because the iret exit
> handler does not request an event, so NMI window remains closed until
> the next exit.
>
> Fix this by making KVM_REQ_EVENT request in the iret handler.
>
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
>  (btw. kvm-unit-tests weren't executed on SVM since Nov 2010, at least)
>
>  arch/x86/kvm/svm.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index c7168a5..b5a735b 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -2829,6 +2829,7 @@ static int iret_interception(struct vcpu_svm *svm)
>  	clr_intercept(svm, INTERCEPT_IRET);
>  	svm->vcpu.arch.hflags |= HF_IRET_MASK;
>  	svm->nmi_iret_rip = kvm_rip_read(&svm->vcpu);
> +	kvm_make_request(KVM_REQ_EVENT, &svm->vcpu);
>  	return 1;
>  }
>
>

Applying to kvm/queue, thanks.

Paolo

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

end of thread, other threads:[~2014-02-18  9:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-17 19:52 [PATCH] KVM: SVM: fix NMI window after iret Radim Krčmář
2014-01-17 20:18 ` Greg KH
2014-01-17 20:29   ` Radim Krčmář
2014-02-18  9:18 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).