[PATCH 2/3] KVM: arm64: Pass the PMU events to the hyp vCPU of non-protected guests
Fuad Tabba
fuad.tabba at linux.dev
Wed Oct 28 04:01:15 PDT 2026
On Tue, 27 Oct 2026 at 11:05, Vincent Donnefort <vdonnefort at google.com> 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 at google.com>
> Tested-by: Vincent Donnefort <vdonnefort at google.com>
Thanks!
/fuad
More information about the linux-arm-kernel
mailing list