]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
KVM: Use pointer to vcpu instead of vcpu_id in timer code.
authorGleb Natapov <gleb@redhat.com>
Tue, 9 Jun 2009 12:56:27 +0000 (15:56 +0300)
committerAvi Kivity <avi@redhat.com>
Thu, 10 Sep 2009 05:32:52 +0000 (08:32 +0300)
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/i8254.c
arch/x86/kvm/kvm_timer.h
arch/x86/kvm/lapic.c
arch/x86/kvm/timer.c

index 008a83185067f83387148200b610ad001c5523d7..06d8f84ae8a2ff16756a6b4f17f950a54782f15a 100644 (file)
@@ -294,7 +294,7 @@ static void create_pit_timer(struct kvm_kpit_state *ps, u32 val, int is_period)
        pt->timer.function = kvm_timer_fn;
        pt->t_ops = &kpit_ops;
        pt->kvm = ps->pit->kvm;
-       pt->vcpu_id = 0;
+       pt->vcpu = pt->kvm->bsp_vcpu;
 
        atomic_set(&pt->pending, 0);
        ps->irq_ack = 1;
index 26bd6ba74e1cf0b8523456513f776cb8417d9f3b..55c7524dda549579bafdbf6089072ef6f8f5c14f 100644 (file)
@@ -6,7 +6,7 @@ struct kvm_timer {
        bool reinject;
        struct kvm_timer_ops *t_ops;
        struct kvm *kvm;
-       int vcpu_id;
+       struct kvm_vcpu *vcpu;
 };
 
 struct kvm_timer_ops {
index b0661300eb28ec456410410130c18d14d90e9085..b1694dc45729ed49094ca7807b7792114da630f7 100644 (file)
@@ -950,7 +950,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu)
        apic->lapic_timer.timer.function = kvm_timer_fn;
        apic->lapic_timer.t_ops = &lapic_timer_ops;
        apic->lapic_timer.kvm = vcpu->kvm;
-       apic->lapic_timer.vcpu_id = vcpu->vcpu_id;
+       apic->lapic_timer.vcpu = vcpu;
 
        apic->base_address = APIC_DEFAULT_PHYS_BASE;
        vcpu->arch.apic_base = APIC_DEFAULT_PHYS_BASE;
index 86dbac072d0c82eba8d9fc1dfa4ad8800f42548a..85cc743a8203921bf17c70942f50cff0bbbc6edd 100644 (file)
@@ -33,7 +33,7 @@ enum hrtimer_restart kvm_timer_fn(struct hrtimer *data)
        struct kvm_vcpu *vcpu;
        struct kvm_timer *ktimer = container_of(data, struct kvm_timer, timer);
 
-       vcpu = ktimer->kvm->vcpus[ktimer->vcpu_id];
+       vcpu = ktimer->vcpu;
        if (!vcpu)
                return HRTIMER_NORESTART;