[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0ca44f61-f7f1-0440-e1e1-8d5e8aa9b540@gmail.com>
Date: Thu, 9 Dec 2021 16:28:37 +0800
From: Like Xu <like.xu.linux@...il.com>
To: Jim Mattson <jmattson@...gle.com>, Andi Kleen <ak@...ux.intel.com>,
Kim Phillips <kim.phillips@....com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Like Xu <likexu@...cent.com>
Subject: Re: [PATCH v2 4/6] KVM: x86/pmu: Add pmc->intr to refactor
kvm_perf_overflow{_intr}()
On 9/12/2021 12:25 pm, Jim Mattson wrote:
>
> Not your change, but if the event is counting anything based on
> cycles, and the guest TSC is scaled to run at a different rate from
> the host TSC, doesn't the initial value of the underlying hardware
> counter have to be adjusted as well, so that the interrupt arrives
> when the guest's counter overflows rather than when the host's counter
> overflows?
I've thought about this issue too and at least the Intel Specification
did not let me down on this detail:
"The counter changes in the VMX non-root mode will follow
VMM's use of the TSC offset or TSC scaling VMX controls"
Not knowing if AMD or the real world hardware
will live up to this expectation and I'm pessimistic.
cc Andi and Kim.
Powered by blists - more mailing lists