All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>,
	Wanpeng Li <kernellwp@gmail.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>
Subject: Re: [PATCH] KVM: vPMU: Don't program counter for interrupt-based event sampling w/o lapic_in_kernel
Date: Mon, 25 Oct 2021 18:44:56 +0200	[thread overview]
Message-ID: <84444ec9-cebf-1ec2-ec3e-8b28e587682d@redhat.com> (raw)
In-Reply-To: <YXbb5ePpVWKxBsbh@google.com>

On 25/10/21 18:31, Sean Christopherson wrote:
>> vPMU depends on in-kernel lapic to deliver pmi interrupt, there is a
>> lot of overhead when creating/maintaining perf_event object,
>> locking/unlocking perf_event_ctx etc for vPMU. It silently fails to
>> deliver pmi interrupt if w/o in-kernel lapic currently. Let's not
>> program counter for interrupt-based event sampling w/o in-kernel
>> lapic support to avoid the whole bothering.
>
> This feels all kinds of wrong.  AFAIK, there's no way for KVM to enumerate to
> the guest that the vPMU isn't capable of generating interrupts.  I.e. any setup
> that exposes a vPMU to the guest without an in-kernel local APIC is either
> inherently broken or requires a paravirtualized guest.  I don't think KVM's bugs
> should be optimized.

Yeah, if it simplified the code it would be a different story, but here 
there's even not one but two new checks.

Paolo


      reply	other threads:[~2021-10-25 16:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  9:17 [PATCH] KVM: vPMU: Don't program counter for interrupt-based event sampling w/o lapic_in_kernel Wanpeng Li
2021-10-25 16:31 ` Sean Christopherson
2021-10-25 16:44   ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84444ec9-cebf-1ec2-ec3e-8b28e587682d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.