abrown opened PR #7513 from abrown:pku-intel-check
to bytecodealliance:main
:
In #7446 I disabled MPK support temporarily due to failures in CI runs. Looking into this further in #7445, I discovered that it is due to how
has_cpuid_bit_set
works on different x86 machines: Intel'sCPUID
instruction reports support for MPK in a certain leaf bit, AMD does it some other (unknown?) way. The CI problem boiled down to occasional runs on AMD machines that would fail withSIGILL
because the AMD machine reported that it had MPK support when it really did not. This change fixes the issue by first checking if the CPU vendor string isGenuineIntel
before inspecting the MPKCPUID
leaf bit.Closes #7445.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
abrown requested fitzgen for a review on PR #7513.
abrown requested wasmtime-core-reviewers for a review on PR #7513.
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
If you want to be super fancy this can be replaced with
u32::from_le_bytes(*b"Genu")
abrown submitted PR review.
abrown created PR review comment:
I like it... self-documenting code.
abrown updated PR #7513.
abrown has enabled auto merge for PR #7513.
abrown merged PR #7513.
Last updated: Nov 22 2024 at 17:03 UTC