Commit 514883e
KVM: x86: Defer vtime accounting 'til after IRQ handling
commit 1604571 upstream.
Defer the call to account guest time until after servicing any IRQ(s)
that happened in the guest or immediately after VM-Exit. Tick-based
accounting of vCPU time relies on PF_VCPU being set when the tick IRQ
handler runs, and IRQs are blocked throughout the main sequence of
vcpu_enter_guest(), including the call into vendor code to actually
enter and exit the guest.
This fixes a bug where reported guest time remains '0', even when
running an infinite loop in the guest:
https://bugzilla.kernel.org/show_bug.cgi?id=209831
Fixes: 87fa7f3 ("x86/kvm: Move context tracking where it belongs")
Suggested-by: Thomas Gleixner <[email protected]>
Co-developed-by: Sean Christopherson <[email protected]>
Signed-off-by: Wanpeng Li <[email protected]>
Signed-off-by: Sean Christopherson <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 7706830 commit 514883e
3 files changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3532 | 3532 | | |
3533 | 3533 | | |
3534 | 3534 | | |
3535 | | - | |
3536 | | - | |
| 3535 | + | |
| 3536 | + | |
3537 | 3537 | | |
3538 | 3538 | | |
3539 | 3539 | | |
3540 | 3540 | | |
3541 | 3541 | | |
3542 | 3542 | | |
3543 | | - | |
| 3543 | + | |
3544 | 3544 | | |
3545 | 3545 | | |
3546 | 3546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6640 | 6640 | | |
6641 | 6641 | | |
6642 | 6642 | | |
6643 | | - | |
6644 | | - | |
| 6643 | + | |
| 6644 | + | |
6645 | 6645 | | |
6646 | 6646 | | |
6647 | 6647 | | |
6648 | 6648 | | |
6649 | 6649 | | |
6650 | 6650 | | |
6651 | | - | |
| 6651 | + | |
6652 | 6652 | | |
6653 | 6653 | | |
6654 | 6654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9063 | 9063 | | |
9064 | 9064 | | |
9065 | 9065 | | |
| 9066 | + | |
| 9067 | + | |
| 9068 | + | |
| 9069 | + | |
| 9070 | + | |
| 9071 | + | |
| 9072 | + | |
| 9073 | + | |
| 9074 | + | |
9066 | 9075 | | |
9067 | 9076 | | |
9068 | 9077 | | |
| |||
0 commit comments