summaryrefslogtreecommitdiff
path: root/arch/ia64
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2021-10-27 17:21:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-18 21:15:57 +0300
commit0e47821087deca8813257299f7c10cce0dcf3692 (patch)
treea19385cdcdce7f9bfdd8ed000ab60ca955d7dd8a /arch/ia64
parentdf4d4868d164d8a14c34ee7624beb6365e459c1a (diff)
downloadlinux-0e47821087deca8813257299f7c10cce0dcf3692.tar.xz
KVM: PPC: Tick accounting should defer vtime accounting 'til after IRQ handling
commit 235cee162459d96153d63651ce7ff51752528c96 upstream. Commit 112665286d08 ("KVM: PPC: Book3S HV: Context tracking exit guest context before enabling irqs") moved guest_exit() into the interrupt protected area to avoid wrong context warning (or worse). The problem is that tick-based time accounting has not yet been updated at this point (because it depends on the timer interrupt firing), so the guest time gets incorrectly accounted to system time. To fix the problem, follow the x86 fix in commit 160457140187 ("Defer vtime accounting 'til after IRQ handling"), and allow host IRQs to run before accounting the guest exit time. In the case vtime accounting is enabled, this is not required because TB is used directly for accounting. Before this patch, with CONFIG_TICK_CPU_ACCOUNTING=y in the host and a guest running a kernel compile, the 'guest' fields of /proc/stat are stuck at zero. With the patch they can be observed increasing roughly as expected. Fixes: e233d54d4d97 ("KVM: booke: use __kvm_guest_exit") Fixes: 112665286d08 ("KVM: PPC: Book3S HV: Context tracking exit guest context before enabling irqs") Cc: stable@vger.kernel.org # 5.12+ Signed-off-by: Laurent Vivier <lvivier@redhat.com> [np: only required for tick accounting, add Book3E fix, tweak changelog] Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20211027142150.3711582-1-npiggin@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/ia64')
0 files changed, 0 insertions, 0 deletions