Subject: Re: [PATCH] enable RTAS /proc for PowerPC/CHRP platform

From: Sven Luther <[email-masked]>
Date: Fri, 20 Oct 2006 08:24:31 +0200

On Fri, Oct 20, 2006 at 03:56:37PM +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2006-10-20 at 07:44 +0200, Olaf Hering wrote:
> > On Fri, Oct 20, Benjamin Herrenschmidt wrote:
> > 
> > > On Thu, 2006-10-19 at 09:03 +0200, Olaf Hering wrote:
> > > > On Thu, Oct 19, Benjamin Herrenschmidt wrote:
> > > > 
> > > > > On Wed, 2006-10-18 at 09:38 +0200, Olaf Hering wrote:
> > > > > > On Wed, Oct 18, Michael Ellerman wrote:
> > > > > > 
> > > > > > > But it's called '/proc/ppc64' right now on lots of machines, so you
> > > > > > > can't go changing it.
> > > > > > 
> > > > > > if test -d /proc/ppc64 .. is a quick way to check wether the system is
> > > > > > 64bit or not. Similar to if test -d /proc/iSeries ..
> > > > > 
> > > > > That's really ugly ! You really do that ? Gack...
> > > > 
> > > > What way should I use?
> > > 
> > > uname ? /proc/cpuinfo ? Whatever but not that.
> > 
> > uname can be faked with powerpc32 or setarch. grep POWER /proc/cpuinfo
> > might be an option. I think its only used in rpm preinstall scripts to
> > reject 64bit kernel on 32bit systems or the other way around.
> 
> grep POWER won't do good on 970 among others.
> 
> uname can be faked but why do you care ?
> 
> In fact, is somebody is faking it, maybe it's because they -want- your
> scripts to think they are running on a 32 bits box....
> 
> I still think uname is the way to go.
>  

Ben, would it make sense to add two informations to /proc/cpuinfo ?
It would be great to have a field there which will allow to check for the
kernel flavour to run, namely if the kernel/processor/whatever is running in
32bit or 64bit mode. The second field would be a generalized machine field,
or plateform or whatever, which would easily allow to differentiate between an
apple machine, a ibm chrp, a pegasos or other genesi product, etc. Without
necessarily having to maintain a huge amount of userlanf mappings from all
those different machine: fields, which all have CHRP, true, but no finer
grained informations, while we do have it in the kernel.

Friendly,

Sven Luther