]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN
authorLaurent Vivier <lvivier@redhat.com>
Fri, 2 Mar 2018 10:51:56 +0000 (11:51 +0100)
committerPaul Mackerras <paulus@ozlabs.org>
Sat, 3 Mar 2018 08:28:34 +0000 (19:28 +1100)
commit9255baaa48c1627937a8bf043abcb47b3ef6b204
treee537610f5576aba85a1980fd085f15ca12e6b00b
parentcd3620a39aec2959076b7e9a2900867447b7a977
KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN

Since commit 28b6f501b882 ("KVM: PPC: Book3S HV: Close race with testing
for signals on guest entry"), if CONFIG_VIRT_CPU_ACCOUNTING_GEN is set, the
guest time is not accounted to guest time and user time, but instead to
system time.

This is because guest_enter()/guest_exit() are called while interrupts
are disabled and the tick counter cannot be updated between them.

To fix that, move guest_exit() after local_irq_enable(), and as
guest_enter() is called with IRQ disabled, call guest_enter_irqoff()
instead.

Fixes: 28b6f501b882 ("KVM: PPC: Book3S HV: Close race with testing for signals on guest entry")
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_hv.c