KVM: only sync when attention bits set
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 24 Jun 2012 16:24:54 +0000 (19:24 +0300)
committerAvi Kivity <avi@redhat.com>
Mon, 25 Jun 2012 09:40:40 +0000 (12:40 +0300)
Commit eb0dc6d0368072236dcd086d7fdc17fd3c4574d4 introduced apic
attention bitmask but kvm still syncs lapic unconditionally.
As that commit suggested and in anticipation of adding more attention
bits, only sync lapic if(apic_attention).

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/x86.c

index 6ed5983f78ffb38bd83fee20b2d9b8066dc24aa8..c1f870690a641455e66b922ddd97f56478ded0e1 100644 (file)
@@ -5388,7 +5388,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
        if (unlikely(vcpu->arch.tsc_always_catchup))
                kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
 
-       kvm_lapic_sync_from_vapic(vcpu);
+       if (vcpu->arch.apic_attention)
+               kvm_lapic_sync_from_vapic(vcpu);
 
        r = kvm_x86_ops->handle_exit(vcpu);
 out: