>-----Original Message----- >From: Cédric Le Goater <c...@redhat.com> >Sent: Saturday, October 28, 2023 12:05 AM >Subject: Re: [PATCH v3 19/37] vfio/spapr: Introduce spapr backend and target >interface > >On 10/26/23 12:30, Zhenzhong Duan wrote: >> Introduce an empry spapr backend which will hold spapr specific >> content, currently only prereg_listener and hostwin_list. >> >> Also introduce and instantiate a spapr specific target interface, >> currently only has add/del_window callbacks. >> >> Signed-off-by: Zhenzhong Duan <zhenzhong.d...@intel.com> >> --- >> include/hw/vfio/vfio-common.h | 8 ++++++++ >> include/hw/vfio/vfio-container-base.h | 2 ++ >> hw/vfio/spapr.c | 8 ++++++++ >> 3 files changed, 18 insertions(+) >> >> diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h >> index 938f75e70c..a74e60e677 100644 >> --- a/include/hw/vfio/vfio-common.h >> +++ b/include/hw/vfio/vfio-common.h >> @@ -169,6 +169,14 @@ VFIOAddressSpace >*vfio_get_address_space(AddressSpace *as); >> void vfio_put_address_space(VFIOAddressSpace *space); >> >> /* SPAPR specific */ >> +typedef struct VFIOIOMMUSpaprOps { >> + int (*add_window)(VFIOContainerBase *bcontainer, >> + MemoryRegionSection *section, >> + Error **errp); >> + void (*del_window)(VFIOContainerBase *bcontainer, >> + MemoryRegionSection *section); >> +} VFIOIOMMUSpaprOps; > >I don't think we need a new structure type. > >If possible, these callbacks should be under VFIOIOMMUOps and only >defined in the VFIOIOMMUOps struct for spapr. This struct would a >copy of vfio_legacy_ops plus the two add/del_window handlers.
Understood, will update. Thanks Zhenzhong