[PW_SID:1143036] [v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration - #2437
[PW_SID:1143036] [v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration#2437linux-riscv-bot wants to merge 1 commit into
Conversation
KVM device ioctls are not serialized against KVM_RUN. As a result, kvm_riscv_aia_imsic_rw_attr() can snapshot the physical CPU and HGEI of an IMSIC VS-file before a concurrent vCPU migration releases it. The HGEI can then be allocated to another vCPU before imsic_vsfile_rw() uses the stale tuple. A GET or SET attribute may consequently access the new owner's interrupt file. Serialize the entire IMSIC attribute operation with the target vCPU mutex. This prevents the VS-file from being migrated and recycled until the attribute access completes. Acquire the mutex killably so that the device ioctl remains interruptible while waiting for KVM_RUN to finish. Fixes: db8b7e9 ("RISC-V: KVM: Add in-kernel virtualization of AIA IMSIC") Cc: stable@vger.kernel.org Signed-off-by: Xie Bo <xb@ultrarisc.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
|
Patch 1: "[v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration" |
PR for series 1143036 applied to workflow__riscv__fixes
Name: [v2] RISC-V: KVM: Serialize IMSIC attributes with vCPU migration
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1143036
Version: 2