Commit 6a80e575 authored by Catalin Marinas's avatar Catalin Marinas Committed by Ben Hutchings

arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks

commit e47b020a upstream.

This patch brings the PER_LINUX32 /proc/cpuinfo format more in line with
the 32-bit ARM one by providing an additional line:

model name      : ARMv8 Processor rev X (v8l)
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
[bwh: Backported to 3.16:
 - Adjust filename, context
 - Open-code MIDR_REVISION()]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 6f99b1f1
...@@ -161,14 +161,14 @@ struct mm_struct; ...@@ -161,14 +161,14 @@ struct mm_struct;
extern unsigned long arch_randomize_brk(struct mm_struct *mm); extern unsigned long arch_randomize_brk(struct mm_struct *mm);
#define arch_randomize_brk arch_randomize_brk #define arch_randomize_brk arch_randomize_brk
#ifdef CONFIG_COMPAT
#ifdef __AARCH64EB__ #ifdef __AARCH64EB__
#define COMPAT_ELF_PLATFORM ("v8b") #define COMPAT_ELF_PLATFORM ("v8b")
#else #else
#define COMPAT_ELF_PLATFORM ("v8l") #define COMPAT_ELF_PLATFORM ("v8l")
#endif #endif
#ifdef CONFIG_COMPAT
#define COMPAT_ELF_ET_DYN_BASE (randomize_et_dyn(2 * TASK_SIZE_32 / 3)) #define COMPAT_ELF_ET_DYN_BASE (randomize_et_dyn(2 * TASK_SIZE_32 / 3))
/* AArch32 registers. */ /* AArch32 registers. */
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/efi.h> #include <linux/efi.h>
#include <linux/personality.h> #include <linux/personality.h>
#include <linux/compat.h>
#include <linux/elf.h>
#include <asm/fixmap.h> #include <asm/fixmap.h>
#include <asm/cputype.h> #include <asm/cputype.h>
...@@ -489,6 +491,7 @@ static const char *compat_hwcap_str[] = { ...@@ -489,6 +491,7 @@ static const char *compat_hwcap_str[] = {
static int c_show(struct seq_file *m, void *v) static int c_show(struct seq_file *m, void *v)
{ {
int i, j; int i, j;
bool compat = personality(current->personality) == PER_LINUX32;
for_each_online_cpu(i) { for_each_online_cpu(i) {
struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i); struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
...@@ -500,6 +503,9 @@ static int c_show(struct seq_file *m, void *v) ...@@ -500,6 +503,9 @@ static int c_show(struct seq_file *m, void *v)
* "processor". Give glibc what it expects. * "processor". Give glibc what it expects.
*/ */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
if (compat)
seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
midr & 0xf, COMPAT_ELF_PLATFORM);
seq_printf(m, "processor\t: %d\n", i); seq_printf(m, "processor\t: %d\n", i);
#endif #endif
...@@ -514,7 +520,7 @@ static int c_show(struct seq_file *m, void *v) ...@@ -514,7 +520,7 @@ static int c_show(struct seq_file *m, void *v)
* software which does already (at least for 32-bit). * software which does already (at least for 32-bit).
*/ */
seq_puts(m, "Features\t:"); seq_puts(m, "Features\t:");
if (personality(current->personality) == PER_LINUX32) { if (compat) {
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
for (j = 0; compat_hwcap_str[j]; j++) for (j = 0; compat_hwcap_str[j]; j++)
if (compat_elf_hwcap & (1 << j)) if (compat_elf_hwcap & (1 << j))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment