← Back to Pull requests

morello: uaccess: Disable asm_goto_output #28

Closed
unknown closed this pull request without merging on Jun 08, 2026 14:00 UTC
View on GitHub
unknown unknown commented on May 30, 2026 13:51 UTC
Author

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:

----------------------------------------------------------

#define __get_mem_asm(load, reg, x, addr, label, type)       \
  asm_goto_output(                                           \
  __ASM_UACCESS_BEFORE                                       \
  "1: " load "  " reg "0, [%1]\n"                            \
  __ASM_UACCESS_AFTER                                        \
  ".pushsection .text.fixup, \"ax\"\n"                       \
  "2: " __ASM_UACCESS_AFTER "\n"                             \
  "   b %l2\n"                                               \
  ".popsection\n"                                            \
  _ASM_EXTABLE_##type##ACCESS(1b, 2b)                        \
  : "=r" (x)                                                 \
  : "r" (addr) : : label)

It is a bit hacky but it does force this block to use __ASM_UACCESS_AFTER

Diff: 282 lines (+211 / -71) across 3 files Reviewer: heshamelmatary Review duration: 12968m
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
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.7% (MEDIUM) · Higher = larger blast radius
39.7%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.7% · Safe to merge
15.7%