All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2] ARM64: Add AT_ARM64_MIDR to the aux vector
Date: Tue, 1 Sep 2015 18:30:43 +0100	[thread overview]
Message-ID: <20150901173043.GE16430@leverpostej> (raw)
In-Reply-To: <4C8DD5E0-E1EA-40C6-B947-72189241023C@caviumnetworks.com>

[...]

> >>> On Sat, Aug 29, 2015 at 07:46:22PM +0100, Andrew Pinski wrote:
> >>> It is useful to pass down MIDR register down to userland if all of
> >>> the online cores are all the same type.  This adds AT_ARM64_MIDR
> >>> aux vector type and passes down the midr system register.
> >>> 
> >>> This is alternative to MIDR_EL1 part of
> >>> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/358995.html.
> >>> It allows for faster access to midr_el1 than going through a trap and
> >>> does not exist if the set of cores are not the same.
> >> 
> >> I'm not sure I follow the rationale. If speed is important the
> >> application can cache the value the first time it reads it with a trap.
> > 
> > It is also about compatibility also. Exposing the register is not backwards compatible but using the aux vector is. 
> 
> That would also break big.little too. So either break it with hot plug or break it in userland, your choice. 

The value wouldn't be representative of the system as a whole; that is
true. However, we never guaranteed that it was, while the aux vector
code implied that we did.

For optimisation that may be good enough; code optimized for a different
uArch should still function on another, even if it is slower.

> >> This also means that the behaviour is different across homogeneous and
> >> heterogeneous systems.
> 
> That should be ok because it is still backwards compatible with what
> was done before.  My goal here is just to allow quick easy access to
> midr in the case of a homogeneous system which I care about, thunderx
> and to allow glibc to select a memcpy/memset that is better for
> thunderx. 

As I mentioned in the other thread, I think that HWCAP_CPUID is
sufficient to enable forwards and backwards compatibility. If it is
present then you can use the current CPU's MIDR to select a better
memcpy/memset if required.

Thanks,
Mark.

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: "Pinski, Andrew" <Andrew.Pinski@caviumnetworks.com>
Cc: "pinskia@gmail.com" <pinskia@gmail.com>,
	Andrew Pinski <apinski@cavium.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Suzuki Poulose <Suzuki.Poulose@arm.com>,
	"steve.capper@linaro.org" <steve.capper@linaro.org>
Subject: Re: [PATCHv2] ARM64: Add AT_ARM64_MIDR to the aux vector
Date: Tue, 1 Sep 2015 18:30:43 +0100	[thread overview]
Message-ID: <20150901173043.GE16430@leverpostej> (raw)
In-Reply-To: <4C8DD5E0-E1EA-40C6-B947-72189241023C@caviumnetworks.com>

[...]

> >>> On Sat, Aug 29, 2015 at 07:46:22PM +0100, Andrew Pinski wrote:
> >>> It is useful to pass down MIDR register down to userland if all of
> >>> the online cores are all the same type.  This adds AT_ARM64_MIDR
> >>> aux vector type and passes down the midr system register.
> >>> 
> >>> This is alternative to MIDR_EL1 part of
> >>> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/358995.html.
> >>> It allows for faster access to midr_el1 than going through a trap and
> >>> does not exist if the set of cores are not the same.
> >> 
> >> I'm not sure I follow the rationale. If speed is important the
> >> application can cache the value the first time it reads it with a trap.
> > 
> > It is also about compatibility also. Exposing the register is not backwards compatible but using the aux vector is. 
> 
> That would also break big.little too. So either break it with hot plug or break it in userland, your choice. 

The value wouldn't be representative of the system as a whole; that is
true. However, we never guaranteed that it was, while the aux vector
code implied that we did.

For optimisation that may be good enough; code optimized for a different
uArch should still function on another, even if it is slower.

> >> This also means that the behaviour is different across homogeneous and
> >> heterogeneous systems.
> 
> That should be ok because it is still backwards compatible with what
> was done before.  My goal here is just to allow quick easy access to
> midr in the case of a homogeneous system which I care about, thunderx
> and to allow glibc to select a memcpy/memset that is better for
> thunderx. 

As I mentioned in the other thread, I think that HWCAP_CPUID is
sufficient to enable forwards and backwards compatibility. If it is
present then you can use the current CPU's MIDR to select a better
memcpy/memset if required.

Thanks,
Mark.

  reply	other threads:[~2015-09-01 17:30 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29 18:46 [PATCHv2] ARM64: Add AT_ARM64_MIDR to the aux vector Andrew Pinski
2015-08-29 18:46 ` Andrew Pinski
2015-09-01 16:33 ` Mark Rutland
2015-09-01 16:33   ` Mark Rutland
2015-09-01 16:51   ` pinskia at gmail.com
2015-09-01 16:51     ` pinskia
2015-09-01 17:06     ` Pinski, Andrew
2015-09-01 17:06       ` Pinski, Andrew
2015-09-01 17:30       ` Mark Rutland [this message]
2015-09-01 17:30         ` Mark Rutland
2015-09-01 17:58         ` pinskia at gmail.com
2015-09-01 17:58           ` pinskia
2015-09-01 19:12           ` Siarhei Siamashka
2015-09-01 19:12             ` Siarhei Siamashka
2015-09-02  0:28             ` Pinski, Andrew
2015-09-02  0:28               ` Pinski, Andrew
2015-09-02 13:57               ` Siarhei Siamashka
2015-09-02 13:57                 ` Siarhei Siamashka
2015-09-02 14:52                 ` Andrew Pinski
2015-09-02 14:52                   ` Andrew Pinski
2015-09-02 17:11                   ` Catalin Marinas
2015-09-02 17:11                     ` Catalin Marinas
2015-09-02 17:21                     ` Pinski, Andrew
2015-09-02 17:21                       ` Pinski, Andrew
2015-09-02 20:11                       ` Thomas Gleixner
2015-09-02 20:11                         ` Thomas Gleixner
2015-09-03 17:14                       ` Catalin Marinas
2015-09-03 17:14                         ` Catalin Marinas
2015-09-01 17:19     ` Mark Rutland
2015-09-01 17:19       ` Mark Rutland
2015-09-01 17:29       ` Pinski, Andrew
2015-09-01 17:29         ` Pinski, Andrew

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=20150901173043.GE16430@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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.