]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN
authorLaurent Vivier <lvivier@redhat.com>
Fri, 23 Mar 2018 20:03:00 +0000 (21:03 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 3 Apr 2018 09:44:39 +0000 (11:44 +0200)
commit55b7576953a0ef7b5086dd59751de44ad0163f98
treee6b29b097b2759321f9b8c224347917758c86bbc
parent33132849b10707e902f8f71860ce1da0bb39a1ca
KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN

BugLink: http://bugs.launchpad.net/bugs/1755979
Since commit 8b24e69fc47e ("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: 8b24e69fc47e ("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>
(cherry picked from commit 61bd0f66ff92d5ce765ff9850fd3cbfec773c560)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/kvm/book3s_hv.c