Re: [PATCH v4 1/7] platform/x86/intel/pmt: Export PMT enumeration functions as GPL

From: Christoph Hellwig

Date: Thu Apr 09 2026 - 01:41:37 EST


On Wed, Apr 08, 2026 at 05:01:54PM +0000, Luck, Tony wrote:
> >> The symbol_get() function requires that objects be GPL licensed.
> >
> > Please don't add new uses of symbol_get, as we've been slowly trying
> > to kill it off. If you have bidirectional dependencies just add an
> > registration module in the middle to resolve it.
>
> In my case I have "resctrl" (which is built-in, and likely to stay that way) that
> needs functions from the "pmt_discovery" module to enumerate which
> event counters are present.
>
> Should I add EXPORT_SYMBOL_GPL(some registration function) to resctrl
>
> and have the pmt_discovery code call that to provide pointers to resctrl?

Yes, if your dependency only goes one-way against the normal flow,
that's by far the easiest. Bonus point for bounding that registration
on an object fitting the natural scope through OF/fwnode/acpi_dev or
whatever fits here.