diff options
author | Will Deacon <will.deacon@arm.com> | 2013-04-08 17:13:12 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2013-05-30 16:02:34 +0100 |
commit | a469abd0f868c902b75532579bf87553dcf1b360 (patch) | |
tree | 45b8497556dff1a90311bbd087f34ff4791be9d6 /arch/arm/kernel | |
parent | e38a517578d6c0f764b0d0f6e26dcdf9f70c69d7 (diff) | |
download | linux-stable-a469abd0f868c902b75532579bf87553dcf1b360.tar.gz linux-stable-a469abd0f868c902b75532579bf87553dcf1b360.tar.bz2 linux-stable-a469abd0f868c902b75532579bf87553dcf1b360.zip |
ARM: elf: add new hwcap for identifying atomic ldrd/strd instructions
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@oracle.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/setup.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 1522c7ae31b0..bdcd4dd13230 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -355,7 +355,7 @@ void __init early_print(const char *str, ...) static void __init cpuid_init_hwcaps(void) { - unsigned int divide_instrs; + unsigned int divide_instrs, vmsa; if (cpu_architecture() < CPU_ARCH_ARMv7) return; @@ -368,6 +368,11 @@ static void __init cpuid_init_hwcaps(void) case 1: elf_hwcap |= HWCAP_IDIVT; } + + /* LPAE implies atomic ldrd/strd instructions */ + vmsa = (read_cpuid_ext(CPUID_EXT_MMFR0) & 0xf) >> 0; + if (vmsa >= 5) + elf_hwcap |= HWCAP_LPAE; } static void __init feat_v6_fixup(void) @@ -872,6 +877,7 @@ static const char *hwcap_str[] = { "vfpv4", "idiva", "idivt", + "lpae", NULL }; |