Re: [PATCH 3/4 v5] cxl/core: Enable Region creation on x86 with LMH

From: Gregory Price
Date: Thu Oct 09 2025 - 10:30:30 EST


On Tue, Oct 07, 2025 at 01:25:11PM -0700, Dave Jiang wrote:
> On 10/6/25 10:46 AM, Gregory Price wrote:
> >> @@ -1779,8 +1788,13 @@ static int match_cxlsd_to_cxled_by_range(struct device *dev, const void *data)
> >> r1 = &cxlsd->cxld.hpa_range;
> >> r2 = &cxled->cxld.hpa_range;
> >>
> >> - if (is_root_decoder(dev))
> >> - return range_contains(r1, r2);
> >> + if (is_root_decoder(dev)) {
> >> + if (range_contains(r1, r2))
> >> + return 1;
> >> + cxlrd = to_cxl_root_decoder(dev);
> >> + if (platform_cxlrd_matches_cxled(cxlrd, cxled))
> >> + return 1;
> >> + }
> >
> > Is there any concern for longer term maintainability if addition
> > match_*() functions are added? Or is this upkeep just the unfortunate
> > maintenance cost of supportering the quirk?
>
> Suggestions welcome. Would be nice if we have cleaner ways of dealing with this.
>

Had a bit of a think about it, but nothing immediately pops out
that doesn't just end with more obfuscation. It is what it is.

~Gregory