aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/include
diff options
context:
space:
mode:
authorGravatar Atish Patra <atishp@rivosinc.com> 2024-04-20 08:17:23 -0700
committerGravatar Anup Patel <anup@brainfault.org> 2024-04-22 11:13:54 +0530
commitb737fc24a12ceb6c393d9d68def6a6608fdf11cc (patch)
tree24d96fa5f0357b6b75bd39a55cfd4cd03362f488 /arch/riscv/include
parentRISC-V: KVM: Rename the SBI_STA_SHMEM_DISABLE to a generic name (diff)
downloadlinux-b737fc24a12ceb6c393d9d68def6a6608fdf11cc.tar.gz
linux-b737fc24a12ceb6c393d9d68def6a6608fdf11cc.tar.bz2
linux-b737fc24a12ceb6c393d9d68def6a6608fdf11cc.zip
RISC-V: Use the minor version mask while computing sbi version
As per the SBI specification, minor version is encoded in the lower 24 bits only. Make sure that the SBI version is computed with the appropriate mask. Currently, there is no minor version in use. Thus, it doesn't change anything functionality but it is good to be compliant with the specification. Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Atish Patra <atishp@rivosinc.com> Link: https://lore.kernel.org/r/20240420151741.962500-8-atishp@rivosinc.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'arch/riscv/include')
-rw-r--r--arch/riscv/include/asm/sbi.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h
index f31650b10899..112a0a0d9f46 100644
--- a/arch/riscv/include/asm/sbi.h
+++ b/arch/riscv/include/asm/sbi.h
@@ -367,8 +367,8 @@ static inline unsigned long sbi_minor_version(void)
static inline unsigned long sbi_mk_version(unsigned long major,
unsigned long minor)
{
- return ((major & SBI_SPEC_VERSION_MAJOR_MASK) <<
- SBI_SPEC_VERSION_MAJOR_SHIFT) | minor;
+ return ((major & SBI_SPEC_VERSION_MAJOR_MASK) << SBI_SPEC_VERSION_MAJOR_SHIFT)
+ | (minor & SBI_SPEC_VERSION_MINOR_MASK);
}
int sbi_err_map_linux_errno(int err);