Re: [PATCH] cxl/hdm: allow zero sized committed decoders
From: Vishal Aslot
Date: Sat Oct 04 2025 - 09:49:45 EST
> ________________________________________
> From: Gregory Price <gourry@xxxxxxxxxx>
> Sent: Friday, October 3, 2025 9:23 AM
> To: Vishal Aslot
> Cc: Dave Jiang; Davidlohr Bueso; Jonathan Cameron; Alison Schofield; Vishal Verma; Ira Weiny; Dan Williams; Li Ming; Peter Zijlstra; Dan Carpenter; Zijun Hu; linux-cxl@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] cxl/hdm: allow zero sized committed decoders
>
> External email: Use caution opening links or attachments
>
>
> On Fri, Oct 03, 2025 at 01:03:16AM +0000, Vishal Aslot wrote:
>> > ________________________________________
>> > From: Dave Jiang <dave.jiang@xxxxxxxxx>
>> > Sent: Thursday, October 2, 2025 10:32 AM
>> > To: Gregory Price; Vishal Aslot
>> > Cc: Davidlohr Bueso; Jonathan Cameron; Alison Schofield; Vishal Verma; Ira Weiny; Dan Williams; Li Ming; Peter Zijlstra; Dan Carpenter; Zijun Hu; linux-cxl@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
>> > Subject: Re: [PATCH] cxl/hdm: allow zero sized committed decoders
>> >
>> > External email: Use caution opening links or attachments
>> >
>> >
>> > On 10/1/25 10:48 PM, Gregory Price wrote:
>> >> On Wed, Oct 01, 2025 at 08:37:26PM +0000, Vishal Aslot wrote:
>> >>> @@ -1210,6 +1210,11 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
>> >>> rc = init_hdm_decoder(port, cxld, target_map, hdm, i,
>> >>> &dpa_base, info);
>> >>> if (rc) {
>> >>> + if (rc == -ENOSPC) {
>> >>> + put_device(&cxld->dev);
>> >>> + rc = 0;
>> >>> + continue;
>> >>> + }
>> >>
>> >> How do you suggest actually testing this? I briefly poked at this in
>> >> QEMU trying to commit decoders, but i found myself incapable of
>> >> exercising this path.
>>
>> I tested it locally with our BIOS (UEFI) where we commit and lock all decoders and
>> all except decoder 0 are zero-sized.
>>
>
> Ahhh, so are you saying that you will only ever observe the following
> (as an example)
>
> endpoint decoders...
> decoder2.0 -> available and can be programmed
> decoder2.1 -> size=0, locked
> ...
> decoder2.N -> size=0, locked
>
> or are you suggesting the following is valid:
>
> decoder2.0 -> size=0, locked
> decoder2.1 -> available and can be programmed
> ...
> decoder2.N -> available and can be programmed
>
> ~Gregory
The first case is what we've got. In our case, the HB has 4 decoders. The end point (a Montage card with single port) has two decoders. For both, we commit & lock all decoders and all decoders except decoder<port>.0 are zero-sized.