]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: KVM: move preempt_disable() call in kvm_arch_vcpu_ioctl_run
authorNikolay Borisov <nborisov@suse.com>
Fri, 29 Jul 2022 11:44:34 +0000 (17:14 +0530)
committerAnup Patel <anup@brainfault.org>
Fri, 29 Jul 2022 11:44:34 +0000 (17:14 +0530)
commitde2ae2bc84132b8d403653323f1b148d540fff0d
treedef954797f752f38b73801d11963b807aa11a282
parentf99564483b723b6c5707fcaebb5ededf2a81fb39
RISC-V: KVM: move preempt_disable() call in kvm_arch_vcpu_ioctl_run

local_irq_disable provides stronger guarantees than preempt_disable so
calling the latter is redundant when interrupts are disabled. Instead,
explicitly disable preemption right before interrupts are enabled/disabled
to ensure that the time accounted in guest_timing_exit_irqoff
includes time taken by the guest or interrupts.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/vcpu.c