Re: Re: [PATCH] cxl/mbox: bound the device-supplied command return code

From: Alison Schofield

Date: Wed Oct 14 2026 - 17:40:50 EST


On Wed, Oct 14, 2026 at 10:48:51PM +0800, 黄高彬 wrote:
> Hi Alison,
>
> Thank you for picking it up, and for the corrections.
>
> > (Sashiko is right here. PADDR and POISONLMT don't map to -ENXIO, so the
> > comment and changelog claim isn't accurate. -ENXIO is still the right
> > fallback for an unknown code.)
>
> You are both right: the claim should be that an unknown code is still a failure
> and that -ENXIO keeps it in the usual device-error class -- not that every
> non-success entry maps to -ENXIO. Please use that wording in the version you
> carry; I will not repost the patch on its own.

The version in the v1 cxl-kunit patchset[1] already avoids that claim. It reports
unknown codes as -ENXIO, "the errno used for most device-reported errors".


>
> > I'm taking this into a series that adds CXL KUnit tests, including a
> > regression test for this table. You'll get CC'd when it posts and I'll need
> > you ACK it since it has your original authorship with changes from me added.
>
> Understood -- I will ACK as soon as it posts.
>
> > It looks like the return code you saw is valid for CXL 4.0 and just not added
> > to CXL driver yet. ... CXL 4.0, Table 8-208 ... 001Fh and 0020h
> > I don't think anyone else has sent a patch for that yet, so you can if you
> > like.
>
> Two things there, and I would rather not collide with your series:
>
> - The KASAN reproduction used 0x1f, which stops being out of range once 001Fh is
> in the table. Out of range is any code past the end of the table, so with
> 001Fh and 0020h added it is 0021h upwards -- the bound itself is unchanged.
> - Adding the two entries is a separate change from the bound. Do you want it in
> your series next to the KUnit test, so the boundary and the test move
> together, or as a standalone patch from me after yours? Either is fine. If
> you would rather have it from me, I will take the names and errno mappings
> from Table 8-208 and send it separately.

Standalone patch from you please. It doesn't need to wait on the series.
The table can be extended without touching the test.

The test has 2 cases that read the table:
- Walk every code in the table and check each errno return. It loops up
to the table size, so the new entries your patch adds will get picked
up automatically.

- Checks codes past the end of the table. Its first code is the table
size itself, so today it's 001Fh and w your patch it'll be 0021h.

The test only needs a change if a new code maps to an errno other than
-ENXIO.

This conversation made me aware that the testing page could say more
about maintenance of the unit tests. Take a look here [2]


[1] https://lore.kernel.org/linux-cxl/3ed8f5db3f21c937d8783f31ee6faca3703ba72a.1791949910.git.alison.schofield@xxxxxxxxx/
[2] https://lore.kernel.org/linux-cxl/as_1dGrwsPYTlZrp@xxxxxxxxxxxxxxxxxx/


-- Alison


>
> Thanks,
> Gaobin