All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	cross-distro@lists.linaro.org, catalin.marinas@arm.com,
	serban.constantinescu@arm.com, will.deacon@arm.com,
	linux-kernel@vger.kernel.org, ghackmann@google.com,
	ijc@hellion.org.uk, linux-api@vger.kernel.org
Subject: Re: [RFC PATCH 0/1] arm64: Fix /proc/cpuinfo
Date: Fri, 24 Oct 2014 15:19:36 +0100	[thread overview]
Message-ID: <20141024141936.GS27405@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1414159000-27059-1-git-send-email-mark.rutland@arm.com>

On Fri, Oct 24, 2014 at 02:56:39PM +0100, Mark Rutland wrote:
> Currently, the arm64 /proc/cpuinfo format differs from that of arm, in a
> manner which prevents some otherwise portable applications from
> functioning as expected. Specifically, the "Features" line describes the
> 64-bit hwcaps exclusive of the 32-bit hwcaps, which causes issues for
> certain applications which attempt to parse /proc/cpuinfo to detect
> features rather than directly using the hwcaps exposed via auxval.

Like it or not, but every file in procfs is a userspace API, and can
be parsed by any program.  If we change a procfs file and a userspace
program then stops working, that's our fault, and our problem to fix
(by restoring the information published there in a manner which
userspace can parse.)

So, as you've found some programs which rely on this, ARM64 really does
need to be compatible with ARM32 in this respect.

It's unfortunate that people have decided that parsing the ELF HWCAPs
from /proc/cpuinfo is an acceptable way to go, rather than using the
binary information passed, but procfs is a much more visible source
of information than some binary interface which you need to read man
pages to find.

That's the danger of publishing information in either procfs or sysfs.
Once published, it becomes part of the userspace API, and it can become
hard to remove it.  This is why we should /always/ think very carefully
about what we expose through these filesystems.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

WARNING: multiple messages have this Message-ID (diff)
From: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	cross-distro-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	catalin.marinas-5wv7dgnIgG8@public.gmane.org,
	serban.constantinescu-5wv7dgnIgG8@public.gmane.org,
	will.deacon-5wv7dgnIgG8@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ghackmann-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	ijc-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC PATCH 0/1] arm64: Fix /proc/cpuinfo
Date: Fri, 24 Oct 2014 15:19:36 +0100	[thread overview]
Message-ID: <20141024141936.GS27405@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1414159000-27059-1-git-send-email-mark.rutland-5wv7dgnIgG8@public.gmane.org>

On Fri, Oct 24, 2014 at 02:56:39PM +0100, Mark Rutland wrote:
> Currently, the arm64 /proc/cpuinfo format differs from that of arm, in a
> manner which prevents some otherwise portable applications from
> functioning as expected. Specifically, the "Features" line describes the
> 64-bit hwcaps exclusive of the 32-bit hwcaps, which causes issues for
> certain applications which attempt to parse /proc/cpuinfo to detect
> features rather than directly using the hwcaps exposed via auxval.

Like it or not, but every file in procfs is a userspace API, and can
be parsed by any program.  If we change a procfs file and a userspace
program then stops working, that's our fault, and our problem to fix
(by restoring the information published there in a manner which
userspace can parse.)

So, as you've found some programs which rely on this, ARM64 really does
need to be compatible with ARM32 in this respect.

It's unfortunate that people have decided that parsing the ELF HWCAPs
from /proc/cpuinfo is an acceptable way to go, rather than using the
binary information passed, but procfs is a much more visible source
of information than some binary interface which you need to read man
pages to find.

That's the danger of publishing information in either procfs or sysfs.
Once published, it becomes part of the userspace API, and it can become
hard to remove it.  This is why we should /always/ think very carefully
about what we expose through these filesystems.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 0/1] arm64: Fix /proc/cpuinfo
Date: Fri, 24 Oct 2014 15:19:36 +0100	[thread overview]
Message-ID: <20141024141936.GS27405@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1414159000-27059-1-git-send-email-mark.rutland@arm.com>

On Fri, Oct 24, 2014 at 02:56:39PM +0100, Mark Rutland wrote:
> Currently, the arm64 /proc/cpuinfo format differs from that of arm, in a
> manner which prevents some otherwise portable applications from
> functioning as expected. Specifically, the "Features" line describes the
> 64-bit hwcaps exclusive of the 32-bit hwcaps, which causes issues for
> certain applications which attempt to parse /proc/cpuinfo to detect
> features rather than directly using the hwcaps exposed via auxval.

Like it or not, but every file in procfs is a userspace API, and can
be parsed by any program.  If we change a procfs file and a userspace
program then stops working, that's our fault, and our problem to fix
(by restoring the information published there in a manner which
userspace can parse.)

So, as you've found some programs which rely on this, ARM64 really does
need to be compatible with ARM32 in this respect.

It's unfortunate that people have decided that parsing the ELF HWCAPs
from /proc/cpuinfo is an acceptable way to go, rather than using the
binary information passed, but procfs is a much more visible source
of information than some binary interface which you need to read man
pages to find.

That's the danger of publishing information in either procfs or sysfs.
Once published, it becomes part of the userspace API, and it can become
hard to remove it.  This is why we should /always/ think very carefully
about what we expose through these filesystems.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

  parent reply	other threads:[~2014-10-24 14:19 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 ` Russell King - ARM Linux [this message]
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: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
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=20141024141936.GS27405@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=catalin.marinas@arm.com \
    --cc=cross-distro@lists.linaro.org \
    --cc=ghackmann@google.com \
    --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.