OSDN Git Service

RISC-V: cpufeatures: Put the upper 16 bits of patch ID to work
authorAndrew Jones <ajones@ventanamicro.com>
Fri, 24 Feb 2023 16:26:28 +0000 (17:26 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 15 Mar 2023 04:26:05 +0000 (21:26 -0700)
commitd25f256332cc795b0fe16ba541fe0c05f0eb2c59
treeda6ab591ea70d5ab40ea8e2743fa1137c7b7a7e0
parent7ea5a73617e931230a46150dc7c1bbfd98f24c8e
RISC-V: cpufeatures: Put the upper 16 bits of patch ID to work

cpufeature IDs are consecutive integers starting at 26, so a 32-bit
patch ID allows an aircraft carrier load of feature IDs. Repurposing
the upper 16 bits still leaves a boat load of feature IDs and gains
16 bits which may be used to control patching on a per patch-site
basis.

This will be initially used in Zicboz's application to clear_page(),
as Zicboz's block size must also be considered. In that case, the
upper 16-bit value's role will be to convey the maximum block size
which the Zicboz clear_page() implementation supports.

cpufeature patch sites which need to check for the existence or
absence of other cpufeatures may also be able to make use of this.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230224162631.405473-6-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/alternative.h
arch/riscv/kernel/cpufeature.c