On Thu, Jul 20, 2023 at 01:18:33PM +0100, Jonathan Cameron wrote: > On Wed, 19 Jul 2023 14:49:07 -0400 > Gregory Price <gregory.pr...@memverge.com> wrote: > > > > > Maybe a dangerous suggestion. Right now the CCI's are static: > > > > static const struct cxl_cmd cxl_cmd_set[256][256] > > That's defined by the ID space for the commands. There can't be more than > that many currently.. >
Meant commands beyond what is defined in the spec, not beyond the 256 limits. > > > > how difficult might it be to allow these tables to be dynamic instead? > > Then we could add an interface like this: > > > > void cxl_add_cmd_set(CXLCCI *cci, CXLCCI *cmd_set, payload_max) { > > copy(cci, cmd_set); > > } > > > > This would enable not just adding sub-components piece-meal, but also if > > someone wants to model a real device with custom CCI commands, they can > > simply define a CCI set and pass it in via > > > > cxl_add_cmd_set(&ct3d->cci, my_cmd_set, payload_max); > > Ok. I'm potentially fine with people adding an interface for this, but > only if they plan to also upstream the QEMU emulation of their actual > device. > Working on it :] Hoping to show off a fully functional MHSLD with some custom commands soon, and I think I'm happy with the abstraction that fell out on top of this CCI work. Previously it required duplicating the type3 device or hacking directly on it, which is a maintenance nightmare / not upstreamable. > > I'd look to just inherit from a cxl type 3, like Ira did in the PoC for > type 2 support. We can then easily add a path to replace the commands > set with whatever anyone wants. I'm not sure we want the command line > to be used to configure such a device as it'll both get very complex and > prove increasingly hard to test more than a small subset of options. > > https://lore.kernel.org/all/20230517-rfc-type2-dev-v1-0-6eb2e4709...@intel.com/ > > Jonathan > I made an attempt at this at first, but due to the custom commands, i think everyone would (rightly) scoff at the idea of adding non-specification defined stuff into the core type 3 device. Once I shifted to modifying the CCI and overriding entries, the entire vendor device ended up as mostly the CCI command definitions, which is exactly how i envisioned doing it in the first place. I'll post some additional patches to my MHD RFC, the changes were pretty minor. Hopefully will be able to tack on a concrete MHSLD following that.. ~Gregory