Re: [RFC PATCH 7/9] cxl/test: Add generic mock events
From: Jonathan Cameron
Date: Tue Sep 20 2022 - 12:20:43 EST
On Thu, 15 Sep 2022 11:53:29 -0700
Ira Weiny <ira.weiny@xxxxxxxxx> wrote:
> On Thu, Aug 25, 2022 at 12:31:19PM +0100, Jonathan Cameron wrote:
> > On Fri, 12 Aug 2022 22:32:41 -0700
> > ira.weiny@xxxxxxxxx wrote:
> >
> > > From: Ira Weiny <ira.weiny@xxxxxxxxx>
> > >
> > > Facilitate testing basic Get/Clear Event functionality by creating
> > > multiple logs and generic events with made up UUID's.
> > >
> > > Data is completely made up with data patterns which should be easy to
> > > spot in trace output.
> > Hi Ira,
> >
> > I'm tempted to hack the QEMU emulation for this in with appropriately
> > complex interface to inject all the record types...
>
> Every time I look at the QEMU code it makes my head spin. :-(
You get used to it ;)`
>
> I really thought about adding some support there. And I think for irq's it may
> work better? But after your talk today I did a quick search to see what it
> would take to do irqs in QEMU and got even more confused. :-(
Copy an example - though we haven't upstreamed any yet...
Either...
https://gitlab.com/jic23/qemu/-/commit/958fec58582b5cc910d2da4e2b855e134bb2c0c3#3dfd54f69a5f2382ddf5a6c00a52546d8b57316e_0_169
Or the CPMU one.
https://lore.kernel.org/all/20220831153336.16165-2-Jonathan.Cameron@xxxxxxxxxx/
to setup then look for msix_notify in
https://lore.kernel.org/all/20220831153336.16165-4-Jonathan.Cameron@xxxxxxxxxx/
>
> > Lots to do there though, so not sure where this fits in my priority list!
>
> I bet it is higher on mine! ;-)
:)
>
> >
> > >
> > > Test traces are easy to obtain with a small script such as this:
> > >
> > > #!/bin/bash -x
> > >
> > > devices=`find /sys/devices/platform -name cxl_mem*`
> > >
> > > # Generate fake events if reset is passed in
> >
> > reset is rather unintuitive naming.
> >
> > fill_event_queue maybe or something more in that direction?
>
> Fair enough... Naming is hard and I'm one of the worst.
>
> I've changed to
>
> <sysfs>/.../event_fill_queue
> <sysfs>/.../event_trigger
>
> Thoughts?
Works for me.
..
J