logoalt Hacker News

josephgyesterday at 7:48 AM6 repliesview on HN

> - Intel's technical docs will say "if CPUID leaf 0x3aa asserts bit 63 then the CPU is affected". (There is no database for this you can only find it out by actually booting one up).

I’m doing some OS work at the moment and running into this. I’m really surprised there’s no caniuse.com for cpu features. I’m planning on requiring support for all the features that have been in every cpu that shipped in the last 10+ years. But it’s basically impossible to figure that out. Especially across Intel and amd. Can I assume apic? Iommu stuff? Is acpi 2 actually available on all CPUs or do I need to have to have support for the old version as well? It’s very annoying.


Replies

johncolanduoniyesterday at 11:41 AM

Even more fun is that some of those (IOMMU and ACPI version) depend on motherboard/firmware support. Inevitably there is some bargain-bin board for each processor generation that doesn’t support anything that isn’t literally required for the CPU/chipset to POST. For userspace CPU features the new x86_64-v3/v4 profiles that Clang/LLVM support are good Schelling points, but they don’t cover e.g. page table features.

Windows has specific platform requirements they spell out for each version - those are generally your best bet on x86. ARM devs have it way worse so I guess we shouldn’t complain.

show 1 reply
opanyesterday at 10:25 PM

CPU Monkey had some neat info like whether a CPU had AV1 hwdec/hwenc, then they redesigned their site and that info is gone for some reason. I think it was a year or less between finding their site and them ruining it.

https://web.archive.org/web/20250616224354/https://www.cpu-m...

https://www.cpu-monkey.com/en/cpu-amd_ryzen_7_pro_8840u

A nice reminder to stick any page you find useful in the wayback machine and/or save a local copy.

throw0101ayesterday at 1:23 PM

> I’m planning on requiring support for all the features that have been in every cpu that shipped in the last 10+ years. But it’s basically impossible to figure that out.

The easiest thing would probably to specify the need for "x86-64-v3":

* https://en.wikipedia.org/wiki/X86-64#Microarchitecture_level...

RHEL9 mandated "x86-64-v2", and v3 is being considered for RHEL10:

> The x86-64-v3 level has been implemented first in Intel’s Haswell CPU generation (2013). AMD implemented x86-64-v3 support with the Excavator microarchitecture (2015). Intel’s Atom product line added x86-64-v3 support with the Gracemont microarchitecture (2021), but Intel has continued to release Atom CPUs without AVX support after that (Parker Ridge in 2022, and an Elkhart Lake variant in 2023).

* https://developers.redhat.com/articles/2024/01/02/exploring-...

show 2 replies
baqyesterday at 7:55 AM

I’m pretty sure the number of people at Intel who can tell you offhandedly the answer to your questions about only Intel processors is approximately zero give or take couple. Digging would be required.

If you were willing to accept only the relatively high power variants it’d be easier.

ack_completeyesterday at 8:14 PM

This is unfortunately the same for GPUs. The graphics APIs expose capability bits or extensions indicating what features the hardware and driver supports, but the graphics vendors don't always publish documentation on what generations of their hardware support various features, so your program is expected to dynamically adapt to arbitrary combinations of features. This is no longer as bad as it used to be due to consolidation in the graphics market, but people still have to build ad-hoc crowd sourced databases of GPU caps bits.

It's also not monotonic, on both CPU and GPU sides features can go away later because either due to a hardware bug or the vendor lost interest in supporting it.

bombcaryesterday at 6:21 PM

Even defining "shipped in the last 10 years" is tricky - because does that mean released or final shipment from the factory or ?

You're often better picking a subset of CPU features you want to use and then sampling to see if it excludes something important.

show 1 reply