morello: uaccess: Disable asm_goto_output #28
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 282 lines diff across 3 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.338
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #28"
general
weight: 0.35
heshamelmatary
The use of asm_goto_output in __get_mem_asm allows the compiler to optimise the success path by branching directly out of inline assembly to a C label on error. However, this breaks execution state guarantees on Morello.
When a memory fault triggers on a user-space load, the hardware exception handler uses the exception table to rewrite the Program Counter. If the entry targets the C label directly, execution resumes there immediately—completely bypassing the trailing __ASM_UACCESS_AFTER macro inside the block.
On Morello, __ASM_UACCESS_BEFORE and __ASM_UACCESS_AFTER manage critical architectural transitions, such as switching between A64 and C64 (Capability) execution modes via PSTATE.C64. Bypassing the cleanup path leaves the processor stuck in C64 mode, corrupting subsequent A64 instruction streams and causing immediate kernel panics.
Fix this by gating asm_goto_output out when Morello is enabled. Fall back to a traditional linear asm volatile block that uses an explicit, sequential landing pad placed right before __ASM_UACCESS_AFTER. This guarantees that execution state cleanup runs on both success and fault paths before checking the error code in standard C.
I also experimented with the following alternative solution that does still use _asm_goto_output_ that seems to pass the same number of tests with this PR and doesn't trigger panics:
----------------------------------------------------------
It is a bit hacky but it does force this block to use
__ASM_UACCESS_AFTER