public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Andrew Jones <ajones@ventanamicro.com>
Cc: Xu Lu <luxu.kernel@bytedance.com>,
	 paul.walmsley@sifive.com, palmer@dabbelt.com,
	 aou@eecs.berkeley.edu,  andy.chiu@sifive.com, guoren@kernel.org,
	 christoph.muellner@vrull.eu, linux-riscv@lists.infradead.org,
	 linux-kernel@vger.kernel.org, lihangjing@bytedance.com,
	 dengliang.1214@bytedance.com, xieyongji@bytedance.com,
	 chaiwen.cc@bytedance.com
Subject: Re: [PATCH v3 1/2] riscv: process: Introduce idle thread using Zawrs extension
Date: Wed, 25 Sep 2024 16:10:08 +0200	[thread overview]
Message-ID: <mvmbk0b7rjz.fsf@suse.de> (raw)
In-Reply-To: <20240925-2acd8d9743cf40b999172b40@orel> (Andrew Jones's message of "Wed, 25 Sep 2024 15:54:28 +0200")

On Sep 25 2024, Andrew Jones wrote:

> On Wed, Sep 25, 2024 at 09:15:46PM GMT, Xu Lu wrote:
>> @@ -148,6 +149,21 @@ static inline void wait_for_interrupt(void)
>>  	__asm__ __volatile__ ("wfi");
>>  }
>>  
>> +static inline void wrs_nto(unsigned long *addr)
>> +{
>> +	int val;
>> +
>> +	__asm__ __volatile__(
>> +#ifdef CONFIG_64BIT
>> +			"lr.d %[p], %[v]\n\t"
>> +#else
>> +			"lr.w %[p], %[v]\n\t"
>> +#endif
>
> val is always 32-bit since it's an int. We should always use lr.w.

Shouldn't val be unsigned long like the pointer that is being read?

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

  reply	other threads:[~2024-09-25 14:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 13:15 [PATCH v3 0/2] riscv: Idle thread using Zawrs extension Xu Lu
2024-09-25 13:15 ` [PATCH v3 1/2] riscv: process: Introduce idle " Xu Lu
2024-09-25 13:54   ` Andrew Jones
2024-09-25 14:10     ` Andreas Schwab [this message]
2024-09-25 15:04       ` [External] " Xu Lu
2024-09-25 15:01     ` Xu Lu
2024-09-26  4:34   ` Guo Ren
2024-09-26  7:55     ` [External] " Xu Lu
2024-09-25 13:15 ` [PATCH v3 2/2] riscv: Use Zawrs to accelerate IPI to idle cpu Xu Lu

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=mvmbk0b7rjz.fsf@suse.de \
    --to=schwab@suse.de \
    --cc=ajones@ventanamicro.com \
    --cc=andy.chiu@sifive.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=chaiwen.cc@bytedance.com \
    --cc=christoph.muellner@vrull.eu \
    --cc=dengliang.1214@bytedance.com \
    --cc=guoren@kernel.org \
    --cc=lihangjing@bytedance.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=luxu.kernel@bytedance.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=xieyongji@bytedance.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