linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Gerhard Pircher <gerhard_pircher@gmx.net>
Cc: linuxppc-dev@ozlabs.org, Milton Miller <miltonm@bga.com>
Subject: Re: How to dynamically disable/enable CPU features?
Date: Sat, 23 Feb 2008 09:32:01 +1100	[thread overview]
Message-ID: <1203719521.6976.30.camel@pasglop> (raw)
In-Reply-To: <20080222190531.103050@gmx.net>


> The flag is in POSSIBLE. I now use this code in the platform probe
> function to nop out the code affected by the flag:
> 
> cur_cpu_spec->cpu_features &= ~CPU_FTR_NEED_COHERENT;
> /* Patch out unwanted feature. */
> do_feature_fixups(cur_cpu_spec->cpu_features,
> 		  PTRRELOC(&__start___ftr_fixup),
> 		  PTRRELOC(&__stop___ftr_fixup));
> 
> It seems to work so far, but I would like to know if this is the right
> way to do it, or if calling do_feature_fixups() more than once can have
> any side effects.

It's a bit hairy... Things -could- have been nop'ed out by the first
call as a result of CPU_FTR_NEED_COHERENT being set and the second
call will not be able to put them back in... now that may not be the
case (depends what kind of patching is done with that flag) and so
'happen' to work for this specific bit but it isn't a nice solution...

A better long term approach is to look at moving the fixup to after
the machine probe() after carefully checking whether that can cause
any problem...

Ben.

  reply	other threads:[~2008-02-22 22:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-21 20:07 How to dynamically disable/enable CPU features? Gerhard Pircher
2008-02-22 17:24 ` Milton Miller
2008-02-22 19:05   ` Gerhard Pircher
2008-02-22 22:32     ` Benjamin Herrenschmidt [this message]
2008-02-24 14:47       ` Gerhard Pircher
2008-02-22 22:26 ` Benjamin Herrenschmidt

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=1203719521.6976.30.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=gerhard_pircher@gmx.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    /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).