All of lore.kernel.org
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] arm64: Always provide compat /proc/cpuinfo for 32-bit tasks
Date: Tue, 31 May 2016 15:55:04 +0100	[thread overview]
Message-ID: <1464706504-25224-3-git-send-email-catalin.marinas@arm.com> (raw)
In-Reply-To: <1464706504-25224-1-git-send-email-catalin.marinas@arm.com>

Currently, the compat /proc/cpuinfo is provided only if a task has the
PER_LINUX32 personality, either by setting it explicitly or by
inheriting it from the parent task. This is in line with the "uname -m"
behaviour.

However, there are 32-bit user applications making use of the
/proc/cpuinfo and unaware of a need to set the personality. This patch
changes the arm64 /proc/cpuinfo logic to provide the compat information
if the task is 32-bit _or_ the PER_LINUX32 personality is set.

Cc: <stable@vger.kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
 arch/arm64/kernel/cpuinfo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
index c173d329397f..bd6a122ea856 100644
--- a/arch/arm64/kernel/cpuinfo.c
+++ b/arch/arm64/kernel/cpuinfo.c
@@ -106,7 +106,8 @@ static const char *const compat_hwcap2_str[] = {
 static int c_show(struct seq_file *m, void *v)
 {
 	int i, j;
-	bool compat = personality(current->personality) == PER_LINUX32;
+	bool compat = is_compat_task() ||
+		personality(current->personality) == PER_LINUX32;
 
 	for_each_online_cpu(i) {
 		struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);

  parent reply	other threads:[~2016-05-31 14:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 14:55 [PATCH 0/2] arm64: /proc/cpuinfo updates for compat tasks Catalin Marinas
2016-05-31 14:55 ` [PATCH 1/2] arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks Catalin Marinas
2016-05-31 16:16   ` Will Deacon
2016-05-31 16:42     ` Catalin Marinas
2016-05-31 14:55 ` Catalin Marinas [this message]
2016-05-31 16:18   ` [PATCH 2/2] arm64: Always provide compat /proc/cpuinfo for 32-bit tasks Will Deacon
2016-06-29 19:51   ` Brian Norris
2016-06-29 19:51     ` Brian Norris

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=1464706504-25224-3-git-send-email-catalin.marinas@arm.com \
    --to=catalin.marinas@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.