Re: [PATCH 06/30] KVM: SVM: always update CR3 in VMCB

2020-05-29 Thread Sean Christopherson
On Fri, May 29, 2020 at 10:41:58AM -0700, Krish Sadhukhan wrote: > > On 5/29/20 8:39 AM, Paolo Bonzini wrote: > >svm_load_mmu_pgd is delaying the write of GUEST_CR3 to prepare_vmcs02 > > Did you mean to say enter_svm_guest_mode here ? Heh, looks like Vitaly passed the s/vmcs/vmcb bug on to

Re: [PATCH 06/30] KVM: SVM: always update CR3 in VMCB

2020-05-29 Thread Krish Sadhukhan
On 5/29/20 8:39 AM, Paolo Bonzini wrote: svm_load_mmu_pgd is delaying the write of GUEST_CR3 to prepare_vmcs02 Did you mean to say enter_svm_guest_mode here ? as an optimization, but this is only correct before the nested vmentry. If userspace is modifying CR3 with KVM_SET_SREGS after the

[PATCH 06/30] KVM: SVM: always update CR3 in VMCB

2020-05-29 Thread Paolo Bonzini
svm_load_mmu_pgd is delaying the write of GUEST_CR3 to prepare_vmcs02 as an optimization, but this is only correct before the nested vmentry. If userspace is modifying CR3 with KVM_SET_SREGS after the VM has already been put in guest mode, the value of CR3 will not be updated. Remove the