On 16/07/2019 11:31, Paul Durrant wrote: >> -----Original Message----- >> From: Andrew Cooper <andrew.coop...@citrix.com> >> Sent: 16 July 2019 11:26 >> To: Paul Durrant <paul.durr...@citrix.com>; xen-devel@lists.xenproject.org >> Cc: Jan Beulich <jbeul...@suse.com>; George Dunlap >> <george.dun...@citrix.com>; Ian Jackson >> <ian.jack...@citrix.com>; Julien Grall <julien.gr...@arm.com>; Konrad >> Rzeszutek Wilk >> <konrad.w...@oracle.com>; Stefano Stabellini <sstabell...@kernel.org>; Tim >> (Xen.org) <t...@xen.org>; >> Wei Liu <w...@xen.org> >> Subject: Re: [PATCH v3 3/4] iommu: introduce iommu_groups >> >> On 16/07/2019 11:16, Paul Durrant wrote: >>> +int iommu_group_assign(struct pci_dev *pdev, void *arg) >>> +{ >>> + const struct iommu_ops *ops = iommu_get_ops(); >>> + int id; >>> + struct iommu_group *grp; >>> + >>> + if ( !ops->get_device_group_id ) >>> + return 0; >>> + >>> + id = ops->get_device_group_id(pdev->seg, pdev->bus, pdev->devfn); >>> + if ( id < 0 ) >>> + return -ENODATA; >>> + >>> + grp = get_iommu_group(id); >>> + if ( !grp ) >>> + return -ENOMEM; >>> + >>> + if ( iommu_verbose ) >>> + printk(XENLOG_INFO "Assign %04x:%02x:%02x.%u -> IOMMU group %x\n", >> No unadorned hex numbers please. This is a recipe for confusion during >> debugging. >> >> Either %#x, or %u, and needs to be fixed on commit if we go with that route. > Personally I prefer the abstract iommu group index, more like Linux. I'd be > happy to re-instate that and use %u. As for the %x here, I view it the same > as the unadorned %x for seg, bus, and dev... but I'm not really fussy if you > want to add a '#'.
I don't mind if it is rendered in hex or dec, but it must not be ambiguous when printed. Otherwise trying to debug issues to do with IOMMU group 12 is going to be a lesson in pain and misery. PCI coordinates are not ambiguous, even when they lack the 0x prefix. Plain numbers are. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel