RE: [PATCH v5 02/40] x86/resctrl: Add a helper to avoid reaching into the arch code resource list

From: Luck, Tony
Date: Fri Oct 18 2024 - 13:15:42 EST


> > Maybe make sure the array is padded out to the right size?
> >
> > struct rdt_hw_resource rdt_resources_all[RDT_NUM_RESOURCES - 1] = {

Thinko on my part. The " - 1" is wrong. Array size must be RDT_NUM_RESOURCES.

> > ...
> > };
>
> Sure.
>
> I was planning to do away with the 'must not return NULL' behaviour before extra resources
> start appearing. It's done like this to avoid the churn when x86 supports 'all' the
> resources anyway, buy you're right it can be less-churn and safer at the same time!

-Tony