Fix VEX.128 crypto instruction feature gates #849
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.71) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.71 · 507 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.373
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.071
Real PR Conversation Timeline
1 comments
"Review active on #849"
general
weight: 0.35
stlintel
Problem
The VEX.128 forms of the AES and carry-less multiplication instructions
require the corresponding legacy crypto feature in addition to AVX.
Specifically, the VEX.128 AES instructions require
CPUID.01H:ECX.AES[25] and AVX, while VEX.128
VPCLMULQDQrequiresCPUID.01H:ECX.PCLMULQDQ[1] and AVX.
Their seven Bochs opcode declarations currently use only
BX_ISA_AVXas their feature guard. Decoder initialization therefore retains the
execution handlers when AVX is available but AES and PCLMULQDQ are not
advertised.
For example, with
corei7_skylake_xandexclude_features=aes_pclmulqdq:The newer VAES and VPCLMULQDQ feature is used for wider vector forms;
it does not replace the AES or PCLMULQDQ requirement for these VEX.128
encodings.
Fix
Use
BX_ISA_AES_PCLMULQDQas the feature guard for the six VEX.128 AESdeclarations and the VEX.128
VPCLMULQDQdeclaration, while retainingtheir existing
BX_PREPARE_AVXchecks.Bochs models AES and PCLMULQDQ together under this extension and already
uses it for the corresponding legacy instruction declarations. The
feature guard now checks crypto availability, while
BX_PREPARE_AVXcontinues to enforce AVX and its architectural state requirements.
Architectural reference
The Intel® 64 and IA-32 Architectures Software Developer’s Manual,
Volume 2, specifies AES together with AVX for the VEX.128 AES encodings
and PCLMULQDQ together with AVX for the VEX.128
VPCLMULQDQencoding.The instructions raise #UD when their required CPUID feature is absent.
Validation
The affected 32- and 64-bit decoder objects were forcibly rebuilt,
followed by a successful full Bochs build:
A temporary long-mode CPL3 probe tested all seven VEX.128 encodings
under three feature configurations.
With AVX enabled and
aes_pclmulqdqexcluded:With AVX, AES, and PCLMULQDQ enabled, all seven instructions continued
to execute:
Finally, a control test verified that the fix does not make these VEX
encodings available on processors without AVX.
AES and PCLMULQDQ were enabled, but AVX was disabled. XCR0 contained
only x87 and SSE state (
0x3), with no AVX state enabled:All seven instructions correctly raised #UD:
This confirms that
BX_ISA_AES_PCLMULQDQenforces crypto availability,while the retained
BX_PREPARE_AVXchecks continue to enforce theindependent AVX and AVX-state requirements.