diff options
author | Laurent Vivier <[email protected]> | 2021-10-28 00:21:50 +1000 |
---|---|---|
committer | Michael Ellerman <[email protected]> | 2021-10-28 22:27:48 +1100 |
commit | 235cee162459d96153d63651ce7ff51752528c96 (patch) | |
tree | 8c6bc541a7d4d28a1fd5c87dfa34d2196ba77dba /drivers/usb/cdns3/cdns3-trace.c | |
parent | 322fda0405fecaaa540b0fa90393830aaadaf420 (diff) |
KVM: PPC: Tick accounting should defer vtime accounting 'til after IRQ handling
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: [email protected] # 5.12+
Signed-off-by: Laurent Vivier <[email protected]>
[np: only required for tick accounting, add Book3E fix, tweak changelog]
Signed-off-by: Nicholas Piggin <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/usb/cdns3/cdns3-trace.c')
0 files changed, 0 insertions, 0 deletions