提交 f8b78fa3 编写于 作者: M Marcelo Tosatti 提交者: Avi Kivity

KVM: move slots_lock acquision down to vapic_exit

There is no need to grab slots_lock if the vapic_page will not
be touched.
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 efa67e0d
...@@ -2787,8 +2787,10 @@ static void vapic_exit(struct kvm_vcpu *vcpu) ...@@ -2787,8 +2787,10 @@ static void vapic_exit(struct kvm_vcpu *vcpu)
if (!apic || !apic->vapic_addr) if (!apic || !apic->vapic_addr)
return; return;
down_read(&vcpu->kvm->slots_lock);
kvm_release_page_dirty(apic->vapic_page); kvm_release_page_dirty(apic->vapic_page);
mark_page_dirty(vcpu->kvm, apic->vapic_addr >> PAGE_SHIFT); mark_page_dirty(vcpu->kvm, apic->vapic_addr >> PAGE_SHIFT);
up_read(&vcpu->kvm->slots_lock);
} }
static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
...@@ -2944,9 +2946,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) ...@@ -2944,9 +2946,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
post_kvm_run_save(vcpu, kvm_run); post_kvm_run_save(vcpu, kvm_run);
down_read(&vcpu->kvm->slots_lock);
vapic_exit(vcpu); vapic_exit(vcpu);
up_read(&vcpu->kvm->slots_lock);
return r; return r;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册