Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587536 - sys-apps/coreutils: uname -p / -i not supported on arm64
Summary: sys-apps/coreutils: uname -p / -i not supported on arm64
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-29 19:27 UTC by Brian Norris
Modified: 2016-12-08 19:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
ssh root@MYDEVICE cat /proc/cpuinfo > aarch64-cpuinfo.txt (aarch64-cpuinfo.txt,1.06 KB, text/plain)
2016-06-30 23:30 UTC, Brian Norris
Details
ssh root@MYDEVICE setarch linux32 cat /proc/cpuinfo > aarch64-linux32-cpuinfo.txt (aarch64-linux32-cpuinfo.txt,1.64 KB, text/plain)
2016-06-30 23:38 UTC, Brian Norris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Norris 2016-06-29 19:27:48 UTC
What's the expected behavior of uname -p and -i for arm64? I see that they are documented to support "unknown":

  -p, --processor          print the processor type or "unknown"
  -i, --hardware-platform  print the hardware platform or "unknown"

but that doesn't seem ideal:

localhost ~ # uname -p
unknown
localhost ~ # uname -i
unknown

On a related note, upstream Linux reintroduced support for "model name" in /proc/cpuinfo on ARM64, but only for processes whose personality is set to PER_LINUX32:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e47b020a323d1b2a7b1e9aac86e99eae19463630

This obviously doesn't work well in general.

I'd consider patching upstream Linux to, for instance, keep the 'model name' line for all processes, but I wanted to see if there's any opinion here first.
Comment 1 Brian Norris 2016-06-29 19:53:05 UTC
This patch seems to be in limbo:

https://patchwork.kernel.org/patch/9144983/
Comment 2 SpanKY gentoo-dev 2016-06-30 15:19:08 UTC
i don't have an arm64 system to test with.  can you attach a /proc/cpuinfo file here from a board you have ?  one with 32-bit personality & one with 64-bit personality please.

note: don't just cat the file and then copy & paste the terminal ... best to scp the file directly off and attach (so as to not mangle whitespace).
Comment 3 Brian Norris 2016-06-30 23:30:29 UTC
Created attachment 439262 [details]
ssh root@MYDEVICE cat /proc/cpuinfo > aarch64-cpuinfo.txt
Comment 4 Brian Norris 2016-06-30 23:38:03 UTC
Created attachment 439264 [details]
ssh root@MYDEVICE setarch linux32 cat /proc/cpuinfo > aarch64-linux32-cpuinfo.txt

Attached both. The 'model name' is not super-informative, but it's nice to have something there.

Incidentally, this means that (if I get a new enough kernel that patched in the PER_LINUX32 compatibility), Gentoo's patched `uname` already gets things right when run with PER_LINUX32:

localhost ~ # setarch linux32 uname -a
Linux localhost 4.4.4 #65 SMP PREEMPT Thu Jun 30 16:27:07 PDT 2016 armv8l ARMv8 Processor rev 4 (v8l) GNU/Linux
localhost ~ # setarch linux32 uname -p
ARMv8 Processor rev 4 (v8l)
localhost ~ # setarch linux32 uname -i
unknown
localhost ~ # uname -a
Linux localhost 4.4.4 #65 SMP PREEMPT Thu Jun 30 16:27:07 PDT 2016 aarch64 GNU/Linux
localhost ~ # uname -p
unknown
localhost ~ # uname -i
unknown

(Note that the "4.4.4" kernel above is patched with many subsequent upstream features, including the aforementioned PER_LINUX32 patch.)

I still have yet to figure out why the ARM64 folks hate 'model name'.
Comment 5 SpanKY gentoo-dev 2016-07-04 02:05:58 UTC
to clarify, the fact that -p/-i shows something useful on Gentoo is because we carry a patch to try and parse extended fields.  upstream GNU coreutils shows "unknown" pretty much everywhere, as do most distros.  a few carry x86-specific hacks, but rarely do they venture outside of that.

looking at both of those files, there's no useful information we can even extract to display.  so there's really only two routes:
(1) get the upstream kernel guys to include the fields all the time for arm64
(2) find a different datastore in /proc or /sys for us to parse
Comment 6 Brian Norris 2016-07-06 16:55:24 UTC
Understood on all points. I was just curious if there was any additional context or motivations, to help while trying to address upstream kernel folks. Let me see where I get with (1).