public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] voyager: fix cpu bootmaps
Date: Sat, 31 Jan 2009 09:04:53 -0600	[thread overview]
Message-ID: <1233414293.3541.20.camel@localhost.localdomain> (raw)
In-Reply-To: <200901312327.50684.rusty@rustcorp.com.au>

On Sat, 2009-01-31 at 23:27 +1030, Rusty Russell wrote:
> On Saturday 31 January 2009 05:01:57 James Bottomley wrote:
> > commit 98a79d6a50181ca1ecf7400eda01d5dc1bc0dbf0
> > Author: Rusty Russell <rusty@rustcorp.com.au>
> > Date:   Sat Dec 13 21:19:41 2008 +1030
> > 
> >     cpumask: centralize cpu_online_map and cpu_possible_map
> > 
> > Broke voyager largely because it currently initialises the
> > possible_map by copying, which isn't possible in the new scheme.  Fix
> > this by using init_cpu_possible() instead and tidy up other of the
> > cpumask declarations which now have global variables.
> > 
> > Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
> > ---
> >  arch/x86/mach-voyager/voyager_smp.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
> > index 9840b7e..dcc07d5 100644
> > --- a/arch/x86/mach-voyager/voyager_smp.c
> > +++ b/arch/x86/mach-voyager/voyager_smp.c
> > @@ -378,7 +378,7 @@ void __init find_smp_config(void)
> >  	cpus_addr(phys_cpu_present_map)[0] |=
> >  	    voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
> >  				       3) << 24;
> > -	cpu_possible_map = phys_cpu_present_map;
> > +	init_cpu_possible(&phys_cpu_present_map);
> >  	printk("VOYAGER SMP: phys_cpu_present_map = 0x%lx\n",
> >  	       cpus_addr(phys_cpu_present_map)[0]);
> >  	/* Here we set up the VIC to enable SMP */
> 
> Strange, the assignment should still work, even though this new method is
> preferred.

I know, it's weird ... it's like the compiler is copying to the lvalue
but then discarding the result somehow ... with the direct assignment,
we end up with nothing in cpu_possible_bits, then the smp alternatives
switch to UP and all hell breaks loose when multiple CPUs are brought
up.

I think the problem is that cpu_possible_mask isn't an alias for
cpu_possible_bits, so when I update the former directly it breaks the
correspondence set up in kernel/cpu.c ... your declaration of it as
*const looks to be causing the compiler to do this.

Thus, I think direct assignment to cpu_possible_map (and hence
cpu_possible_mask) should be forbidden.

> How do your patches normally get upstream?  I'd normally just fwd this to
> Ingo...
> 
> Sorry I broke your platform...

That's OK ... Voyager is one of those platforms that tends to come off
worst on updates, so I'm used to sweeping up around it.

James



  reply	other threads:[~2009-01-31 15:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-30 18:31 [PATCH] voyager: fix cpu bootmaps James Bottomley
2009-01-31 12:57 ` Rusty Russell
2009-01-31 15:04   ` James Bottomley [this message]
2009-02-03 14:45     ` Rusty Russell

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=1233414293.3541.20.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    /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