lkml.org 
[lkml]   [2022]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 7/7] kvm/x86: rework guest entry logic
From
On 1/19/22 11:58, Mark Rutland wrote:
>
> To minimize duplication and to more clearly balance entry and exit, both
> entry and exit of guest timing are placed in vcpu_enter_guest(), using
> the new guest_timing_{enter,exit}_irqoff() helpers. When context
> tracking is used a small amount of additional time will be accounted
> towards guests; tick-based accounting is unnaffected as IRQs are
> disabled at this point and not enabled until after the return from the
> guest.
>
> This also corrects (benign) mis-balanced context tracking accounting
> introduced in commits:
>
> ae95f566b3d22ade ("KVM: X86: TSCDEADLINE MSR emulation fastpath")
> 26efe2fd92e50822 ("KVM: VMX: Handle preemption timer fastpath")
>
> Where KVM can enter a guest multiple times, calling vtime_guest_enter()
> without a corresponding call to vtime_account_guest_exit(), and with
> vtime_account_system() called when vtime_account_guest() should be used.
> As account_system_time() checks PF_VCPU and calls account_guest_time(),
> this doesn't result in any functional problem, but is unnecessarily
> confusing.

Yes, I agree.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

\
 
 \ /
  Last update: 2022-01-20 12:20    [W:0.138 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site