GNU bug report logs - #74731
guix/cpu should parse /sys/devices/system/cpu/modalias

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Efraim Flashner <efraim@HIDDEN>; dated Sun, 8 Dec 2024 07:27:02 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 74731 <at> debbugs.gnu.org:


Received: (at 74731) by debbugs.gnu.org; 10 Dec 2024 08:17:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 10 03:17:58 2024
Received: from localhost ([127.0.0.1]:56857 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tKvRI-00028f-4z
	for submit <at> debbugs.gnu.org; Tue, 10 Dec 2024 03:17:58 -0500
Received: from mail-wm1-f42.google.com ([209.85.128.42]:55469)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <efraim.flashner@HIDDEN>) id 1tKvRF-00028V-Fk
 for 74731 <at> debbugs.gnu.org; Tue, 10 Dec 2024 03:17:50 -0500
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-432d86a3085so34531645e9.2
 for <74731 <at> debbugs.gnu.org>; Tue, 10 Dec 2024 00:17:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1733818607; x=1734423407; darn=debbugs.gnu.org;
 h=in-reply-to:content-disposition:mime-version:references
 :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to
 :cc:subject:date:message-id:reply-to;
 bh=lr7clyJZFsfJa1u8BVfdkQA90KalzKcMmjl2QSeJ5dM=;
 b=mykdL7kjVt+iNaJJRK4KqD0nw+052QVMBxRRSIvpK/OxdiG1Qzxty8EAMfvYuIpMrU
 AjfSBlEIP6dbPjOTKBKuv1YKHum9PFRszcO+Q+gm+0GHoYDoZfEBMjN/CfD1NPR9Q6iF
 Wevur0G3w81FExl+yjNkEpNpMUbj0MqS/JUEHEUopMnIOfYZnVI1RW48bW/MpdBC9ZH3
 +wOASfkfz4q7TkmsjYA2UjtnEy7rbJZQNWfRsIHtuXO7iFLjpdcrmF0tEGn4ACnVo61+
 FU9Id74qcnIWLKHY2pdzDB4HBQsNocY+TgVEhLdROtCMigHN19v03EWj82kxFFrasj50
 tS/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1733818607; x=1734423407;
 h=in-reply-to:content-disposition:mime-version:references
 :mail-followup-to:message-id:subject:cc:to:from:date:sender
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=lr7clyJZFsfJa1u8BVfdkQA90KalzKcMmjl2QSeJ5dM=;
 b=dctZ+AoHE856PBjEPEzGoGq3OjYeHAxr4UJQmFrae2oJav8JWwbqBDsI5wpacWzQfz
 mcIY8hUTK4ag9C+eb3yYm4h64cZgtrU38MiEjtqVTZtfTCkgMCy0d24ac5a/FkJqQ7cg
 emgQHoMJVDdnJDF8CkRemPzCGUkCdkSnBOQYo1ZZwy3SUsaHuPUt80KWNuIEBrAegMrx
 B+mgBy6iqr1cvgqgqy5Ih9mLqn5WSQRzwjAUZh0GNt2cqRKqHAJ7oS+9xN9g4eB+GLlP
 I3OTpokNECCamuKGth8fvK52Wxfz02x7htAjHQ8HhFjcJVJL6mOaqR8q+Q3V6x2sFcMU
 f2xQ==
X-Gm-Message-State: AOJu0YylOfiQQX3o5HBXsbvvK/d3dVMxck1buPnOAIqCbTSjD65D+Xb4
 BcA8z/Z9SsepGq1Z/7XFqoaWs7h6qsl/gyiArYBaZwDpkvyh0A0I
X-Gm-Gg: ASbGncvTbm6JwTvjW6e5+64oFDrSjeghqMPvGz0clryldr2Qa2Mw09BOAcbOicPGLyz
 3cJyLbZpGZ1hBnUVu6S4jb4A/Hy39nreVuDYvE5jAWEI+24mBZ7WFF+ZVDQ7Ej00QvQK4SSYXZ+
 6gRReJUZp/mXSTUPm6c6WngnmrXxGx//nxipkYVeGNTwrvw1YJaAp2Dxx8p7EKk1rN8dA6F5dc3
 ftIYJg5UrcfPNvn/Yu42XLbbXqDR5dM/FUvuOc9Czq6HBN/Fxsipw==
X-Google-Smtp-Source: AGHT+IEjLCEU8I86xmiuSlxvxtNOP54NldE3G7im/D0K6xpJ76y3UJ9k515dZOp1u+H346ZFyzx7+Q==
X-Received: by 2002:a05:600c:83c3:b0:434:f230:f4f0 with SMTP id
 5b1f17b1804b1-434fff3704fmr24040985e9.1.1733818607066; 
 Tue, 10 Dec 2024 00:16:47 -0800 (PST)
Received: from localhost ([31.210.180.118]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-435a3d54930sm5443635e9.0.2024.12.10.00.16.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 10 Dec 2024 00:16:46 -0800 (PST)
Date: Tue, 10 Dec 2024 10:16:44 +0200
From: Efraim Flashner <efraim@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#74731: guix/cpu should parse /sys/devices/system/cpu/modalias
Message-ID: <Z1f47NtnZ1zFZZ0m@3900XT>
Mail-Followup-To: Efraim Flashner <efraim@HIDDEN>,
 Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 74731 <at> debbugs.gnu.org
References: <Z1VKB38Jsaw-RKtG@3900XT>
 <87jzc8lpv1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="w/OVG1VbdlyG0qaf"
Content-Disposition: inline
In-Reply-To: <87jzc8lpv1.fsf@HIDDEN>
X-PGP-Key-ID: 0x41AAE7DCCA3D8351
X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc
X-PGP-Fingerprint: A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 74731
Cc: 74731 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)


--w/OVG1VbdlyG0qaf
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Dec 09, 2024 at 06:37:22PM +0100, Ludovic Court=C3=A8s wrote:
> Hello,
>=20
> Efraim Flashner <efraim@HIDDEN> skribis:
>=20
> > I saw a post by Marcan=C2=B9 of Asahi Linux the other day about not par=
sing
> > /proc/cpuinfo and remembered that's what we're doing in (guix cpu).
>=20
> I believe it initially mimicked what GCC does for =E2=80=98-march=3Dnativ=
e=E2=80=99, but
> it does seem to be less exhaustive than /sys/devices/cpu/modalias.
>=20
> I wonder if there are version/portability issues with the latter.

I've been thinking more about it over the past few days.

I think ultimately we need to match both parts; the kernel interfaces
with the hardware and knows (or at least should know) exactly what the
hardware can support, and gcc (or the other compilers) need to support
optimizing for those hardware bits specifically.

Also, parsing /proc/cpuinfo is already reading what the kernel says it
supports, except in an incomplete manner.

Starting with x86_64 (and i686), I think we keep GCC's definition of
what each sub-architecture is but parse the modalias file instead of
parsing cpuinfo.

I already have some code to parse modalias and some ideas for just
reusing the math bits from the kernel (it looks like ((11*32)+28) for
zen2) to adjust the if-flags to match the numerical equivalent of the
feature.

For x86_64 the kernel does have a policy of reusing flags if they've
been deprecated and unused long enough, but hopefully that won't be a
problem, even with some of our older LTS kernels.

I think for the start it would make most sense to read modalias in
addition to cpuinfo, sort based on the data in modialis, and then
fallback to cpuinfo if it doesn't match.  This helps for architectures
without the modalias file (like riscv64), and I don't know what the Hurd
provides, but I'd be surprised if it had the same modalias file for
parsing.

I'll try to work on it a bit over the coming days.

--=20
Efraim Flashner   <efraim@HIDDEN>   =D7=90=D7=A4=D7=A8=D7=99=D7=9D =
=D7=A4=D7=9C=D7=A9=D7=A0=D7=A8
GPG key =3D A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

--w/OVG1VbdlyG0qaf
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmdX+OgACgkQQarn3Mo9
g1G2jRAAnYuWeGCFeYgO+WL1sNmFesRh+LiBqSHxeV4bftENKPBtD0VqR4VX3FtE
hoUdgHl44b0hs8wpK6EW+ISQCMOSNyCooyviEUVA0KM7VAJ3ysuOb4YbbfZ+EYx0
TaCg0xFd+op2tpKzi7M/zmV4LHgmNi4G6ak+W1eLKe/mmj4Sv/BhbsRJy+z6h3Ai
eA79OJYGWoYBZ0YvH0oZkTlUl/Hfp2ovEArLBYvCF6jhujcjgBi9opxG62iscMDV
r5NCGMsW8cDTNhFSeNMgT6hG09CK84/4w1NI+b13lWTcKwwAP1RNntCH8Xp5pR8o
ZVX4jkjdDh4xAmQBj07Cv2BYP+PHaazWUe6QVKMqO5SAnADA5v1KDFaKmkzuy0pu
3AvT77jwgC6LgVaLjgVrlnuyzSyYYB0hVsoW0NFzntU8l/jza+DXBGM+r6aKVUeU
U4xnRYJ3NMhGVcIf2TbtjPfWa11IukptJxRkgrqMqpTLK3vuE4w5PRvVDkIX98I4
PdM/hZW0GQsxscIQCZMiFY1UJurG5WySHZS/GtI5Ec3tofyKJZhtA7eseogM/cwh
pcowalrsjlLWenS69/UuYobfGCwgt6jPNhpRmXIM6LZ1Z728L9Ok3RJc7CCuNuM9
oFRTYcLt7Oh66Y7sm2u35llz37uSclnURBWb8HDVjo69vtHSmdA=
=34Y0
-----END PGP SIGNATURE-----

--w/OVG1VbdlyG0qaf--




Information forwarded to bug-guix@HIDDEN:
bug#74731; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Dec 2024 17:37:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 09 12:37:29 2024
Received: from localhost ([127.0.0.1]:55465 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tKhhI-0001fO-Lh
	for submit <at> debbugs.gnu.org; Mon, 09 Dec 2024 12:37:29 -0500
Received: from lists.gnu.org ([209.51.188.17]:50716)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1tKhhF-0001fC-Sv
 for submit <at> debbugs.gnu.org; Mon, 09 Dec 2024 12:37:27 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1tKhhF-0007Bk-54
 for bug-guix@HIDDEN; Mon, 09 Dec 2024 12:37:25 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1tKhhE-0007hr-Lg; Mon, 09 Dec 2024 12:37:24 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=fr0Vi6FaKLl2XCzXGyTtPjRwjKQBYLdBWzPyoG7vpSs=; b=jj1G2UuCsam323FTHZoA
 pXBA7cIJrc2AMv/YtA22jDR2oWmaw2d5Fqg/wkr0UALWO+dhqwxLXq/fnsNYyzpnt1wlEM78P8efi
 M/NVADHMsd/TbXFnrjytKDQEI5HVF1qk4xLfNAfsRgiLKgN4hv2nZagnhIh3ZEGWE0YXyAhadIDLY
 01VhXkYQ+Am4AaVO5MHjn0qGaMs22xsbxzIQlKbl+YKdL46+K4tOGhy3XDjf5tj5HZL0k4JOZL3oE
 KER3BemfTI6kFzj5jR3Jcuj2QfHZU92i6uVp4KSSV/4I/cO2RYB+3GK7g0WCvuO9eDI3F4+IJVuxM
 cT3XrPUAlU6g4Q==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Efraim Flashner <efraim@HIDDEN>
Subject: Re: bug#74731: guix/cpu should parse /sys/devices/system/cpu/modalias
In-Reply-To: <Z1VKB38Jsaw-RKtG@3900XT> (Efraim Flashner's message of "Sun, 8
 Dec 2024 09:25:59 +0200")
References: <Z1VKB38Jsaw-RKtG@3900XT>
Date: Mon, 09 Dec 2024 18:37:22 +0100
Message-ID: <87jzc8lpv1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
Cc: bug-guix@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello,

Efraim Flashner <efraim@HIDDEN> skribis:

> I saw a post by Marcan=C2=B9 of Asahi Linux the other day about not parsi=
ng
> /proc/cpuinfo and remembered that's what we're doing in (guix cpu).

I believe it initially mimicked what GCC does for =E2=80=98-march=3Dnative=
=E2=80=99, but
it does seem to be less exhaustive than /sys/devices/cpu/modalias.

I wonder if there are version/portability issues with the latter.

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#74731; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Dec 2024 07:26:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 08 02:26:17 2024
Received: from localhost ([127.0.0.1]:49503 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tKBgG-0000f2-SX
	for submit <at> debbugs.gnu.org; Sun, 08 Dec 2024 02:26:17 -0500
Received: from lists.gnu.org ([209.51.188.17]:36484)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <efraim.flashner@HIDDEN>) id 1tKBgD-0000er-7i
 for submit <at> debbugs.gnu.org; Sun, 08 Dec 2024 02:26:15 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <efraim.flashner@HIDDEN>)
 id 1tKBgB-0004pt-6w
 for bug-guix@HIDDEN; Sun, 08 Dec 2024 02:26:11 -0500
Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <efraim.flashner@HIDDEN>)
 id 1tKBg5-0008RC-QJ
 for bug-guix@HIDDEN; Sun, 08 Dec 2024 02:26:09 -0500
Received: by mail-wm1-x331.google.com with SMTP id
 5b1f17b1804b1-434e3953b65so7935255e9.1
 for <bug-guix@HIDDEN>; Sat, 07 Dec 2024 23:26:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1733642764; x=1734247564; darn=gnu.org;
 h=content-disposition:mime-version:mail-followup-to:message-id
 :subject:to:from:date:sender:from:to:cc:subject:date:message-id
 :reply-to; bh=u+HPtQUJCvpe37d7xPJzDLjpdnBoI2Qb8jXnbyrV7Vc=;
 b=JAxS1Pi804lPj7TTlQbSM58S4EpnAL1WFYmu7msM9Y4+S92seyzMb9EygssCZaBtsQ
 k8rwgftfaWWsg+vtZJIROE1m/YqQsmE0VgJKQWnP4BFUlUamIgHeH7CWKR67feHLhPNi
 6Hvt7leLyrZIC8HTQAMtGtt0QQeAJzMExfbwtZi7g6isfSpmL4Bcep6jiN2UPq3oGma2
 rNcdFxCsE2rj0rZ1h7ZKqDqXaJpmf0k//UI5rnwNlcsDf/la1RWWy8vBL4t5whKsCzhB
 UshPgieZvylsnCOUOVL9EkBq5iUh9aiZAGLio4SbfGYY8y5fbO+d89ZcuFLjvbfVCRbH
 3gzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1733642764; x=1734247564;
 h=content-disposition:mime-version:mail-followup-to:message-id
 :subject:to:from:date:sender:x-gm-message-state:from:to:cc:subject
 :date:message-id:reply-to;
 bh=u+HPtQUJCvpe37d7xPJzDLjpdnBoI2Qb8jXnbyrV7Vc=;
 b=HULCwQk9R8EoK7HovW4HdU5cPFHnueUuO4FR3QzGIlqInTIvJp28vLYcPPh3AJ+VI4
 /aM/u8V/thpkcnmD86L4ZfUGvQ7/CfJcS9b0KauYCynBcCwGz1NqwhzwNHaiG+J0tkuQ
 q8paHJywcywmpengokburBPyAo+2+2Fdo8sgqhQ9OSoTGfe4DJkQUU4xV0pAodQR61LG
 kUu67P+1mZanD9J1YXjYAk+0ssf9RqLCkc4ezB0DOn1yC6zYOSiiiTOnRQcKndxIO7C3
 EnW/w1pt206ZVFWwBIqQ5jHUZu05CfWvAFyo9H7LT3NPdn+gnjvOwkKQXK8Cc/srvx88
 4paQ==
X-Gm-Message-State: AOJu0Yz4ekGJcvN5J7TgvQ7xpMLokFrh6WR12ECzq9FBI70c94n3eAcI
 j1jnP6SZo5WHQ3P/oYKRvQK1JX30cgtIfDRP/Oh372W7eGVYdpNGRxd91e9O
X-Gm-Gg: ASbGnct+w73WZPxRL0k4g06Z35v7O0cvrYXWRNbuhrmmNmW3Rw7VVJGnr/QB7qA5iwD
 wrszZlElO7Lt1E0v/m1d+/orLLESK5B28Qr6lUWAc+RAMpt7sftd0ES53Z8iNfk0ydUFSOECcZZ
 VG02SRo2cAil9dCk13TBtKmobYYay54Fi2bx3UuGVk83Fq0CFAG2BI/V9NCbG2wfnDxs6fUJ4Ww
 9CJ5GDEmM+mQgbJeSnCQ6LxZ+hUsVVSvNByGkfPJs0LrS7ycw==
X-Google-Smtp-Source: AGHT+IHnk2pW6XzJwwLrtQe54Rukp0BctCRgn/urjCm4Z13M9gnIqL6285YOEcFc2OkmLnH22XUCcw==
X-Received: by 2002:a05:600c:46c7:b0:434:9c1b:b36a with SMTP id
 5b1f17b1804b1-434ddeb51femr69751185e9.13.1733642763703; 
 Sat, 07 Dec 2024 23:26:03 -0800 (PST)
Received: from localhost ([31.210.180.118]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3861ecf4087sm9500029f8f.5.2024.12.07.23.26.01
 for <bug-guix@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 07 Dec 2024 23:26:02 -0800 (PST)
Date: Sun, 8 Dec 2024 09:25:59 +0200
From: Efraim Flashner <efraim@HIDDEN>
To: bug-guix@HIDDEN
Subject: guix/cpu should parse /sys/devices/system/cpu/modalias
Message-ID: <Z1VKB38Jsaw-RKtG@3900XT>
Mail-Followup-To: Efraim Flashner <efraim@HIDDEN>, bug-guix@HIDDEN
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="cQe8am69YhIDeLD5"
Content-Disposition: inline
X-PGP-Key-ID: 0x41AAE7DCCA3D8351
X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc
X-PGP-Fingerprint: A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Received-SPF: pass client-ip=2a00:1450:4864:20::331;
 envelope-from=efraim.flashner@HIDDEN; helo=mail-wm1-x331.google.com
X-Spam_score_int: -19
X-Spam_score: -2.0
X-Spam_bar: --
X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
 FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)


--cQe8am69YhIDeLD5
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I saw a post by Marcan=C2=B9 of Asahi Linux the other day about not parsing
/proc/cpuinfo and remembered that's what we're doing in (guix cpu).

I've included a couple of dumps below and some notes regarding future
implementation:

// My machine
(ins)efraim@3900XT ~$ cat /sys/devices/system/cpu/modalias
cpu:type:x86,ven0002fam0017mod0071:feature:,0000,0001,0002,0003,0004,0005,0=
006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0017,0018,0019,0=
01A,001C,0020,0021,0022,0023,0024,0025,0026,0027,0028,0029,002B,002C,002D,0=
02E,002F,0030,0031,0034,0036,0037,0038,0039,003A,003B,003D,0064,0068,006E,0=
070,0074,0075,0076,0078,0079,007A,007C,007D,0080,0081,0083,0089,008C,008D,0=
093,0094,0095,0096,0097,0099,009A,009B,009C,009D,009E,00C0,00C1,00C3,00C4,0=
0C5,00C6,00C7,00C8,00C9,00CA,00CC,00CD,00D1,00D6,00D7,00D8,00DA,00DC,00DD,0=
0DE,00E2,00E4,00E6,00E8,00EA,00ED,00F0,00F1,00F2,00F3,00F5,00FA,00FB,00FC,0=
10F,0120,0123,0125,0127,0128,012C,012F,0132,0133,0134,0137,0138,013D,0140,0=
141,0142,0160,0161,0162,0163,0165,016C,016E,016F,0170,0178,017C,01A0,01A1,0=
1A2,01A4,01A6,01A9,01AA,01AC,01AD,01AF,01B2,01B3,01B8,01C2,01E0,01E1,01E2,0=
1E3,01E4,01E5,01E6,01E7,01EA,01EB,01EC,01ED,01EF,01F0,01F1,01F4,0202,0216,0=
220,0221,0223,0224,0261,0262,0263,0270,0282,029C

// Berlin, aka ci.guix.gnu.org
(ins)efraim@berlin ~$ cat /sys/devices/system/cpu/modalias
cpu:type:x86,ven0002fam0017mod0001:feature:,0000,0001,0002,0003,0004,0005,0=
006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0017,0018,0019,0=
01A,001C,0020,0021,0022,0023,0024,0025,0026,0027,0028,0029,002B,002C,002D,0=
02E,002F,0030,0031,0034,0036,0037,0038,0039,003A,003B,003D,0064,0068,006E,0=
070,0074,0075,0078,0079,007A,007B,007C,007D,0080,0081,0083,0089,008C,008D,0=
093,0094,0096,0097,0099,009A,009B,009C,009D,009E,00C0,00C1,00C2,00C3,00C4,0=
0C5,00C6,00C7,00C8,00C9,00CC,00CD,00D1,00D6,00D7,00D8,00DA,00DC,00DD,00E2,0=
0E8,00EA,00ED,00F1,00F3,00F5,00F8,00FA,00FC,010F,0120,0123,0125,0127,0128,0=
132,0133,0134,0137,013D,0140,0141,0142,0143,0165,016C,016E,016F,0170,0178,0=
17F,01A0,01A1,01A2,01AC,01C2,01E0,01E1,01E2,01E3,01E4,01E5,01E6,01E7,01EA,0=
1EB,01EC,01ED,01EF,01F0,0220,0221,0223,0224,0261,0262,0263,0282,029C

// pine64, kickstarter addition
(ins)efraim@3900XT ~$ ssh pine64 cat /sys/devices/system/cpu/modalias
cpu:type:aarch64:feature:,0000,0001,0002,0003,0004,0005,0006,0007,000B

// rock64
(ins)efraim@3900XT ~$ ssh rock64 cat /sys/devices/system/cpu/modalias
cpu:type:aarch64:feature:,0000,0001,0002,0003,0004,0005,0006,0007,000B

// raspberry pi 5b
(ins)efraim@3900XT ~$ ssh ubuntu.unicorn-typhon.ts.net cat /sys/devices/sys=
tem/cpu/modalias
efraim@HIDDEN: Permission denied (publickey).
(ins)efraim@3900XT ~$ ssh ubuntu@HIDDEN cat /sys/devi=
ces/system/cpu/modalias
cpu:type:aarch64:feature:,0000,0001,0002,0003,0004,0005,0006,0007,0008,0009=
,000A,000B,000C,000F,0010,0014

// power9 machine from OSU for ci.guix.gnu.org
(ins)efraim@3900XT ~$ ssh guixp9 cat /sys/devices/system/cpu/modalias
cpu:type:power9:feature:,0001,0006,0007,0008,000A,000D,000E,001A,001B,001C,=
001E,001F,0034,0035,0036,0037,0039,003A,003B,003C,003D,003F

// rpi 1b
(ins)efraim@3900XT ~$ ssh 192.168.68.50 cat /sys/devices/system/cpu/modalias
cpu:type:v6l:feature:,0001,0002,0004,0006,0007,0008,000F

// hifive unmatched, riscv64
(ins)efraim@3900XT ~$ ssh 192.168.68.51 cat /sys/devices/system/cpu/modalias
cat: /sys/devices/system/cpu/modalias: No such file or directory

// macbook 4,1 I think
(ins)efraim@3900XT ~$ ssh israel.unicorn-typhon.ts.net cat /sys/devices/sys=
tem/cpu/modalias
cpu:type:x86,ven0000fam0006mod0017:feature:,0000,0001,0002,0003,0004,0005,0=
006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0015,0016,0017,0=
018,0019,001A,001C,001D,001F,002B,0034,003D,0068,006B,006C,006D,006F,0070,0=
072,0074,0075,0079,007C,0080,0082,0083,0084,0085,0087,0088,0089,008D,008E,0=
08F,0093,00C0,00EB,00ED,00F3,00FD,00FF,0100,0101,0102,0104,0165,016C,0172,0=
1C0

arch/x86/include/asm/cpufeatures.h
list of CPU features for x86 and x86_64

I haven't been able to find the table for other architectures yet.

=C2=B9 https://social.treehouse.systems/@marcan/113548772069263164

--=20
Efraim Flashner   <efraim@HIDDEN>   =D7=90=D7=A4=D7=A8=D7=99=D7=9D =
=D7=A4=D7=9C=D7=A9=D7=A0=D7=A8
GPG key =3D A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

--cQe8am69YhIDeLD5
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmdVSgMACgkQQarn3Mo9
g1F0DxAAr0NcsqlfxewgCVd0TsOaPOkT5YPAHDVxZU7SRRoUi/G8dWVnYW3njh5a
FGyxfUwKElpDgfz9xUOfP1J/dw3iaktW7Bzd/pY7vL8ZpaIeaft0HzVBLX2dHF3q
lwExnBcDq08S53k6RuJyNr7GvOTw7jfN+Ss7AWOGEOWBOJ6Fa41wmnEdiHth1v5X
PuTlWeeRVWU5WKE/OgNMmuoqSrKXzu6ImOl6S3mjXf4MkEFdd2f2KXv1xiJpuikb
7VdnGeRvxCnqvrDxKaxf+gxhzNLN4uM9ZrjFxRpcFpVx6oighUmavIB+AgmLhi1c
PGGPB0NJRuP7qVHf7/wssQEsVzTjBoHIKmZf15E1T7EVxBoXvnJAwN1x0ZGRqzFK
ODIMoGUpu2/TqU+M37kWOfxkWABwN1ioylRas1duL5L/wwVnN/5JCu04PdHq+K5Z
zxpUiqCIOjNeu2U/Hma3rmAZ3hp3N1kXcrqtPAiYFHE2y7mgnT5vfjnmpeHYsjWM
RCcgpoKThbLHgDACDIPxUfEzKqiZl7tvft5T5W9HRA26AOKleiPTYSry8EmlfH1M
A/ByfX1SWvYPvdqN7Zrzn4tndDU3i3wpnKIXIMBbs7Dlts1TANPQm5vfSy1+OOAc
ywSYg7/Q2jm6OWqPfdgokfs9mQcUs8CJ5GnZS0M60Du7cqjw4cQ=
=zBN/
-----END PGP SIGNATURE-----

--cQe8am69YhIDeLD5--




Acknowledgement sent to Efraim Flashner <efraim@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#74731; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.