Skip to content

arch: arm: clear r7 to match aarch64 smp implementation #90051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juickar
Copy link
Contributor

@juickar juickar commented May 16, 2025

add mov r7, #0 as aarch64 implementation uses wzr which returns 0 on read but r7 might have an undefined value after a reset.

https://github.com/zephyrproject-rtos/zephyr/blob/main/arch/arm/core/cortex_a_r/reset.S :

    /* some core already won, release */
    mov r7, #0
    strb r7, [r4, r2]
    b _secondary_core

    /* suggest current core then release */
1:  str r1, [r0, #BOOT_PARAM_MPID_OFFSET]
+   mov r7, #0
    strb r7, [r4, r2]
    dmb

https://github.com/zephyrproject-rtos/zephyr/blob/main/arch/arm64/core/reset.S :

	/* some core already won, release */
	strb	wzr, [x4, x2]
	b	secondary_core

	/* suggest current core then release */
1:	str	x1, [x0, #BOOT_PARAM_MPID_OFFSET]
	strb	wzr, [x4, x2]
	dmb	ish

@github-actions github-actions bot added size: XS A PR changing only a single line of code area: ARM ARM (32-bit) Architecture labels May 16, 2025
add mov r7, #0 as aarch64 implementation uses wzr which returns 0
on read but r7 might have an undefined value after a reset.

Signed-off-by: Julien Racki <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants