Skip to content
Unverified Commit 8f7e001e authored by Palmer Dabbelt's avatar Palmer Dabbelt
Browse files

RISC-V: Clean up the Zicbom block size probing

This fixes two issues: I truncated the warning's hart ID when porting to
the 64-bit hart ID code, and the original code's warning handling could
fire on an uninitialized hart ID.

The biggest change here is that riscv_cbom_block_size is no longer
initialized, as IMO the default isn't sane: there's nothing in the ISA
that mandates any specific cache block size, so falling back to one will
just silently produce the wrong answer on some systems.  This also
changes the probing order so the cache block size is known before
enabling Zicbom support.

CC: stable@vger.kernel.org
CC: Andrew Jones <ajones@ventanamicro.com>
CC: Heiko Stuebner <heiko@sntech.de>
CC: Atish Patra <atishp@rivosinc.com>
Fixes: 3aefb2ee ("riscv: implement Zicbom-based CMO instructions + the t-head variant")
Fixes: 1631ba12

 ("riscv: Add support for non-coherent devices using zicbom extension")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarConor Dooley <conor.dooley@microchip.com>
Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
[Conor: fixed the redefinition errors]
Tested-by: default avatarConor Dooley <conor.dooley@microchip.com>
Signed-off-by: default avatarConor Dooley <conor.dooley@microchip.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220912224800.998121-1-mail@conchuod.ie
Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 20e0fbab
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment