From: Yao Zi <ziyao@disroot.org>
To: Jimmy Ho <jimmy.ho@sifive.com>, linux-riscv@lists.infradead.org
Cc: troy.mitchell@linux.spacemit.com
Subject: Re: [PATCH v2] riscv: fix using wrong load type
Date: Tue, 19 Aug 2025 03:33:26 +0000 [thread overview]
Message-ID: <aKPwhoaE0nS8W3mA@pie> (raw)
In-Reply-To: <20250819021931.31935-1-jimmy.ho@sifive.com>
On Tue, Aug 19, 2025 at 10:19:31AM +0800, Jimmy Ho wrote:
> thread_info.cpu field is 32 bits wide,
> but is accessed using an XLEN-bit load, which might be 64bit load, fix it
>
> Signed-off-by: Jimmy Ho <jimmy.ho@sifive.com>
>
> Changes in v2:
> - add a comment to explain why use lw instead of REG_L.
> - correct commit message
> ---
> arch/riscv/kernel/entry.S | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
> index 3a0ec6fd5956..82306cecfdcb 100644
> --- a/arch/riscv/kernel/entry.S
> +++ b/arch/riscv/kernel/entry.S
> @@ -45,8 +45,10 @@
> * Computes:
> * a0 = &new_vmalloc[BIT_WORD(cpu)]
> * a1 = BIT_MASK(cpu)
> + *
> + * using lw instead of REG_L is because the thread_info.cpu field is 32 bits wide
> */
> - REG_L a2, TASK_TI_CPU(tp)
> + lw a2, TASK_TI_CPU(tp)
~~~~~
In this code block, a TAB instead of a space is placed between opcode
and operands. I think it's better to keep them aligned.
And should this patch carry a Fixes tag?
Best regards,
Yao Zi
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
prev parent reply other threads:[~2025-08-19 3:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 2:19 [PATCH v2] riscv: fix using wrong load type Jimmy Ho
2025-08-19 2:27 ` Troy Mitchell
2025-08-19 3:33 ` Yao Zi [this message]
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=aKPwhoaE0nS8W3mA@pie \
--to=ziyao@disroot.org \
--cc=jimmy.ho@sifive.com \
--cc=linux-riscv@lists.infradead.org \
--cc=troy.mitchell@linux.spacemit.com \
/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