Page MenuHomeFreeBSD

linuxkpi: Add x86 CPU ID matching functions and macros
ClosedPublic

Authored by dumbbell on Jun 20 2026, 12:02 PM.
Referenced Files
Unknown Object (File)
Tue, Sep 22, 1:59 AM
Unknown Object (File)
Sat, Sep 19, 6:50 PM
Unknown Object (File)
Wed, Sep 16, 10:35 AM
Unknown Object (File)
Fri, Sep 11, 7:06 AM
Unknown Object (File)
Fri, Sep 11, 1:34 AM
Unknown Object (File)
Thu, Sep 10, 7:16 PM
Unknown Object (File)
Tue, Sep 8, 10:26 PM
Unknown Object (File)
Mon, Sep 7, 6:23 PM
Subscribers

Details

Summary

There are two parts that go together:

  • X86_MATCH_VFM() to declare a matching pattern
  • x86_match_cpu() to check if the current CPU matches one of the patterns in an array.

The i915 DRM driver started to use this in Linux 6.14.

This is part of the update of DRM drivers to Linux 6.14.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/compat/linuxkpi/common/src/linux_compat.c
3111

is this a copy-paste of above?

bz added a subscriber: bz.

Does this compile on arm64 or does it need #if defined(amd64) || defined(i386) guards?

Also adding kib for the field checks as I do not know them.

sys/compat/linuxkpi/common/include/linux/mod_devicetable.h
98

Is this a good choice for max stepping, while x86_cpu_id uses uint16_t for the steppings member? Was the constant copied from Linux?

sys/compat/linuxkpi/common/src/linux_compat.c
3096
3098

'{' should be on the previous line, by style,

3112
dumbbell added inline comments.
sys/compat/linuxkpi/common/include/linux/mod_devicetable.h
98

Yes, it is the same value on Linux 6.15.

dumbbell marked an inline comment as done.

Address feedback from @kib

This revision is now accepted and ready to land.Thu, Sep 10, 11:44 PM