Re: [PATCH 2/3] KVM: arm64: Pass the PMU events to the hyp vCPU of non-protected guests

From: Fuad Tabba

Date: Wed Oct 28 2026 - 07:02:18 EST


On Tue, 27 Oct 2026 at 11:05, Vincent Donnefort <vdonnefort@xxxxxxxxxx> wrote:
[...]
> > +#ifdef CONFIG_HW_PERF_EVENTS
> > +static void flush_pmu_state(struct pkvm_hyp_vcpu *hyp_vcpu)
> > +{
> > + if (!pkvm_hyp_vcpu_is_protected(hyp_vcpu))
> > + hyp_vcpu->vcpu.arch.pmu.events = hyp_vcpu->host_vcpu->arch.pmu.events;
> > +}
> > +#else
> > +static void flush_pmu_state(struct pkvm_hyp_vcpu *hyp_vcpu) {}
> > +#endif
>
> nit: Could save a couple of lines by just doing?

The coding style says to "Prefer to compile out entire functions,
rather than portions of functions", as do similar functions here.

[...]
> Reviewed-by: Vincent Donnefort <vdonnefort@xxxxxxxxxx>
> Tested-by: Vincent Donnefort <vdonnefort@xxxxxxxxxx>

Thanks!
/fuad