diff mbox series

[v6,4/8] RISC-V: Scalar unaligned access emulated on hotplug CPUs

Message ID 20240724183605.4038597-5-jesse@rivosinc.com (mailing list archive)
State Superseded
Headers show
Series RISC-V: Detect and report speed of unaligned vector accesses | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR fail merge-conflict

Commit Message

Jesse Taube July 24, 2024, 6:36 p.m. UTC
The check_unaligned_access_emulated() function should have been called
during CPU hotplug to ensure that if all CPUs had emulated unaligned
accesses, the new CPU also does.

This patch adds the call to check_unaligned_access_emulated() in
the hotplug path.

Fixes: 55e0bf49a0d0 ("RISC-V: Probe misaligned access speed in parallel")
Signed-off-by: Jesse Taube <jesse@rivosinc.com>
Cc: stable@vger.kernel.org
---
V5 -> V6:
 - New patch
---
 arch/riscv/kernel/unaligned_access_speed.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Evan Green July 25, 2024, 6:59 p.m. UTC | #1
On Wed, Jul 24, 2024 at 11:36 AM Jesse Taube <jesse@rivosinc.com> wrote:
>
> The check_unaligned_access_emulated() function should have been called
> during CPU hotplug to ensure that if all CPUs had emulated unaligned
> accesses, the new CPU also does.
>
> This patch adds the call to check_unaligned_access_emulated() in
> the hotplug path.
>
> Fixes: 55e0bf49a0d0 ("RISC-V: Probe misaligned access speed in parallel")
> Signed-off-by: Jesse Taube <jesse@rivosinc.com>

Reviewed-by: Evan Green <evan@rivosinc.com>
diff mbox series

Patch

diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c
index a9a6bcb02acf..b67db1fc3740 100644
--- a/arch/riscv/kernel/unaligned_access_speed.c
+++ b/arch/riscv/kernel/unaligned_access_speed.c
@@ -191,6 +191,7 @@  static int riscv_online_cpu(unsigned int cpu)
 	if (per_cpu(misaligned_access_speed, cpu) != RISCV_HWPROBE_MISALIGNED_UNKNOWN)
 		goto exit;
 
+	check_unaligned_access_emulated(NULL);
 	buf = alloc_pages(GFP_KERNEL, MISALIGNED_BUFFER_ORDER);
 	if (!buf) {
 		pr_warn("Allocation failure, not measuring misaligned performance\n");