summaryrefslogtreecommitdiff
path: root/arch/ia64/mm
diff options
context:
space:
mode:
authorAnup Patel <apatel@ventanamicro.com>2022-07-11 07:06:32 +0300
committerAnup Patel <anup@brainfault.org>2022-07-11 07:06:32 +0300
commitbe82abe6a76ba8e76f25312566182b0f13c4fbf9 (patch)
tree66d4c7e41c5055d0fa865316547b3085dce1ec64 /arch/ia64/mm
parent88573389aaa34640b9ecde15622c68e8737d8f8c (diff)
downloadlinux-be82abe6a76ba8e76f25312566182b0f13c4fbf9.tar.xz
RISC-V: KVM: Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests()
The kvm_riscv_check_vcpu_requests() is called with SRCU read lock held and for KVM_REQ_SLEEP request it will block the VCPU without releasing SRCU read lock. This causes KVM ioctls (such as KVM_IOEVENTFD) from other VCPUs of the same Guest/VM to hang/deadlock if there is any synchronize_srcu() or synchronize_srcu_expedited() in the path. To fix the above in kvm_riscv_check_vcpu_requests(), we should do SRCU read unlock before blocking the VCPU and do SRCU read lock after VCPU wakeup. Fixes: cce69aff689e ("RISC-V: KVM: Implement VCPU interrupts and requests handling") Reported-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'arch/ia64/mm')
0 files changed, 0 insertions, 0 deletions