linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Detect presence of LPAE when not running an LPAE kernel?
Date: Thu, 3 Oct 2013 21:07:12 +0100	[thread overview]
Message-ID: <20131003200712.GG12758@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1380829403.3804.56.camel@hastur.hellion.org.uk>

On Thu, Oct 03, 2013 at 08:43:23PM +0100, Ian Campbell wrote:
> Is this possible?
> 
> The Features field of /proc/cpuinfo only appears to reflect the presence
> of LPAE if CONFIG_LPAE is actually on in the running kernel.
> 
> The reason I care is so that distro installers can ship a generic kernel
> but select LPAE for the running system when appropriate.
> 
> On x86 for example I would check /proc/cpuinfo:flags which contains the
> CPU features, regardless of whether they are currently enabled.
> 
> Is there any equivalent on ARM?

Perversely, LPAE in there has nothing to do with LPAE being used by the
kernel.  It's more to do with the presence of the double-word load/store
exclusive.

It went through lots of discussions about what to call this, whether it
was "ATOMICD" (which is very perverse and vague) or LPAE (which is what
it was keyed off of).

Now, this LPAE flag is present whether or not the kernel has been built
with CONFIG_LPAE enabled or not.  That's because its not about LPAE
really, it's about those load/store exclusive instructions.

Now, this isn't applied to all flags: we hide certain CPU facilities
when the kernel support is missing, because the instructions can't be
used without kernel support being present.  For instance, if the VFP
support code is not present, support for VFP instructions will be
hidden (and the instructions disabled) because there's nothing to
context-switch the VFP state and stop one thread interfering with
another.

  reply	other threads:[~2013-10-03 20:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-03 19:43 Detect presence of LPAE when not running an LPAE kernel? Ian Campbell
2013-10-03 20:07 ` Russell King - ARM Linux [this message]
2013-10-04  7:15   ` Ian Campbell
2013-10-04 16:09     ` Will Deacon
2013-10-04 16:23       ` Ian Campbell
2013-10-04 16:26         ` Will Deacon
2013-10-04 16:34           ` Ian Campbell

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=20131003200712.GG12758@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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 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).