Skip to content

x86: detect Linux userspace ISA extensions - #196

Merged
nihui merged 1 commit into
masterfrom
x86-linux-userspace-isa
Sep 15, 2026
Merged

nihui merged 1 commit into
masterfrom
x86-linux-userspace-isa

Conversation

@nihui

@nihui nihui commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

Expand x86 userspace ISA detection based on features currently recognized by upstream Linux/KVM, while keeping ruapu's existing execute-and-trap style.

This revision intentionally keeps the scope conservative: probes are implemented as direct RUAPU_INSTCODE() byte sequences only. Features that require scratch-buffer wrappers, ABI-specific helper functions, process-state changes, special devices, unusual naming special cases, overlapping encodings that cannot uniquely identify the Linux feature, or have ambiguous exception/compatibility semantics are deferred.

New probes include:

  • legacy/vendor: cmov, lahflm, tbm, rdpru
  • cache/data movement: clflush, clflushopt, clwb, movbe, movrs (x86-64 only)
  • scalar/general: pclmulqdq, fsgsbase (x86-64 only), adx, pku, rdpid, serialize
  • vector: avx512pf, avx512bitalg, avx512vpopcntdq, avx512vp2intersect, avx512bmm, vpclmulqdq
  • x86-64: apx

The previous helper-heavy probes for cx8/cx16, xsave*, movdiri/movdir64b, clzero, cmpccxadd, newer AMX subsets, and VIA PadLock are removed from this PR for now. Likewise, probes with questionable execute-and-trap semantics or platform-dependent faults such as cldemote, xgetbv1, waitpkg, tsxldtrk, rtm, tsc, and rdtscp are intentionally deferred.

mmxext is also deferred because the selected PAVGB MMX encoding is shared with SSE1-capable processors and therefore cannot uniquely represent Linux X86_FEATURE_MMXEXT under ruapu's execute-and-trap model. 3dnow and 3dnowext are deferred because their public names are not valid C identifiers and would require special-case internal naming/mapping.

The x86 probe list is organized by ISA family, and README.md, main.c, and g_ruapu_isa_map are kept in sync. The branch is squashed to one commit.

@nihui
nihui force-pushed the x86-linux-userspace-isa branch 3 times, most recently from f08564d to 0a1d109 Compare September 15, 2026 10:36
@nihui
nihui force-pushed the x86-linux-userspace-isa branch from 5c68df6 to acb9108 Compare September 15, 2026 11:03
@nihui
nihui merged commit 8386c22 into master Sep 15, 2026
13 checks passed
@nihui
nihui deleted the x86-linux-userspace-isa branch September 15, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant