[PW_SID:995204] [v3] riscv: skip csr restore if vcpu preempted reload - #829
[PW_SID:995204] [v3] riscv: skip csr restore if vcpu preempted reload#829linux-riscv-bot wants to merge 1 commit into
Conversation
The kvm_arch_vcpu_load() function is called in two cases for riscv: 1. When entering KVM_RUN from userspace ioctl. 2. When a preempted VCPU is scheduled back. In the second case, if no other KVM VCPU has run on this CPU since the current VCPU was preempted, the guest CSR (including AIA CSRS and HGTAP) values are still valid in the hardware and do not need to be restored. This patch is to skip the CSR write path when: 1. The VCPU was previously preempted (vcpu->scheduled_out == 1). 2. It is being reloaded on the same physical CPU (vcpu->arch.last_exit_cpu == cpu). 3. No other KVM VCPU has used this CPU in the meantime (vcpu == __this_cpu_read(kvm_former_vcpu)). This reduces many CSR writes with frequent preemption on the same CPU. Signed-off-by: Jinyu Tang <tjytimi@163.com> Reviewed-by: Nutty Liu <nutty.liu@hotmail.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
|
Patch 1: "[v3] riscv: skip csr restore if vcpu preempted reload" |
PR for series 995204 applied to workflow__riscv__fixes
Name: [v3] riscv: skip csr restore if vcpu preempted reload
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=995204
Version: 3