> -----Original Message----- > From: Jonathan Cameron <[email protected]> > Sent: Thursday, November 12, 2026 7:22 AM > To: Manish Honap <[email protected]> > Cc: Alex Williamson <[email protected]>; [email protected]; > [email protected]; [email protected]; Zhi Wang > <[email protected]>; [email protected]; [email protected]; > [email protected]; [email protected]; [email protected]; Ankit > Agrawal <[email protected]>; Vikram Sethi <[email protected]>; Shameer > Kolothum Thodi <[email protected]>; Matt Ochs > <[email protected]>; Neo Jia <[email protected]>; Krishnakant Jaju > <[email protected]>; [email protected]; [email protected]; > Yukiya Takaki <[email protected]> > Subject: Re: [RFC 00/18] hw/cxl: Add a CXL Type-2 device > > External email: Use caution opening links or attachments > > > On Fri, 6 Nov 2026 09:28:53 +0530 > <[email protected]> wrote: > > > From: Manish Honap <[email protected]> > > > > Hello, > > > > This series adds cxl-type2, an emulated CXL Type-2 device with > > volatile device memory. It is emulated in such a way that all the > > Linux checks are satisfied so that CXL passthrough using vfio-pci > > (vfio-cxl) can be developed and tested in a guest without Type-2 hardware. > > > > This series builds on the Type-2 model from Zhi's series (carried in > > Cédric's tree) and carries one fix from Shuai's tree. Shuai's tree > > also set up the decoders through device properties and stubbed CXL > > Reset; the firmware setup and CXL Reset here are new code. > > Carried patches keep their authors, with a note for each change. > > > > The device: > > - PCI ID 1b36:0017 and the processing accelerator class 0x1200; > > - PCIe DVSEC for CXL Devices with CXL.cache, CXL.mem, one HDM range, > > cache write-back and invalidate, CXL Reset and Mem Clr; Register > > Locator and Flex Bus Port DVSECs; > > - CXL.cache advertised but not modelled. The device sends no CXL.cache > > requests, and its memory is host RAM, which is coherent already. A > > cache write-back and invalidate completes at once. The capability is > > set because vfio-cxl takes a device as Type-2 only when it reports > > both CXL.cache and CXL.mem; > > - component registers with one HDM decoder; > > - slot 0, function 0 below a CXL root port of a pxb-cxl, memory in one > > fixed memory window selected with fmw-index, cold plug only (no > > hotplug or unplug), not migratable. > > > > No Linux driver claims the device on its own. cxl_pci does not bind to > > the accelerator class, and sfc, the other driver that calls the CXL > > core Type-2 interface, matches only its own devices. A guest binds > > cxl-type2 to vfio-pci, which hands it to vfio-cxl. Testing the CXL > > core > > Type-2 interface without vfio-cxl needs a driver for 1b36:0017 that > > calls it. There is none yet. > > > > QEMU has no firmware that commits the HDM decoders of a CXL route at > > boot, and Linux attaches a Type-2 device only to a committed region > > (devm_cxl_probe_mem()). So QEMU does that step itself. > > Just in case you missed it, Yukiya Takaki is looking at bios programmed flows. > https://lore.kernel.org/all/[email protected]/ > > My immediate thought is follow a similar flow to the one I suggested in that > patch. Doing CXL setup in QEMU but the PCI enumeration in the bios doesn't > seem like a sustainable model to me. I'd much prefer to see a bios flow with > just the QEMU generate tables updated in a similar fashion to how DSDT is > updated for PXBs. > > Alternative for you (assuming you care more about arm than x86) might be to > just use the SBSA model and do the full enumeration in firmware. > > Unfortunately I have quite a large backlog so might be a while before I get a > chance to take a close look at this series (or the kernel ones!) > > Jonathan >
Thank you Jonathan; I will take a look at the suggested series and SBSA model for this.
