bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH hurd] Add partial /proc/cpuinfo implementation


From: Sergey Bugaev
Subject: Re: [RFC PATCH hurd] Add partial /proc/cpuinfo implementation
Date: Thu, 9 Jan 2025 11:51:27 +0300

Hi,

On Thu, Jan 9, 2025 at 1:42 AM Luca <luca@orpolo.org> wrote:
> >> maybe this can be already made arch-specific.
> >>
> >
> > Hmm, maybe. As is it only makes sense for x86 based architectures.
>
> There was some work from Sergey towards porting to aarch64, I guess
> currently the hurd should compile there, and without a guard it would break.
>
> > What would be the right approach at making pieces of code architechture
> > based on the Hurd repo? There isn't much code in that fashion, probably
> > pfinet only.
>
> Probably guarding the code with an #ifdef is enough, there are already
> some in proc and exec covering also aarch64. Otherwise you can move the
> arch-specific part to dedicated files.

indeed, the Hurd upstream is already supposed to build on aarch64-gnu.
So please make this implementation conditional for x86.

On AArch64 Linux, /proc/cpuinfo reads e.g.

processor       : 0
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics
fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4
asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg
dcpodp flagm2 frint i8mm bf16 bti
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd46
CPU revision    : 1

"Implementer", "architecture", "variant", "part", "revision" come from
midr/revidr [0], and "features" are hwcap names. These are privileged
registers that only EL1 can read, but on AArch64 gnumach, their values
are obtainable from userland using the aarch64_get_hwcaps RPC (see
gnumach:aarch64/include/mach/aarch64/mach_aarch64.defs and
gnumach:aarch64/include/mach/aarch64/mach_aarch64_types.h).

[0]: 
https://developer.arm.com/documentation/ddi0601/2024-12/AArch64-Registers/MIDR-EL1--Main-ID-Register?lang=en

Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]