x86: detect Linux userspace ISA extensions - #196
Merged
Merged
Conversation
nihui
force-pushed
the
x86-linux-userspace-isa
branch
3 times, most recently
from
September 15, 2026 10:36
f08564d to
0a1d109
Compare
nihui
force-pushed
the
x86-linux-userspace-isa
branch
from
September 15, 2026 11:03
5c68df6 to
acb9108
Compare
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
cmov,lahflm,tbm,rdpruclflush,clflushopt,clwb,movbe,movrs(x86-64 only)pclmulqdq,fsgsbase(x86-64 only),adx,pku,rdpid,serializeavx512pf,avx512bitalg,avx512vpopcntdq,avx512vp2intersect,avx512bmm,vpclmulqdqapxThe 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 ascldemote,xgetbv1,waitpkg,tsxldtrk,rtm,tsc, andrdtscpare intentionally deferred.mmxextis also deferred because the selectedPAVGBMMX encoding is shared with SSE1-capable processors and therefore cannot uniquely represent LinuxX86_FEATURE_MMXEXTunder ruapu's execute-and-trap model.3dnowand3dnowextare 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, andg_ruapu_isa_mapare kept in sync. The branch is squashed to one commit.