Patch "riscv: KVM: Fix hart suspend_type use" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    riscv: KVM: Fix hart suspend_type use

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     riscv-kvm-fix-hart-suspend_type-use.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b66db2e9c7586a324f26522511cb1722932e8732
Author: Andrew Jones <ajones@xxxxxxxxxxxxxxxx>
Date:   Mon Feb 17 09:45:09 2025 +0100

    riscv: KVM: Fix hart suspend_type use
    
    [ Upstream commit e3219b0c491f2aa0e0b200a39d3352ab05cdda96 ]
    
    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@xxxxxxxxxxxxxxxx>
    Reviewed-by: Anup Patel <anup@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20250217084506.18763-9-ajones@xxxxxxxxxxxxxxxx
    Signed-off-by: Anup Patel <anup@xxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/riscv/kvm/vcpu_sbi_hsm.c b/arch/riscv/kvm/vcpu_sbi_hsm.c
index 13a35eb77e8e3..3070bb31745de 100644
--- a/arch/riscv/kvm/vcpu_sbi_hsm.c
+++ b/arch/riscv/kvm/vcpu_sbi_hsm.c
@@ -9,6 +9,7 @@
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/kvm_host.h>
+#include <linux/wordpart.h>
 #include <asm/sbi.h>
 #include <asm/kvm_vcpu_sbi.h>
 
@@ -109,7 +110,7 @@ static int kvm_sbi_ext_hsm_handler(struct kvm_vcpu *vcpu, struct kvm_run *run,
 		}
 		return 0;
 	case SBI_EXT_HSM_HART_SUSPEND:
-		switch (cp->a0) {
+		switch (lower_32_bits(cp->a0)) {
 		case SBI_HSM_SUSPEND_RET_DEFAULT:
 			kvm_riscv_vcpu_wfi(vcpu);
 			break;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux