Re: [PATCH] cxl/acpi: Verify CHBS length for CXL2.0
From: Dan Williams
Date: Thu Mar 27 2025 - 09:36:23 EST
Zhijian Li (Fujitsu) wrote:
>
>
> On 27/03/2025 11:44, Ira Weiny wrote:
> > Li Zhijian wrote:
> >> Per CXL Spec r3.1 Table 9-21, both CXL1.1 and CXL2.0 have defined their
> >> own length, verify it to avoid an invalid CHBS
> >
> >
> > I think this looks fine. But did a platform have issues with this?
>
> Not really, actually, I discovered it while reviewing the code and
> CXL specification.
>
> Currently, this issue arises only when I inject an incorrect length
> via QEMU environment. Our hardware does not experience this problem.
>
>
> > Does this need to be backported?
> I remain neutral :)
What does the kernel do with this invalid CHBS from QEMU? I would be
happy to let whatever bad effect from injecting a corrupted CHBS just
happen because there are plenty of ways for QEMU to confuse the kernel
even if the table lengths are correct.
Unless it has real impact I would rather not touch the kernel for every
possible way that QEMU can make a mistake.
I.e. if it was a widespread problem that affected multiple QEMU users by
default then maybe. Just your local test gone awry? Maybe not.