RE: [PATCH v5 08/27] vfio/pci: Fall back to plain vfio-pci when CXL init fails

From: Manish Honap

Date: Fri Oct 09 2026 - 02:16:36 EST



> -----Original Message-----
> From: Alex Williamson <alex@xxxxxxxxxxx>
> Sent: Tuesday, September 22, 2026 7:45 AM
> To: Manish Honap <mhonap@xxxxxxxxxx>
> Cc: jgg@xxxxxxxx; Ankit Agrawal <ankita@xxxxxxxxxx>; jic23@xxxxxxxxxx;
> dave.jiang@xxxxxxxxx; alejandro.lucero-palau@xxxxxxx; Srirangan
> Madhavan <smadhavan@xxxxxxxxxx>; corbet@xxxxxxx;
> skhan@xxxxxxxxxxxxxxxxxxx; dave@xxxxxxxxxxxx; alison.schofield@xxxxxxxxx;
> vishal.l.verma@xxxxxxxxx; iweiny@xxxxxxxxxx; ming.li@xxxxxxxxxxxx; Yishai
> Hadas <yishaih@xxxxxxxxxx>; Shameer Kolothum Thodi
> <skolothumtho@xxxxxxxxxx>; kevin.tian@xxxxxxxxx; bhelgaas@xxxxxxxxxx;
> dmatlack@xxxxxxxxxx; kees@xxxxxxxxxx; gustavoars@xxxxxxxxxx; Neo Jia
> <cjia@xxxxxxxxxx>; Krishnakant Jaju <kjaju@xxxxxxxxxx>; Vikram Sethi
> <vsethi@xxxxxxxxxx>; Zhi Wang <zhiw@xxxxxxxxxx>; linux-
> doc@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; kvm@xxxxxxxxxxxxxxx;
> linux-cxl@xxxxxxxxxxxxxxx; linux-pci@xxxxxxxxxxxxxxx; linux-
> kselftest@xxxxxxxxxxxxxxx; linux-hardening@xxxxxxxxxxxxxxx; alex@xxxxxxxxxxx
> Subject: Re: [PATCH v5 08/27] vfio/pci: Fall back to plain vfio-pci when CXL init
> fails
>
> External email: Use caution opening links or attachments
>
>
> On Thu, 17 Sep 2026 00:05:21 +0530
> <mhonap@xxxxxxxxxx> wrote:
>
> > From: Manish Honap <mhonap@xxxxxxxxxx>
> >
> > A CXL Type-2 device is also a valid plain vfio-pci device. If the
> > vfio-cxl provider cannot bring it up as Type-2, failing the bind would
> > regress a device that previously worked as plain vfio-pci.
> >
> > Make a non-deferred CXL init failure non-fatal: log it, drop the
> > provider reference, leave cxl_ops NULL, and continue driving the
> > device as plain vfio-pci. The -EPROBE_DEFER path added earlier still
> > retries rather than falling back.
> >
> > Assisted-by: LLM
> > Signed-off-by: Manish Honap <mhonap@xxxxxxxxxx>
> > ---
> > drivers/vfio/pci/vfio_pci_core.c | 10 +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/vfio/pci/vfio_pci_core.c
> > b/drivers/vfio/pci/vfio_pci_core.c
> > index a63a4f5228b8..9a75c30b67e2 100644
> > --- a/drivers/vfio/pci/vfio_pci_core.c
> > +++ b/drivers/vfio/pci/vfio_pci_core.c
> > @@ -2271,9 +2271,17 @@ static int vfio_pci_core_cxl_init(struct
> vfio_pci_core_device *vdev)
> > vfio_pci_put_cxl_ops(ops);
> > return ret;
> > }
> > + /*
> > + * Any other failure is non-fatal: a CXL device that cannot be brought
> > + * up as Type-2 still works as plain vfio-pci, so log and continue
> > + * rather than failing the bind.
> > + */
> > if (ret) {
> > + pci_warn(vdev->pdev,
> > + "CXL init failed (%d), continuing as plain vfio-pci\n",
> > + ret);
> > vfio_pci_put_cxl_ops(ops);
> > - return ret;
> > + return 0;
> > }
> >
> > vdev->cxl_ops = ops;
>
> Why isn't this the initial implementation in patch 6? I don't fully understand
> why patches 7 and 8 are circling back to modify the broken behavior
> established in patch 6 rather than resolving it in the patch where it was
> introduced.
>
> Perhaps rephrasing the message, "... continuing without CXL support". "plain
> vfio-pci" doesn't mean anything to a user that only knows to use vfio-pci.
> Thanks,
>

Agreed. Sorry for this churn; In v6 I will fold 07 and 08 into 06, so the provider
hookup lands with its final error handling: -EPROBE_DEFER from the
provider defers the bind, and any other init error leaves the device
bound without the CXL extensions.

I will also update the error message to mention "continuing without CXL support"
and remove any references to "plain vfio-pci".

> Alex