Skip to content

[PATCH] arm: mediatek: fix secondary CPU boot on Thumb-2 kernels with Clang - #70

Draft
akku1139 wants to merge 1 commit into
mainlinefrom
patch/mediatek-platsmp-fix-clang-thumb2
Draft

[PATCH] arm: mediatek: fix secondary CPU boot on Thumb-2 kernels with Clang#70
akku1139 wants to merge 1 commit into
mainlinefrom
patch/mediatek-platsmp-fix-clang-thumb2

Conversation

@akku1139

Copy link
Copy Markdown
Member

No description provided.

When building with CONFIG_THUMB2_KERNEL=y and Clang, secondary CPUs
fail to come online with "CPU1: failed to come online". The address
written to the jump register has bit 0 set, causing the secondary CPU
to start in Thumb mode.

secondary_startup_arm is ARM-mode code (.arm) and, on a Thumb-2 kernel,
expects to be entered in ARM mode in order to switch to Thumb via the
standard sequence at that label. Starting in Thumb mode causes the CPU
to execute ARM instructions as Thumb, resulting in an immediate crash.

Clear bit 0 of the entry address so the CPU always starts in ARM mode.

Tested on Lenovo YOGA Tablet 10 (Wi-Fi).

Fixes: 0cda070 ("ARM: mediatek: add smp bringup code")
Assisted-by: DeepSeek:deepseek-v4-pro
Cc: stable@vger.kernel.org
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
@akku1139

Copy link
Copy Markdown
Member Author

@akku1139

Copy link
Copy Markdown
Member Author

llvm/llvm-project#211376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant