Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-02-01 Thread Xu, Like
On 2021/1/25 19:47, Peter Zijlstra wrote: On Mon, Jan 25, 2021 at 04:26:22PM +0800, Like Xu wrote: In the host and guest PEBS both enabled case, we'll get a crazy dmesg *bombing* about spurious PMI warning if we pass the host PEBS PMI "harmlessly" to the guest: [11261.502536] Uhhuh. NMI

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-26 Thread Like Xu
Hi Peter, On 2021/1/15 22:44, Peter Zijlstra wrote: On Fri, Jan 15, 2021 at 10:30:13PM +0800, Xu, Like wrote: Are you sure? Spurious NMI/PMIs are known to happen anyway. We have far too much code to deal with them. https://lore.kernel.org/lkml/20170628130748.GI5981@leverpostej/T/ In the rr

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-26 Thread Peter Zijlstra
On Mon, Jan 25, 2021 at 04:26:22PM +0800, Like Xu wrote: > In the host and guest PEBS both enabled case, > we'll get a crazy dmesg *bombing* about spurious PMI warning > if we pass the host PEBS PMI "harmlessly" to the guest: > > [11261.502536] Uhhuh. NMI received for unknown reason 2c on CPU

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-21 Thread Like Xu
On 2021/1/16 1:42, Sean Christopherson wrote: On Fri, Jan 15, 2021, Xu, Like wrote: On 2021/1/15 2:55, Sean Christopherson wrote: On Mon, Jan 04, 2021, Like Xu wrote: +* Note: KVM disables the co-existence of guest PEBS and host PEBS. By "KVM", do you mean KVM's loading of the MSRs

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-15 Thread Sean Christopherson
On Fri, Jan 15, 2021, Xu, Like wrote: > On 2021/1/15 2:55, Sean Christopherson wrote: > > On Mon, Jan 04, 2021, Like Xu wrote: > > > + * Note: KVM disables the co-existence of guest PEBS and host PEBS. > > By "KVM", do you mean KVM's loading of the MSRs provided by > > intel_guest_get_msrs()? >

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-15 Thread Xu, Like
On 2021/1/15 22:44, Peter Zijlstra wrote: On Fri, Jan 15, 2021 at 10:30:13PM +0800, Xu, Like wrote: Are you sure? Spurious NMI/PMIs are known to happen anyway. We have far too much code to deal with them. https://lore.kernel.org/lkml/20170628130748.GI5981@leverpostej/T/ In the rr workload,

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-15 Thread Peter Zijlstra
On Fri, Jan 15, 2021 at 10:30:13PM +0800, Xu, Like wrote: > > Are you sure? Spurious NMI/PMIs are known to happen anyway. We have far > > too much code to deal with them. > > https://lore.kernel.org/lkml/20170628130748.GI5981@leverpostej/T/ > > In the rr workload, the commit change "the PMI

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-15 Thread Xu, Like
On 2021/1/15 20:01, Peter Zijlstra wrote: On Thu, Jan 14, 2021 at 11:39:00AM +0800, Xu, Like wrote: Why do we need to? Can't we simply always forward the PMI if the guest has bits set in MSR_IA32_PEBS_ENABLE ? Surely we can access the guest MSRs at a reasonable rate.. Sure, it'll send too

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-15 Thread Peter Zijlstra
On Thu, Jan 14, 2021 at 11:39:00AM +0800, Xu, Like wrote: > > Why do we need to? Can't we simply always forward the PMI if the guest > > has bits set in MSR_IA32_PEBS_ENABLE ? Surely we can access the guest > > MSRs at a reasonable rate.. > > > > Sure, it'll send too many PMIs, but is that

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-14 Thread Xu, Like
On 2021/1/15 2:55, Sean Christopherson wrote: On Mon, Jan 04, 2021, Like Xu wrote: --- arch/x86/events/intel/ds.c | 62 ++ 1 file changed, 62 insertions(+) diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c index

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-14 Thread Sean Christopherson
On Mon, Jan 04, 2021, Like Xu wrote: > --- > arch/x86/events/intel/ds.c | 62 ++ > 1 file changed, 62 insertions(+) > > diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c > index b47cc4226934..c499bdb58373 100644 > ---

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-13 Thread Xu, Like
On 2021/1/14 2:22, Peter Zijlstra wrote: On Mon, Jan 04, 2021 at 09:15:29PM +0800, Like Xu wrote: diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c index b47cc4226934..c499bdb58373 100644 --- a/arch/x86/events/intel/ds.c +++ b/arch/x86/events/intel/ds.c @@ -1721,6 +1721,65

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-13 Thread Peter Zijlstra
On Wed, Jan 13, 2021 at 07:22:09PM +0100, Peter Zijlstra wrote: > Again; for the virt illiterate people here (me); why is it expensive to > check guest DS? Remember, you're trying to get someone that thinks virt is the devil's work (me) to review virt patches. You get to spell things out in

Re: [PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-13 Thread Peter Zijlstra
On Mon, Jan 04, 2021 at 09:15:29PM +0800, Like Xu wrote: > diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c > index b47cc4226934..c499bdb58373 100644 > --- a/arch/x86/events/intel/ds.c > +++ b/arch/x86/events/intel/ds.c > @@ -1721,6 +1721,65 @@

[PATCH v3 04/17] perf: x86/ds: Handle guest PEBS overflow PMI and inject it to guest

2021-01-04 Thread Like Xu
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