All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Hackmann <ghackmann@google.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com,
	ijc@hellion.org.uk,
	Serban Constantinescu <serban.constantinescu@arm.com>,
	will.deacon@arm.com, cross-distro@lists.linaro.org,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/1] arm64: Fix /proc/cpuinfo
Date: Mon, 27 Oct 2014 21:43:25 -0700	[thread overview]
Message-ID: <CAJKQeMZu+E_j-O3+bAhQ2oN-9iuAe9RwfRAy87EiHzF0MVTEXA@mail.gmail.com> (raw)
In-Reply-To: <1414159000-27059-1-git-send-email-mark.rutland@arm.com>

On Fri, Oct 24, 2014 at 6:56 AM, Mark Rutland <mark.rutland@arm.com> wrote:
> [c] Print different hwcaps for compat tasks
>
>     This would allow for 32-bit and 64-bit applications to function
>     correctly. Having the format differ depending on the instruction set
>     of the application reading /proc/cpuinfo may be misleading in some
>     cases (e.g. a human using a 32-bit cat to read /proc/cpuinfo on a
>     64-bit system).

FWIW we have an Nvidia-contributed patch in the android-3.10 kernel
tree that basically does this.  It works well in almost all cases.

We've only found one situation so far where this approach falls apart.
One specific Android NDK app detects NEON support by running
"/system/bin/cat /proc/cpuinfo" in another process and searching for
the string "neon" in the output.  Even though the app itself is
32-bit, /system/bin/cat is 64-bit, so it reads the "wrong"
/proc/cpuinfo and decides the CPU doesn't support NEON.

>From Android's perspective, the only downside of using personalities
instead is that our runtime will need to ensure 32-bit apps have the
right personality.  Our runtime team has said they're fine with doing
this, if that's the direction the upstream kernel wants to go.

> Are there applications for which any of these strategies will not work?

We've found a handful of Android apps that expect the "CPU
architecture" field to be "7" specifically and get confused by the
existence of ARMv8.  There's not much you can do on the kernel side to
support those apps, other than lying about the CPU architecture to
32-bit apps (and we drew the line at doing that).

WARNING: multiple messages have this Message-ID (diff)
From: ghackmann@google.com (Greg Hackmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 0/1] arm64: Fix /proc/cpuinfo
Date: Mon, 27 Oct 2014 21:43:25 -0700	[thread overview]
Message-ID: <CAJKQeMZu+E_j-O3+bAhQ2oN-9iuAe9RwfRAy87EiHzF0MVTEXA@mail.gmail.com> (raw)
In-Reply-To: <1414159000-27059-1-git-send-email-mark.rutland@arm.com>

On Fri, Oct 24, 2014 at 6:56 AM, Mark Rutland <mark.rutland@arm.com> wrote:
> [c] Print different hwcaps for compat tasks
>
>     This would allow for 32-bit and 64-bit applications to function
>     correctly. Having the format differ depending on the instruction set
>     of the application reading /proc/cpuinfo may be misleading in some
>     cases (e.g. a human using a 32-bit cat to read /proc/cpuinfo on a
>     64-bit system).

FWIW we have an Nvidia-contributed patch in the android-3.10 kernel
tree that basically does this.  It works well in almost all cases.

We've only found one situation so far where this approach falls apart.
One specific Android NDK app detects NEON support by running
"/system/bin/cat /proc/cpuinfo" in another process and searching for
the string "neon" in the output.  Even though the app itself is
32-bit, /system/bin/cat is 64-bit, so it reads the "wrong"
/proc/cpuinfo and decides the CPU doesn't support NEON.

>From Android's perspective, the only downside of using personalities
instead is that our runtime will need to ensure 32-bit apps have the
right personality.  Our runtime team has said they're fine with doing
this, if that's the direction the upstream kernel wants to go.

> Are there applications for which any of these strategies will not work?

We've found a handful of Android apps that expect the "CPU
architecture" field to be "7" specifically and get confused by the
existence of ARMv8.  There's not much you can do on the kernel side to
support those apps, other than lying about the CPU architecture to
32-bit apps (and we drew the line at doing that).

  parent reply	other threads:[~2014-10-28  4:43 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 13:56 [RFC PATCH 0/1] arm64: Fix /proc/cpuinfo Mark Rutland
2014-10-24 13:56 ` Mark Rutland
2014-10-24 13:56 ` Mark Rutland
2014-10-24 13:56 ` [RFC PATCH 1/1] arm64: Fix up /proc/cpuinfo Mark Rutland
2014-10-24 13:56   ` Mark Rutland
2014-10-24 13:56   ` Mark Rutland
2014-10-30 17:15   ` Will Deacon
2014-10-30 17:15     ` Will Deacon
2014-10-30 17:15     ` Will Deacon
2014-10-30 17:20     ` Ian Campbell
2014-10-30 17:20       ` Ian Campbell
2014-10-30 17:20       ` Ian Campbell
2014-10-24 14:19 ` [RFC PATCH 0/1] arm64: Fix /proc/cpuinfo Russell King - ARM Linux
2014-10-24 14:19   ` Russell King - ARM Linux
2014-10-24 14:19   ` Russell King - ARM Linux
2014-10-24 14:24   ` Mark Rutland
2014-10-24 14:24     ` Mark Rutland
2014-10-24 14:24     ` Mark Rutland
2014-10-24 15:42     ` Russell King - ARM Linux
2014-10-24 15:42       ` Russell King - ARM Linux
2014-10-24 15:42       ` Russell King - ARM Linux
2014-10-28  4:43 ` Greg Hackmann [this message]
2014-10-28  4:43   ` Greg Hackmann
2014-11-06 16:43 ` Catalin Marinas
2014-11-06 16:43   ` Catalin Marinas
2014-11-06 16:43   ` Catalin Marinas
2014-11-06 16:54   ` Will Deacon
2014-11-06 16:54     ` Will Deacon
2014-11-06 16:54     ` Will Deacon
2014-11-06 17:05     ` Catalin Marinas
2014-11-06 17:05       ` Catalin Marinas
2014-11-06 17:05       ` Catalin Marinas
2014-11-13 17:48       ` Catalin Marinas
2014-11-13 17:48         ` Catalin Marinas
2014-11-13 17:48         ` Catalin Marinas

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=CAJKQeMZu+E_j-O3+bAhQ2oN-9iuAe9RwfRAy87EiHzF0MVTEXA@mail.gmail.com \
    --to=ghackmann@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=cross-distro@lists.linaro.org \
    --cc=ijc@hellion.org.uk \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=serban.constantinescu@arm.com \
    --cc=will.deacon@arm.com \
    /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.