linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
	linuxppc64-dev <linuxppc64-dev@ozlabs.org>
Subject: Re: [PATCH] powerpc: Better machine descriptions and kill magic numbers
Date: Sat, 14 Jan 2006 18:42:22 -0600	[thread overview]
Message-ID: <20060115004221.GU2491@pb15.lixom.net> (raw)
In-Reply-To: <1137272686.4855.17.camel@localhost.localdomain>

On Sun, Jan 15, 2006 at 08:04:46AM +1100, Benjamin Herrenschmidt wrote:
> 
> > Because of this, I suggest keeping the mach_ part in the syntax, i.e,
> > to use:
> > 
> > machine_is(mach_powermac) instead, and not do preprocessor mangling of
> > the label name. The same would go for define_machine().
> > 
> > It would seem to make some sense to keep the platform types looking
> > like defines (i.e. MACH_POWERMAC instead of mach_powermac) to keep it
> > consistent with the CPU and firmware feature testing, but the way it's
> > implemented that doesn't make much sense. That's a bit of a shame.
> 
> I'm not sure about these ... I'm definitely not fan of going uppercase (and
> it makes no sense vs. the implementation as it's not macros). I also don't

Yeah, that's what I meant with doesn't make sense in this case. I was
just thinking out loud.

> get your problem with grep... the "mach_" construct is totally invisible,
> so people wouldn't grep for it, but for "powermac" alone.
> 
> Or do you mean a grep on "powermac" might return too many things unrelated ?
> 
> It should be easy enough in this case to grep for machine_is(powermac) instead
> then, after all, that's the only possible use...

One drawback is that source navigation tools like tags and cscope probably
won't find it, and the base strings are quite generic (powermac, cbe/cell,
etc). A stringbased grep will, sure.

> > In the probe loop, ppc_md is copied over for each probe, that seems
> > wasteful. 
> 
> I changed that from the old way indeed to allow the probe() function to
> override things in ppc_md.
> 
> > Shouldn't the probe routines use and modify their own
> > machdep_calls instead of ppc_md, so the copying can be done only once,
> > after a match is found?
> 
> I don't like modifying their own machdep calls because the name of the
> structure is hidden. In general, I prefer that things continue to only
> access ppc_md. and not their own machine structure that goes away. That
> means that the code "patching" it can be moved away etc... without
> special case instead of having a special case in probe() that has to
> reference the machine specific copy...

Ok.

> I doubt the memcpy per machine at boot will cause any kind of
> significant performance issue ...

Yeah, that's why I said it seemed wasteful, not that it'd be a
performance issue.

      reply	other threads:[~2006-01-15  0:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-14  5:45 [PATCH] powerpc: Better machine descriptions and kill magic numbers Benjamin Herrenschmidt
2006-01-14 18:40 ` Olof Johansson
2006-01-14 21:04   ` Benjamin Herrenschmidt
2006-01-15  0:42     ` Olof Johansson [this message]

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=20060115004221.GU2491@pb15.lixom.net \
    --to=olof@lixom.net \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=linuxppc64-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).