KVM: VMX: remove GUEST_CR3 write from vmx_vcpu_run
GUEST_CR3 is updated via kvm_set_cr3 whenever CR3 value changes.
arch/x86/kvm/vmx.c +2 -3
@@ -3638,10 +3638,9 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) {struct vcpu_vmx *vmx =to_vmx (vcpu); -if (enable_ept &&is_paging (vcpu)) { -vmcs_writel (GUEST_CR3 , vcpu->arch.cr3); +if (enable_ept &&is_paging (vcpu))ept_load_pdptrs (vcpu); - } +/* Record the guest's net vcpu time for enforced NMI injections. */ if (unlikely (!cpu_has_virtual_nmis () && vmx->soft_vnmi_blocked)) vmx->entry_time =ktime_get ();
Quoted 11 lines · Marcelo Tosatti
GUEST_CR3is updated viakvm_set_cr3whenever CR3 value changes.arch/x86/kvm/vmx.c +0
-0@@ -3638,10 +3638,9 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) {struct vcpu_vmx *vmx =to_vmx (vcpu);
arch/x86/kvm/vmx.c static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · line 3646
Quoted 10 lines
arch/x86/kvm/vmx.c +2
-3-if (enable_ept&&is_paging (vcpu)) { -vmcs_writel (GUEST_CR3 , vcpu->arch.cr3); +if (enable_ept&&is_paging (vcpu))ept_load_pdptrs (vcpu); - } +/* Record the guest's net vcpu time for enforced NMI injections. */ if (unlikely (!cpu_has_virtual_nmis ()&& vmx->soft_vnmi_blocked)) vmx->entry_time =ktime_get ();
Nice. Any reason why ept_load_pdptrs() couldn't go the same way?
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.
Quoted 12 lines · Avi Kivity
Quoted 11 lines · Marcelo Tosatti
GUEST_CR3is updated viakvm_set_cr3whenever CR3 value changes.arch/x86/kvm/vmx.c +0
-0@@ -3638,10 +3638,9 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) {struct vcpu_vmx *vmx =to_vmx (vcpu);
Quoted 12 lines
arch/x86/kvm/vmx.c static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · line 3646
Quoted 10 lines
arch/x86/kvm/vmx.c +2
-3-if (enable_ept&&is_paging (vcpu)) { -vmcs_writel (GUEST_CR3 , vcpu->arch.cr3); +if (enable_ept&&is_paging (vcpu))ept_load_pdptrs (vcpu); - } +/* Record the guest's net vcpu time for enforced NMI injections. */ if (unlikely (!cpu_has_virtual_nmis ()&& vmx->soft_vnmi_blocked)) vmx->entry_time =ktime_get ();Nice. Any reason why
ept_load_pdptrs()couldn't go the same way?
Its already protected by VCPU_EXREG_PDPTR caching, so it does not buy much.
The advantage would symmetry to cr3.
Quoted 10 lines · Marcelo Tosatti
Quoted 4 lines
Nice. Any reason why
ept_load_pdptrs()couldn't go the same way?Its already protected by
VCPU_EXREG_PDPTRcaching, so it does not buy much.The advantage would symmetry to cr3.
Yes, the PDPTRs fulfil exactly the same role as cr3, so the same rules should apply.
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.
Quoted 2 lines · On Tuesday 20 October 2009 20:37:20 Marcelo Tosatti wrote:
GUEST_CR3is updated viakvm_set_cr3whenever CR3 value changes.
The description is not that accuracy... If CR3 value change in guest when EPT enabled, no VM Exit would happen, then no kvm_set_cr3...
Signature · 2 lines
regards Yang, Sheng
Quoted 24 lines
Signed-off-by Marcelo Tosatti <[email protected]>arch/x86/kvm/vmx.c +2
-4@@ -3638,10 +3638,9 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) {struct vcpu_vmx *vmx =to_vmx (vcpu); -if (enable_ept &&is_paging (vcpu)) { -vmcs_writel (GUEST_CR3 , vcpu->arch.cr3); +if (enable_ept &&is_paging (vcpu))ept_load_pdptrs (vcpu); - } +/* Record the guest's net vcpu time for enforced NMI injections. */ if (unlikely (!cpu_has_virtual_nmis () && vmx->soft_vnmi_blocked)) vmx->entry_time =ktime_get (); --To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Sheng Yang
Quoted 3 lines · On Tuesday 20 October 2009 20:37:20 Marcelo Tosatti wrote:
GUEST_CR3is updated viakvm_set_cr3whenever CR3 value changes.The description is not that accuracy... If CR3 value change in guest when EPT enabled, no VM Exit would happen, then no
kvm_set_cr3...
True, should be 'changed from userspace'.
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.