All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: nEPT: reset PDPTR register cache on nested vmentry emulation
@ 2013-09-02 12:25 Gleb Natapov
  2013-09-12 16:33 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Gleb Natapov @ 2013-09-02 12:25 UTC (permalink / raw)
  To: kvm; +Cc: chao.zhou, pbonzini

After nested vmentry stale cache can be used to reload L2 PDPTR pointers
which will cause L2 guest to fail. Fix it by invalidating cache on nested
vmentry emulation.

https://bugzilla.kernel.org/show_bug.cgi?id=60830

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 57b4e12..6f69aac 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7765,6 +7765,10 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
 		vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1);
 		vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2);
 		vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3);
+		__clear_bit(VCPU_EXREG_PDPTR,
+				(unsigned long *)&vcpu->arch.regs_avail);
+		__clear_bit(VCPU_EXREG_PDPTR,
+				(unsigned long *)&vcpu->arch.regs_dirty);
 	}
 
 	kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp);
--
			Gleb.

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

* Re: [PATCH] KVM: nEPT: reset PDPTR register cache on nested vmentry emulation
  2013-09-02 12:25 [PATCH] KVM: nEPT: reset PDPTR register cache on nested vmentry emulation Gleb Natapov
@ 2013-09-12 16:33 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2013-09-12 16:33 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: kvm, chao.zhou

Il 02/09/2013 14:25, Gleb Natapov ha scritto:
> After nested vmentry stale cache can be used to reload L2 PDPTR pointers
> which will cause L2 guest to fail. Fix it by invalidating cache on nested
> vmentry emulation.
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=60830
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 57b4e12..6f69aac 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -7765,6 +7765,10 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
>  		vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1);
>  		vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2);
>  		vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3);
> +		__clear_bit(VCPU_EXREG_PDPTR,
> +				(unsigned long *)&vcpu->arch.regs_avail);
> +		__clear_bit(VCPU_EXREG_PDPTR,
> +				(unsigned long *)&vcpu->arch.regs_dirty);
>  	}
>  
>  	kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp);
> --
> 			Gleb.
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Applied to kvm/queue for 3.12, thanks.

Paolo

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

end of thread, other threads:[~2013-09-12 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-02 12:25 [PATCH] KVM: nEPT: reset PDPTR register cache on nested vmentry emulation Gleb Natapov
2013-09-12 16:33 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.