[PATCH 14/14] ARM: elf: add new hwcap for identifying atomic ldrd/strd instructions

Catalin Marinas catalin.marinas at arm.com
Wed May 22 04:47:44 EDT 2013


On Tue, May 21, 2013 at 07:48:35PM +0100, Rob Herring wrote:
> On Mon, May 20, 2013 at 9:18 AM, Catalin Marinas
> <catalin.marinas at arm.com> wrote:
> > On Fri, May 17, 2013 at 06:07:53PM +0100, Will Deacon wrote:
> >> CPUs implementing LPAE have atomic ldrd/strd instructions, meaning that
> >> userspace software can avoid having to use the exclusive variants of
> >> these instructions if they wish.
> >>
> >> This patch advertises the atomicity of these instructions via the
> >> hwcaps, so userspace can detect this CPU feature.
> >>
> >> Reported-by: Vladimir Danushevsky <vladimir.danushevsky at oracle.com>
> >> Signed-off-by: Will Deacon <will.deacon at arm.com>
> > ...
> >> +
> >> +     /* LPAE implies atomic ldrd/strd instructions */
> >> +     vmsa = (read_cpuid_ext(CPUID_EXT_MMFR0) & 0xf) >> 0;
> >> +     if (vmsa >= 5)
> >> +             elf_hwcap |= HWCAP_LPAE;
> >
> > As I mentioned in the past, I don't agree with exposing the "LPAE"
> > feature to user-space, it's not a feature that user space should care
> > about. An atomic double hwcap is better and you can even make this per
> > CPU via __v7_proc.
> 
> How does userspace know whether to install a non-LPAE or LPAE kernel
> in a generic way?

This is a valid reason to expose LPAE to user, though elf_hwcap sounds a
bit strange.

-- 
Catalin



More information about the linux-arm-kernel mailing list