riscv: KVM: Fix hart suspend_type use
authorAndrew Jones <ajones@ventanamicro.com>
Mon, 17 Feb 2025 08:45:09 +0000 (09:45 +0100)
committerAnup Patel <anup@brainfault.org>
Mon, 17 Feb 2025 10:58:28 +0000 (16:28 +0530)
commite3219b0c491f2aa0e0b200a39d3352ab05cdda96
tree48a3ee77d3420dc8c2bbc6e384d4683e421a0c8e
parentc7db342e3b4744688be1e27e31254c1d31a35274
riscv: KVM: Fix hart suspend_type use

The spec says suspend_type is 32 bits wide and "In case the data is
defined as 32bit wide, higher privilege software must ensure that it
only uses 32 bit data." Mask off upper bits of suspend_type before
using it.

Fixes: 763c8bed8c05 ("RISC-V: KVM: Implement SBI HSM suspend call")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20250217084506.18763-9-ajones@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/vcpu_sbi_hsm.c