← Back to Pull requests

portable: remove stray installer URL from IAR TrustZone non-secure ports #1492

Closed
unknown closed this pull request without merging on Oct 16, 2026 14:35 UTC
View on GitHub
unknown unknown commented on Sep 14, 2026 08:13 UTC
Author

Problem

A stray IAR installer download URL sits outside the comment delimiters in the
restore_special_regs section of the IAR TrustZone non-secure ports:

        ldmia r2!, {r0, r3, lr}             http://files.iar.com/ftp/pub/box/bxarm-9.60.3.deb/* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */

Because / appears after the URL, the assembler reads the bare URL as an operand
of the preceding ldmia and aborts:

Error: garbage following instruction -- `ldmia r2!,{r0,r3,lr} http:'

The line sits outside the #if ( configENABLE_PAC == 1 ) block, which ends on the
preceding line, so it is not limited to PAC-enabled builds. It is, however, inside the
#else branch of #if ( configENABLE_MPU == 1 ): the breakage is on every non-MPU
build
, independently of configENABLE_PAC, while MPU builds never compile the line.

(Corrected — an earlier revision of this description said "breaks every configuration
of these ports". That was too strong; the guard stack for line 476 is
#else of #if ( configENABLE_MPU == 1 ) and nothing else.)

Scope

Issue #1480 reports this for portable/IAR/ARM_CM33/non_secure/portasm.s.

A tree-wide scan of main (8be86d4) finds the stray URL in 7 files, all at
line 476. This PR fixes all seven:

  • portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s

  • portable/IAR/ARM_CM33/non_secure/portasm.s

  • portable/IAR/ARM_CM35P/non_secure/portasm.s

  • portable/IAR/ARM_CM52/non_secure/portasm.s

  • portable/IAR/ARM_CM55/non_secure/portasm.s

  • portable/IAR/ARM_CM85/non_secure/portasm.s

  • portable/IAR/ARM_STAR_MC3/non_secure/portasm.s
  • The first revision covered only the last six, leaving
    portable/IAR/ARM_CM33/non_secure/portasm.s to #1485. Per @jefftenney's review
    comment that split no longer makes sense: portable/ARMv8M/copy_files.py derives the
    non-secure IAR ports from portable/ARMv8M/non_secure/portable/IAR/ARM_CM33 — the whole
    directory for ARM_CM33 itself, file by file for the derivatives — so running the script
    after the first commit produces the ARM_CM33 fix as well. It is included here and
    #1485 becomes redundant.

    Note there are two distinct CM33 assembly files in the tree, both affected, and they
    are easy to confuse:

    | path | role |
    |---|---|
    | portable/IAR/ARM_CM33/non_secure/portasm.s | generated copy |
    | portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s | source of truth |

    Fix

    The stray URL is deleted, and the comment keeps its original text and column alignment:

    -        ldmia r2!, {r0, r3, lr}             http://files.iar.com/ftp/pub/box/bxarm-9.60.3.deb/* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */
    +        ldmia r2!, {r0, r3, lr}             /* Read from stack - r0 = xSecureContext, r3 = PSPLIM and LR restored. */
    

    This matches the unaffected sibling port portable/IAR/ARM_CM23/non_secure/portasm.s
    (line 444), which carries the same comment text without any URL. Optionally the URL
    could be kept
    inside the comment instead, as #1485 does — either form assembles; I
    removed it because it is a meaningless installer link.

    Origin

    Commit 78e0cc7 ("ARMv8.1-M: Add task dedicated PAC key support", #1195) introduced the
    URL into CM33, CM35P, CM55, CM85 and the ARMv8M non-secure port. The CM52 (#1334) and
    STAR-MC3 (#1363) ports were later created from an already-affected portasm.s and
    inherited it.

    Verification

    Assembled with arm-none-eabi-gcc 13.3.1 20240614 (GNU Tools for STM32 13.3.rel1),
    -march=armv8.1-m.main -mthumb -mfpu=fpv5-d16. IAR's own directives
    (PUBLIC / EXTERN / SECTION / THUMB / END) were translated 1:1 to GNU
    equivalents so that the only difference between the "before" and "after" inputs is the
    one comment line, making the result attributable to it. The translated pair still
    diffs in exactly that single line.

    Baseline (known-good sibling, proves the harness accepts a healthy file):

    portable/IAR/ARM_CM23/non_secure/portasm.s   ->  assembles OK
    

    All seven files in this PR, over configENABLE_MPU / configENABLE_PAC:

    | file | MPU=0, PAC=0 | MPU=1 |
    |---|---|---|
    | portable/IAR/ARM_CM33/non_secure/portasm.s | error → OK | not compiled either way |
    | portable/IAR/ARM_CM35P/non_secure/portasm.s | error → OK | not compiled either way |
    | portable/IAR/ARM_CM52/non_secure/portasm.s | error → OK | not compiled either way |
    | portable/IAR/ARM_CM55/non_secure/portasm.s | error → OK | not compiled either way |
    | portable/IAR/ARM_CM85/non_secure/portasm.s | error → OK | not compiled either way |
    | portable/IAR/ARM_STAR_MC3/non_secure/portasm.s | error → OK | not compiled either way |
    | portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portasm.s | error → OK | not compiled either way |

    RESULT: 7/7 files fail before the change and assemble cleanly after it
            (configENABLE_MPU=0); 0 stray URLs remaining in the tree.
    

    Caveats, stated plainly:

  • This is GNU as, not IAR iccarm (no IAR licence available here). Both reject a

  • bare token after an instruction, and the reporter of #1480 reproduced the failure on
    IAR ARM 9.70.2, so the defect and the fix are cross-confirmed — but this is not an
    IAR build.
  • The PAC-enabled non-MPU combination could not be exercised: GNU as rejects the

  • PAC_KEY_
    mrs/msr operands on this target, before it ever reaches line 476.

    Note on CI

    .github/workflows/kernel-demos.yml only builds the CORTEX_MPS2_QEMU_IAR_GCC demo,
    which is compiled with GCC. The IAR ports are not built by CI at all, which is how this
    slipped through. Adding an assembler-only syntax check for these ports would be a
    separate, larger change — happy to look at it if you think it is worth doing.

    Relates to #1480.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: TomasGalbickaNXP Review duration: 46462m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1492"
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 20.5% · Safe to merge
    20.5%