On Thu, 2021-12-09 at 16:47 +0100, Christian Borntraeger wrote: > Am 07.12.21 um 21:57 schrieb Matthew Rosato: > > KVM will need information on the special handle mask used to indicate > > emulated devices. In order to obtain this, a new type of list pci call > > must be made to gather the information. Remove the unused data pointer > > from clp_list_pci and __clp_add and instead optionally pass a pointer to > > a model-dependent-data field. Additionally, allow for clp_list_pci calls > > that don't specify a callback - in this case, just do the first pass of > > list pci and exit. > > > > Signed-off-by: Matthew Rosato <mjrosato@xxxxxxxxxxxxx> > > --- > > arch/s390/include/asm/pci.h | 6 ++++++ > > arch/s390/include/asm/pci_clp.h | 2 +- > > arch/s390/pci/pci.c | 19 +++++++++++++++++++ > > arch/s390/pci/pci_clp.c | 16 ++++++++++------ > > 4 files changed, 36 insertions(+), 7 deletions(-) > > ---8<--- > > > > +int zpci_get_mdd(u32 *mdd) > > +{ > > + struct clp_req_rsp_list_pci *rrb; > > + int rc; > > + > > + if (!mdd) > > + return -EINVAL; > > + > > + rrb = clp_alloc_block(GFP_KERNEL); > > + if (!rrb) > > + return -ENOMEM; > > + > > + rc = clp_list_pci(rrb, mdd, NULL); > > + > > + clp_free_block(rrb); > > + return rc; > > +} > > +EXPORT_SYMBOL_GPL(zpci_get_mdd); > > Maybe move this into pci_clp.c to avoid the export of clp_alloc_block and void clp_free_block? > Niklas? That was actually my idea. I'm thinking of moving clp_get_state(), clp_scan_pci_devices(), ans clp_refresh_fh() to pci.c too because I feel these deal with higher level concerns than the rest of pci_clp.c. I have no strong opinion though and might be thinking ahead to much here. With the change discussed in the other mail of not modifying clp_list_pci() maybe it would be better to keep it here and thus this patch more focused and minimal and then possibly move it with the other similar functions.