[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp
From: |
Gleb Natapov |
Subject: |
[Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp |
Date: |
Thu, 4 Mar 2010 08:47:23 +0200 |
On Thu, Mar 04, 2010 at 12:34:22AM +0100, Jan Kiszka wrote:
> Gleb Natapov wrote:
> > On Mon, Mar 01, 2010 at 06:17:22PM +0100, Jan Kiszka wrote:
> >> As we hard-wire the BSP to CPU 0 anyway and cpuid_apic_id equals
> >> cpu_index, cpu_is_bsp can also be based on the latter directly. This
> >> will help an early user of it: KVM while initializing mp_state.
> >>
> >> Signed-off-by: Jan Kiszka <address@hidden>
> >> ---
> >> hw/pc.c | 3 ++-
> >> 1 files changed, 2 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/hw/pc.c b/hw/pc.c
> >> index b90a79e..58c32ea 100644
> >> --- a/hw/pc.c
> >> +++ b/hw/pc.c
> >> @@ -767,7 +767,8 @@ static void pc_init_ne2k_isa(NICInfo *nd)
> >>
> >> int cpu_is_bsp(CPUState *env)
> >> {
> >> - return env->cpuid_apic_id == 0;
> >> + /* We hard-wire the BSP to the first CPU. */
> >> + return env->cpu_index == 0;
> >> }
> > We should not assume that. The function was written like that
> > specifically so the code around it will not rely on this assumption.
> > Now you change that specifically to write code that will do incorrect
> > assumptions. I don't see the logic here.
>
> The logic is that we do not support any other mapping yet - with or
> without this change. Without it, we complicate the APIC initialization
> for (so far) no good reason. Once we want to support different BSP
> assignments, we need to go through the code and rework some parts anyway.
>
As far as I remember the only part that was missing was a command line to
specify apic IDs for each CPU and what CPU is BSP. The code was ready
otherwise. I's very sad if this was broken by other modifications. But
changes like that actually pushes us back from our goal. Why not rework
code so it will work with correct cpu_is_bsp() function instead of
introducing this hack?
--
Gleb.
- [Qemu-devel] [PATCH v4 04/10] qemu-kvm: Clean up mpstate synchronization, (continued)
- [Qemu-devel] [PATCH v4 04/10] qemu-kvm: Clean up mpstate synchronization, Jan Kiszka, 2010/03/01
- [Qemu-devel] [PATCH v4 08/10] qemu-kvm: Clean up KVM's APIC hooks, Jan Kiszka, 2010/03/01
- [Qemu-devel] [PATCH v4 02/10] qemu-kvm: Rework VCPU state writeback API, Jan Kiszka, 2010/03/01
- [Qemu-devel] [PATCH v4 06/10] qemu-kvm: Use VCPU event state for reset and vmsave/load, Jan Kiszka, 2010/03/01
- [Qemu-devel] [PATCH v4 01/10] qemu-kvm: Add KVM_CAP_X86_ROBUST_SINGLESTEP-awareness, Jan Kiszka, 2010/03/01
- [Qemu-devel] [PATCH v4 07/10] qemu-kvm: Cleanup/fix TSC and PV clock writeback, Jan Kiszka, 2010/03/01
- [Qemu-devel] [PATCH v4 10/10] qemu-kvm: Bring qemu_init_vcpu back home, Jan Kiszka, 2010/03/01
- [Qemu-devel] [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Jan Kiszka, 2010/03/01
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Gleb Natapov, 2010/03/03
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Jan Kiszka, 2010/03/03
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp,
Gleb Natapov <=
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Jan Kiszka, 2010/03/04
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Gleb Natapov, 2010/03/04
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Jan Kiszka, 2010/03/04
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Gleb Natapov, 2010/03/04
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Gleb Natapov, 2010/03/07
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Jan Kiszka, 2010/03/07
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Jan Kiszka, 2010/03/07
- [Qemu-devel] Re: [PATCH v4 03/10] x86: Extend validity of cpu_is_bsp, Gleb Natapov, 2010/03/07
[Qemu-devel] Re: [PATCH v4 00/10] qemu-kvm: Hook cleanups and yet more use of upstream code, Jan Kiszka, 2010/03/01
[Qemu-devel] Re: [PATCH v4 00/10] qemu-kvm: Hook cleanups and yet more use of upstream code, Marcelo Tosatti, 2010/03/01