[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1173916541.19022.47.camel@localhost.localdomain>
Date: Thu, 15 Mar 2007 10:55:41 +1100
From: Rusty Russell <rusty@...tcorp.com.au>
To: Jeremy Fitzhardinge <jeremy@...p.org>
Cc: lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>,
Zachary Amsden <zach@...are.com>,
Jeremy Fitzhardinge <jeremy@...source.com>,
Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Andi Kleen <ak@...e.de>
Subject: Re: [PATCH 0/8] x86 boot, pda and gdt cleanups
On Tue, 2007-03-13 at 13:48 -0700, Jeremy Fitzhardinge wrote:
> * init_gdt should always use write_gdt_entry when touching the gdt;
> if it doesn't and it ends up touching an already-installed gdt
> under Xen, it will get a write fault. This happens because
> init_gdt ends up getting called twice in SMP (see below).
Hmm, this invalidated my assumption that write_gdt_entry is always a
write to this cpu's active gdt. Better fix is not to call it twice
anyway...
> * init_gdt should always be called before bringing up the cpu,
> rather than by the cpu itself (and therefore, cpu_init() shouldn't
> call it). Obviously the the boot cpu is an exception.
Makes sense.
> * secondary_cpu_init stops being necessary.
Indeed.
> * On SMP, init_gdt can get called twice: first time in
> smp_prepare_boot_cpu, and a second time in trap_init. On UP,
> trap_init is the only caller.
Getting rid of the call in smp_prepare_boot_cpu currently works, but
it's fragile: __get_cpu_var(x) && per_cpu(x, smp_processor_id()) will
differ, and changes made to __get_cpu_var(x) will vanish...
Fortunately, UP doesn't have to call init_gdt at all, so I think it's
better to place it in smp_prepare_boot_cpu only and then clean up the UP
code. I'll try now...
Rusty.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists