All of lore.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor.dooley@microchip.com>
To: Charlie Jenkins <charlie@rivosinc.com>
Cc: "Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Jisheng Zhang" <jszhang@kernel.org>,
	"Evan Green" <evan@rivosinc.com>,
	"Clément Léger" <cleger@rivosinc.com>,
	"Eric Biggers" <ebiggers@kernel.org>,
	"Elliot Berman" <quic_eberman@quicinc.com>,
	"Charles Lohr" <lohr85@gmail.com>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/4] riscv: Only check online cpus for emulated accesses
Date: Wed, 6 Mar 2024 13:11:43 +0000	[thread overview]
Message-ID: <20240306-spry-retread-56d6c8dce327@wendy> (raw)
In-Reply-To: <20240301-disable_misaligned_probe_config-v6-2-612ebd69f430@rivosinc.com>

[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]

On Fri, Mar 01, 2024 at 05:45:33PM -0800, Charlie Jenkins wrote:
> The unaligned access checker only sets valid values for online cpus.
> Check for these values on online cpus rather than on present cpus.
> 
> Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> Fixes: 71c54b3d169d ("riscv: report misaligned accesses emulation to hwprobe")

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
>  arch/riscv/kernel/traps_misaligned.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/traps_misaligned.c b/arch/riscv/kernel/traps_misaligned.c
> index 8ded225e8c5b..c2ed4e689bf9 100644
> --- a/arch/riscv/kernel/traps_misaligned.c
> +++ b/arch/riscv/kernel/traps_misaligned.c
> @@ -632,7 +632,7 @@ void unaligned_emulation_finish(void)
>  	 * accesses emulated since tasks requesting such control can run on any
>  	 * CPU.
>  	 */
> -	for_each_present_cpu(cpu) {
> +	for_each_online_cpu(cpu) {
>  		if (per_cpu(misaligned_access_speed, cpu) !=
>  					RISCV_HWPROBE_MISALIGNED_EMULATED) {
>  			return;

I went looking to see what the practical differences were between
"present" and "possible", cos I'd never really seen much code using
"present". Turns out present and possible are essentially the same on
riscv. TIL.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Conor Dooley <conor.dooley@microchip.com>
To: Charlie Jenkins <charlie@rivosinc.com>
Cc: "Albert Ou" <aou@eecs.berkeley.edu>,
	linux-kernel@vger.kernel.org,
	"Eric Biggers" <ebiggers@kernel.org>,
	"Evan Green" <evan@rivosinc.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Jisheng Zhang" <jszhang@kernel.org>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Clément Léger" <cleger@rivosinc.com>,
	linux-riscv@lists.infradead.org,
	"Charles Lohr" <lohr85@gmail.com>
Subject: Re: [PATCH v6 2/4] riscv: Only check online cpus for emulated accesses
Date: Wed, 6 Mar 2024 13:11:43 +0000	[thread overview]
Message-ID: <20240306-spry-retread-56d6c8dce327@wendy> (raw)
In-Reply-To: <20240301-disable_misaligned_probe_config-v6-2-612ebd69f430@rivosinc.com>


[-- Attachment #1.1: Type: text/plain, Size: 1325 bytes --]

On Fri, Mar 01, 2024 at 05:45:33PM -0800, Charlie Jenkins wrote:
> The unaligned access checker only sets valid values for online cpus.
> Check for these values on online cpus rather than on present cpus.
> 
> Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> Fixes: 71c54b3d169d ("riscv: report misaligned accesses emulation to hwprobe")

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
>  arch/riscv/kernel/traps_misaligned.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/traps_misaligned.c b/arch/riscv/kernel/traps_misaligned.c
> index 8ded225e8c5b..c2ed4e689bf9 100644
> --- a/arch/riscv/kernel/traps_misaligned.c
> +++ b/arch/riscv/kernel/traps_misaligned.c
> @@ -632,7 +632,7 @@ void unaligned_emulation_finish(void)
>  	 * accesses emulated since tasks requesting such control can run on any
>  	 * CPU.
>  	 */
> -	for_each_present_cpu(cpu) {
> +	for_each_online_cpu(cpu) {
>  		if (per_cpu(misaligned_access_speed, cpu) !=
>  					RISCV_HWPROBE_MISALIGNED_EMULATED) {
>  			return;

I went looking to see what the practical differences were between
"present" and "possible", cos I'd never really seen much code using
"present". Turns out present and possible are essentially the same on
riscv. TIL.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2024-03-06 13:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02  1:45 [PATCH v6 0/4] riscv: Use Kconfig to set unaligned access speed Charlie Jenkins
2024-03-02  1:45 ` Charlie Jenkins
2024-03-02  1:45 ` [PATCH v6 1/4] riscv: lib: Introduce has_fast_unaligned_access function Charlie Jenkins
2024-03-02  1:45   ` Charlie Jenkins
2024-03-02  1:45 ` [PATCH v6 2/4] riscv: Only check online cpus for emulated accesses Charlie Jenkins
2024-03-02  1:45   ` Charlie Jenkins
2024-03-06 13:11   ` Conor Dooley [this message]
2024-03-06 13:11     ` Conor Dooley
2024-03-02  1:45 ` [PATCH v6 3/4] riscv: Decouple emulated unaligned accesses from access speed Charlie Jenkins
2024-03-02  1:45   ` Charlie Jenkins
2024-03-06 13:19   ` Conor Dooley
2024-03-06 13:19     ` Conor Dooley
2024-03-06 18:25     ` Charlie Jenkins
2024-03-06 18:25       ` Charlie Jenkins
2024-03-02  1:45 ` [PATCH v6 4/4] riscv: Set unaligned access speed at compile time Charlie Jenkins
2024-03-02  1:45   ` Charlie Jenkins
2024-03-06 16:19   ` Conor Dooley
2024-03-06 16:19     ` Conor Dooley
2024-03-06 18:32     ` Charlie Jenkins
2024-03-06 18:32       ` Charlie Jenkins
2024-03-06 18:35       ` Conor Dooley
2024-03-06 18:35         ` Conor Dooley

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=20240306-spry-retread-56d6c8dce327@wendy \
    --to=conor.dooley@microchip.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=charlie@rivosinc.com \
    --cc=cleger@rivosinc.com \
    --cc=ebiggers@kernel.org \
    --cc=evan@rivosinc.com \
    --cc=jszhang@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lohr85@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=quic_eberman@quicinc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.