From: Michael Ellerman <mpe@kernel.org>
To: cp0613@linux.alibaba.com, pjw@kernel.org, anup@brainfault.org,
andrew.jones@oss.qualcomm.com, guoren@kernel.org
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] riscv: smp: Align secondary_start_sbi to 4 bytes
Date: Wed, 15 Apr 2026 12:06:28 +1000 [thread overview]
Message-ID: <d38e585f-554a-4f81-8136-981870fe3383@kernel.org> (raw)
In-Reply-To: <20260413132009.133752-1-cp0613@linux.alibaba.com>
On 13/4/2026 23:20, cp0613@linux.alibaba.com wrote:
> From: Chen Pei <cp0613@linux.alibaba.com>
>
> During SMP boot, the secondary_start_sbi address is passed to the
> slave core via sbi_hsm_hart_start. In OpenSBI, this address is
> written to STVEC in sbi_hart_switch_mode.
...
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index 9c99c5ad6fe8..9f33be6260e1 100644
> --- a/arch/riscv/kernel/head.S
> +++ b/arch/riscv/kernel/head.S
> @@ -127,6 +127,7 @@ relocate_enable_mmu:
> #endif /* CONFIG_MMU */
> #ifdef CONFIG_SMP
> .global secondary_start_sbi
> + .align 2
> secondary_start_sbi:
> /* Mask all interrupts */
> csrw CSR_IE, zero
Minor nit, but IMHO .balign is preferable in new code. It always byte
aligns, whereas .align has different meanings across architectures, and
on some arches (including riscv) requires the reader to do the math to
convert to a byte alignment.
These days there's also the SYM_CODE_START etc. macros defined via
linkage.h, which use __ALIGN from arch/riscv/include/asm/linkage.h,
which is already .balign 4.
cheers
next prev parent reply other threads:[~2026-04-15 2:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 13:20 [PATCH v2] riscv: smp: Align secondary_start_sbi to 4 bytes cp0613
2026-04-15 2:06 ` Michael Ellerman [this message]
2026-04-15 12:37 ` Chen Pei
2026-04-15 3:39 ` Vivian Wang
2026-04-15 12:37 ` Chen Pei
2026-04-17 2:48 ` Vivian Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d38e585f-554a-4f81-8136-981870fe3383@kernel.org \
--to=mpe@kernel.org \
--cc=andrew.jones@oss.qualcomm.com \
--cc=anup@brainfault.org \
--cc=cp0613@linux.alibaba.com \
--cc=guoren@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=pjw@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox