[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87lf2zpodw.wl-maz@kernel.org>
Date: Mon, 11 Oct 2021 16:33:31 +0100
From: Marc Zyngier <maz@...nel.org>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Guo Ren <guoren@...nel.org>, Nick Hu <nickhu@...estech.com>,
Greentime Hu <green.hu@...il.com>,
Vincent Chen <deanbo422@...il.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Paolo Bonzini <pbonzini@...hat.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Juergen Gross <jgross@...e.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
James Morse <james.morse@....com>,
Alexandru Elisei <alexandru.elisei@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Stefano Stabellini <sstabellini@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
kvmarm@...ts.cs.columbia.edu, linux-csky@...r.kernel.org,
linux-riscv@...ts.infradead.org, kvm@...r.kernel.org,
xen-devel@...ts.xenproject.org,
Artem Kashkanov <artem.kashkanov@...el.com>,
Like Xu <like.xu.linux@...il.com>,
Zhu Lingshan <lingshan.zhu@...el.com>
Subject: Re: [PATCH v3 12/16] KVM: Move x86's perf guest info callbacks to generic KVM
On Mon, 11 Oct 2021 15:46:25 +0100,
Sean Christopherson <seanjc@...gle.com> wrote:
>
> On Mon, Oct 11, 2021, Marc Zyngier wrote:
> > On Wed, 22 Sep 2021 01:05:29 +0100, Sean Christopherson <seanjc@...gle.com> wrote:
> > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> > > index ed940aec89e0..828b6eaa2c56 100644
> > > --- a/arch/arm64/include/asm/kvm_host.h
> > > +++ b/arch/arm64/include/asm/kvm_host.h
> > > @@ -673,6 +673,14 @@ int io_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa);
> > > void kvm_perf_init(void);
> > > void kvm_perf_teardown(void);
> > >
> > > +#ifdef CONFIG_GUEST_PERF_EVENTS
> > > +static inline bool kvm_arch_pmi_in_guest(struct kvm_vcpu *vcpu)
> >
> > Pardon my x86 ignorance, what is PMI? PMU Interrupt?
>
> Ya, Performance Monitoring Interrupt. I didn't realize the term wasn't
> common perf terminology. Maybe kvm_arch_perf_events_in_guest() to be
> less x86-centric?
Up to you. I would be happy with just a comment.
>
> > > +{
> > > + /* Any callback while a vCPU is loaded is considered to be in guest. */
> > > + return !!vcpu;
> > > +}
> > > +#endif
> >
> > Do you really need this #ifdef?
>
> Nope, should compile fine without it, though simply dropping the #ifdef
> would make make the semantics of the function wrong, even if nothing
> consumes it. Tweak it to use IS_ENABLED()?
>
> return IS_ENABLED(CONFIG_GUEST_PERF_EVENTS) && !!vcpu;
LGTM.
M.
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists