[RFC PATCH v7 06/28] KVM: arm64: Add KVM_CAP_ARM_SPE capability

Alexandru Elisei alexandru.elisei at arm.com
Fri Nov 27 06:58:33 PST 2026


Hi Lorenzo,

On Mon, Nov 16, 2026 at 06:29:51PM +0000, Lorenzo Stoakes (ARM) wrote:
[..]
> On Thu, Nov 12, 2026 at 03:34:15PM +0000, Alexandru Elisei wrote:
[..]
> > On Thu, Oct 15, 2026 at 05:51:03PM +0100, Lorenzo Stoakes (ARM) wrote:
[..]
> > > On Thu, Sep 03, 2026 at 05:06:01PM +0100, Alexandru Elisei wrote:
[..]
> > > > +
> > > > +static LIST_HEAD(spe_pmus);
> > > > +static DEFINE_MUTEX(spe_pmus_lock);
> > > > +
> > > > +struct spe_pmu_entry {
> > > > +	struct list_head link;
> > > > +	struct arm_spe_pmu *spe_pmu;
> > > > +};
> > >
> > > This seems like an odd way of making this into a list, can't you just embed
> > > list_head in arm_spe_pmu?
> > >
> > > Then adding becomes:
> > >
> > > list_add_tail(&spe_pmu->link, &spu_pmus);
> > >
> > > And removing:
> > >
> > > list_del(&spe_pmu->link);
> > >
> > > And you can avoid the alloc below too.
> >
> > This is the same pattern used for the PMU. Seems like a small thing, so I
> > think consistency is better? I don't expect more than three SPE instances
> > in a system (little + medium + big), so the extra 3 * 8 bytes should not be
> > an issue?
> >
> > On the other hand, it is indeed more common to embed list_head in struct
> > arm_spe_pmu. Up to you what you prefer.
> 
> I'd prefer the embedded, and I think we shouldn't be too intent on following
> PMU's patterns _entirely_, especially in a case like this which really
> significantly simplifies everything.

Ok.

Thanks,
Alex



More information about the linux-arm-kernel mailing list