]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RISC-V: Scalar unaligned access emulated on hotplug CPUs
authorJesse Taube <jesse@rivosinc.com>
Thu, 17 Oct 2024 19:00:19 +0000 (12:00 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 18 Oct 2024 19:38:31 +0000 (12:38 -0700)
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>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20241017-jesse_unaligned_vector-v10-2-5b33500160f8@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/unaligned_access_speed.c

index 160628a2116de4a5e4135e4bba25fef35141b747..f3508cc54f91ae9da62342d28d24f869b894651d 100644 (file)
@@ -191,6 +191,7 @@ static int riscv_online_cpu(unsigned int cpu)
        if (per_cpu(misaligned_access_speed, cpu) != RISCV_HWPROBE_MISALIGNED_SCALAR_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");