diff mbox series

KVM: x86/emulator: Fix handing of POP SS to correctly set interruptibility

Message ID 20220821215900.1419215-1-mhal@rbox.co (mailing list archive)
State New, archived
Headers show
Series KVM: x86/emulator: Fix handing of POP SS to correctly set interruptibility | expand

Commit Message

Michal Luczaj Aug. 21, 2022, 9:59 p.m. UTC
The emulator checks the wrong variable while setting the CPU
interruptibility state.  Fix the condition.

Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
I'll follow up with a testcase.

 arch/x86/kvm/emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sean Christopherson Aug. 24, 2022, 12:20 a.m. UTC | #1
On Sun, Aug 21, 2022, Michal Luczaj wrote:
> The emulator checks the wrong variable while setting the CPU
> interruptibility state.  Fix the condition.
> 
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
> ---

  Fixes: a5457e7bcf9a ("KVM: emulate: POP SS triggers a MOV SS shadow too")

and probably 

  Cc: stable@vger.kernel.org

even though I'd be amazed if this actually fixes anyone's workloads :-)

Reviewed-by: Sean Christopherson <seanjc@google.com>


Paolo, do you want to grab this for 6.0, or should I throw it in the queue for 6.1?
Paolo Bonzini Aug. 24, 2022, 5:19 p.m. UTC | #2
On 8/24/22 02:20, Sean Christopherson wrote:
>    Fixes: a5457e7bcf9a ("KVM: emulate: POP SS triggers a MOV SS shadow too")
> 
> and probably
> 
>    Cc:stable@vger.kernel.org
> 
> even though I'd be amazed if this actually fixes anyone's workloads:-)
> 
> Reviewed-by: Sean Christopherson<seanjc@google.com>
> 
> 
> Paolo, do you want to grab this for 6.0, or should I throw it in the queue for 6.1?

Go ahead for 6.1.

Paolo
Sean Christopherson Aug. 30, 2022, 9:41 p.m. UTC | #3
On Sun, Aug 21, 2022, Michal Luczaj wrote:
> The emulator checks the wrong variable while setting the CPU
> interruptibility state.  Fix the condition.
> 
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
> ---

Pushed to branch `for_paolo/6.1` at:

    https://github.com/sean-jc/linux.git

Unless you hear otherwise, it will make its way to kvm/queue "soon".

Note, the commit IDs are not guaranteed to be stable.
diff mbox series

Patch

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b4eeb7c75dfa..5cfd07f483b3 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1967,7 +1967,7 @@  static int em_pop_sreg(struct x86_emulate_ctxt *ctxt)
 	if (rc != X86EMUL_CONTINUE)
 		return rc;
 
-	if (ctxt->modrm_reg == VCPU_SREG_SS)
+	if (seg == VCPU_SREG_SS)
 		ctxt->interruptibility = KVM_X86_SHADOW_INT_MOV_SS;
 	if (ctxt->op_bytes > 2)
 		rsp_increment(ctxt, ctxt->op_bytes - 2);