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: Luca
Subject: Re: [RFC PATCH hurd] Add partial /proc/cpuinfo implementation
Date: Wed, 8 Jan 2025 23:42:17 +0100

Il 08/01/25 22:58, Diego Nieto Cid ha scritto:
On Wed, Jan 08, 2025 at 10:25:41AM +0100, Luca wrote:
Il 08/01/25 02:30, dnietoc@gmail.com ha scritto:
+
+static char * features_edx[] =
+  {
+    "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", "cx8", "apic",
+    NULL, "sep", "mtrr", "pge", "mca", "cmov", "pat", "pse36", "psn", "clfsh",
+    NULL, "ds", "acpi", "mmx", "fxsr", "sse", "sse2", "ss", "htt", "tm",
+   "ia64", "pbe"
+  };
+
+static char * features_ecx[] =
+  {
+    "sse3", "pclmulqdq", "dtes64", "monitor", "ds-cpl", "vmx", "smx", "est",
+    "tm3", "ssse3", "cnxt-id", "sdbg", "fma", "cx16", "xtpr", "pdcm",
+    NULL, "pcid", "dca", "sse4_1", "sse4_2", "x2apic", "movbe", "popcnt",
+   "tsc_deadline", "aes_ni", "xsave", "osxsave", "avx", "f16c", "rdrnd", 
"hypervisor"
+  };

Are these names reflecting the gcc header cpuid.h? It seems there is some
difference with e.g. Linux naming (rdrnd vs rdrand), I'm not sure what would
be the best reference.


These were taken from the Wikipedia article and replaced some dots and dashes
with underscores.

I didn't know if looking at Linux code would break some licensing stuff :/
and the output of /proc/cpuinfo didn't tell me what bit to look for in each
case.

From a quick check it seems the names on the publicly available Intel manuals are the same as Linux procinfo, (just uppercase), it might be worth to check what other OSs use, like some BSDs, if they have such file.

About licensing, I would be a bit surprised if these flag names couldn't be used in GPL source code, if they come from the manuals, but I am not an expert on this.

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.


Luca



reply via email to

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