[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201117143529.GJ3121406@hirez.programming.kicks-ass.net>
Date: Tue, 17 Nov 2020 15:35:29 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Like Xu <like.xu@...ux.intel.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
Sean Christopherson <sean.j.christopherson@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Kan Liang <kan.liang@...ux.intel.com>, luwei.kang@...el.com,
Thomas Gleixner <tglx@...utronix.de>, wei.w.wang@...el.com,
Tony Luck <tony.luck@...el.com>,
Stephane Eranian <eranian@...gle.com>,
Mark Gross <mgross@...ux.intel.com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 04/17] perf: x86/ds: Handle guest PEBS overflow PMI
and inject it to guest
On Mon, Nov 09, 2020 at 10:12:41AM +0800, Like Xu wrote:
> With PEBS virtualization, the PEBS records get delivered to the guest,
> and host still sees the PEBS overflow PMI from guest PEBS counters.
> This would normally result in a spurious host PMI and we needs to inject
> that PEBS overflow PMI into the guest, so that the guest PMI handler
> can handle the PEBS records.
>
> Check for this case in the host perf PEBS handler. If a PEBS overflow
> PMI occurs and it's not generated from host side (via check host DS),
> a fake event will be triggered. The fake event causes the KVM PMI callback
> to be called, thereby injecting the PEBS overflow PMI into the guest.
>
> No matter how many guest PEBS counters are overflowed, only triggering
> one fake event is enough. The guest PEBS handler would retrieve the
> correct information from its own PEBS records buffer.
>
> If the counter_freezing is disabled on the host, a guest PEBS overflow
> PMI would be missed when a PEBS counter is enabled on the host side
> and coincidentally a host PEBS overflow PMI based on host DS_AREA is
> also triggered right after vm-exit due to the guest PEBS overflow PMI
> based on guest DS_AREA. In that case, KVM will disable guest PEBS before
> vm-entry once there's a host PEBS counter enabled on the same CPU.
How does this guest DS crud work? DS_AREA is a host virtual address;
ISTR there was lots of fail trying to virtualize it earlier. What's
changed? There's 0 clues here.
Why are the host and guest DS area separate, why can't we map them to
the exact same physical pages?
Powered by blists - more mailing lists