All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Joel Schopp <jschopp@austin.ibm.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCHv2 2/2] Update ibm,client-architecture call field based on device tree
Date: Thu, 04 Feb 2010 14:27:45 +1100	[thread overview]
Message-ID: <1265254065.8287.147.camel@pasglop> (raw)
In-Reply-To: <4B6870DF.9030408@austin.ibm.com>

On Tue, 2010-02-02 at 12:37 -0600, Joel Schopp wrote:
> >> +		if(*cores != NR_CPUS)
> >> +			prom_printf("client-architecture structure corrupted\n");
> >> +		*cores = (NR_CPUS / prom_smt_way());
> >> +		prom_printf("setting client-architecture cores to %x\n", *cores);
> >>     
> >
> > I don't know if I'm painting a bike shed of if this is a real concern, but if
> > *cores isn't NR_CPUS shouldn't we do nothing rather then clobbering it?
> >
> > Yours Tony
> >   
> If it isn't NR_CPUS we're pretty broken if we set it or if we don't.  My 
> previous version did a BUILD_BUG_ON() but Ben didn't like that and said 
> he preferred just a warning message. 

BUILD_BUG_ON would probably not have worked unless gcc smarter than I
think it is :-) Your latest approach is bad because when you detect
you are poking at the wrong thing ... you still proceed and do it. In
fact you -are- poking at the wrong thing always since you are missing
PTRRELOC() to relocate the pointer to the vec.

I'll post a new variant of that patch.

Cheers,
Ben.

  reply	other threads:[~2010-02-04  3:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-14 20:38 [PATCH 0/2] Add max CPU nodes field to ibm,client-architecture call Joel Schopp
2010-01-14 20:40 ` [PATCH 1/2] Add static fields " Joel Schopp
2010-01-14 23:01   ` Joel Schopp
2010-01-15  2:51     ` Benjamin Herrenschmidt
2010-01-15  2:52       ` Benjamin Herrenschmidt
2010-02-01 22:50     ` [PATCHv2 " Joel Schopp
2010-01-14 20:41 ` [PATCH 2/2] Update ibm,client-architecture call field based on device tree Joel Schopp
2010-01-15  2:58   ` Benjamin Herrenschmidt
2010-02-01 22:51   ` [PATCHv2 " Joel Schopp
2010-02-02  3:48     ` Tony Breeds
2010-02-02 18:37       ` Joel Schopp
2010-02-04  3:27         ` Benjamin Herrenschmidt [this message]
2010-02-01 22:50 ` [PATCHv2 0/2] Add max CPU nodes field to ibm,client-architecture call Joel Schopp

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=1265254065.8287.147.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=jschopp@austin.ibm.com \
    --cc=linuxppc-dev@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.