On Tue, May 26, 2009 at 11:30:21AM +0300, Avi Kivity wrote: > Gleb Natapov wrote: >> Signed-off-by: Gleb Natapov <gleb@xxxxxxxxxx> >> --- >> arch/x86/kvm/i8254.c | 2 +- >> arch/x86/kvm/kvm_timer.h | 2 +- >> arch/x86/kvm/lapic.c | 2 +- >> arch/x86/kvm/timer.c | 2 +- >> 4 files changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c >> index bcf755f..85d95ff 100644 >> --- a/arch/x86/kvm/i8254.c >> +++ b/arch/x86/kvm/i8254.c >> @@ -291,7 +291,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; >> >> > > bsp_vcpu might not have been initialized at this time? > There is only two code path that may lead to this code. First one is from pit_ioport_write() and at this stage BSP is already executing code and thus exists. The second is during migration and vcpus are created before incoming migration is accepted. May be BUG_ON() is appropriate here. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html