From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH RFC v2 2/4] Use pointer to vcpu instead of vcpu_id in timer code.
Date: Tue, 26 May 2009 11:52:10 +0300 [thread overview]
Message-ID: <20090526085210.GO3948@redhat.com> (raw)
In-Reply-To: <4A1BA89D.8090003@redhat.com>
On Tue, May 26, 2009 at 11:30:21AM +0300, Avi Kivity wrote:
> Gleb Natapov wrote:
>> Signed-off-by: Gleb Natapov <gleb@redhat.com>
>> ---
>> 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.
next prev parent reply other threads:[~2009-05-26 8:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 15:50 [PATCH RFC v2 0/4] decouple vcpu index from apic id Gleb Natapov
2009-05-25 15:50 ` [PATCH RFC v2 1/4] Introduce kvm_vcpu_is_bsp() function Gleb Natapov
2009-05-25 20:46 ` Marcelo Tosatti
2009-05-26 6:12 ` Gleb Natapov
2009-05-25 15:50 ` [PATCH RFC v2 2/4] Use pointer to vcpu instead of vcpu_id in timer code Gleb Natapov
2009-05-26 8:30 ` Avi Kivity
2009-05-26 8:52 ` Gleb Natapov [this message]
2009-05-25 15:50 ` [PATCH RFC v2 3/4] Break dependency between vcpu index in vcpus array and vcpu_id Gleb Natapov
2009-05-26 8:34 ` Avi Kivity
2009-05-26 8:55 ` Gleb Natapov
2009-05-26 8:57 ` Avi Kivity
2009-05-25 15:50 ` [PATCH RFC v2 4/4] Use macro to iterate over vcpus Gleb Natapov
2009-05-26 8:18 ` Avi Kivity
2009-05-26 8:37 ` Gleb Natapov
2009-05-26 8:56 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090526085210.GO3948@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).