public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom•net>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom•com>
Cc: linuxppc-dev@ozlabs•org
Subject: Re: [PATCH] [POWERPC] Emulate isel (Integer Select) instruction
Date: Tue, 27 Nov 2007 09:23:17 -0600	[thread overview]
Message-ID: <20071127152317.GA5230@lixom.net> (raw)
In-Reply-To: <Pine.LNX.4.62.0711271555520.5847@pademelon.sonytel.be>

On Tue, Nov 27, 2007 at 03:56:53PM +0100, Geert Uytterhoeven wrote:
> On Wed, 21 Nov 2007, Geert Uytterhoeven wrote:
> > On Tue, 20 Nov 2007, Kumar Gala wrote:
> > > On Nov 20, 2007, at 11:54 AM, Scott Wood wrote:
> > > > On Mon, Nov 19, 2007 at 09:36:57PM -0600, Kumar Gala wrote:
> > > >> isel (Integer Select) is a new user space instruction in the
> > > >> PowerISA 2.04 spec.  Not all processors implement it so lets emulate
> > > >> to ensure code built with isel will run everywhere.
> > > >
> > > > Given that the instruction is meant to be a performance enhancement,
> > > > we should probably warn the first few times it's emulated, so the user
> > > > knows they should change their toolchain setup if possible.
> > > 
> > > The same is true of mcrxr, popcntb, and possibly string ld/st.
> > > 
> > > Feel free to submit a patch that warns about their usage.
> > 
> > Something like this?
> 
> New version below.
> 
> Do we want it in sysfs? Or should we use debugfs instead?

I like this, and I'd say it's useful to have in sysfs. Few production
systems enable debugfs, and this is something that could be useful to
have access to there.

> Subject: powerpc: Keep track of emulated instructions
> 
> From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom•com>
> 
> powerpc: Keep track of emulated instructions
> 
> Counters for the various classes of emulated instructions are available under
> /sys/devices/system/cpu/cpu*/emulated/.
> Optionally, rate-limited warnings can be printed to the console when
> instructions are emulated.
> 
> Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom•com>
> ---
>  arch/powerpc/Kconfig.debug     |   10 ++++++
>  arch/powerpc/kernel/align.c    |   17 ++++++++--
>  arch/powerpc/kernel/sysfs.c    |   64 ++++++++++++++++++++++++++++++++++++++++-
>  arch/powerpc/kernel/traps.c    |   17 +++++++++-
>  include/asm-powerpc/emulator.h |   60 ++++++++++++++++++++++++++++++++++++++

This name stood out as being a bit too generic, emulator could mean
system support for running under some sort of emulator as well. How
about emulated_ops.h?

> +config DEBUG_WARN_EMULATED
> +	bool "Warn if emulated instructions are used"
> +	depends on DEBUG_KERNEL && SYSFS
> +	help
> +	  This option will cause messages to be printed if an instruction is
> +	  emulated.
> +	  Counters for emulated instruction usages are always available under
> +	  /sys/devices/system/cpu/cpu*/emulated/, irrespective of the state
> +	  of this option.

How about making it a sysctl instead, so it can be flipped at runtime
(but default off)?


-Olof

  reply	other threads:[~2007-11-27 15:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20  3:36 [PATCH] [POWERPC] Emulate isel (Integer Select) instruction Kumar Gala
2007-11-20 17:54 ` Scott Wood
2007-11-20 21:01   ` Kumar Gala
2007-11-21  9:12     ` Benjamin Herrenschmidt
2007-11-21 14:19       ` Kumar Gala
2007-11-21 13:09     ` Geert Uytterhoeven
2007-11-21 14:22       ` Kumar Gala
2007-11-21 14:33         ` Geert Uytterhoeven
2007-11-21 15:34           ` Kumar Gala
2007-11-21 16:50         ` Geert Uytterhoeven
2007-11-21 19:22           ` Kumar Gala
2007-11-21 21:31       ` Paul Mackerras
2007-11-21 21:36       ` Paul Mackerras
2007-11-21 21:41         ` Scott Wood
2007-11-21 21:48           ` Kim Phillips
2007-11-21 21:38       ` Paul Mackerras
2007-11-27 14:56       ` Geert Uytterhoeven
2007-11-27 15:23         ` Olof Johansson [this message]
2007-11-28 10:49           ` Geert Uytterhoeven
2007-11-29 15:13             ` Geert Uytterhoeven
2007-12-14  8:12               ` Olof Johansson
2007-12-14  8:08                 ` Kumar Gala
2007-12-14  8:17                   ` Olof Johansson
2007-12-14  8:16                 ` Olof Johansson

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=20071127152317.GA5230@lixom.net \
    --to=olof@lixom$(echo .)net \
    --cc=Geert.Uytterhoeven@sonycom$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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