Hi Peter, > -----Original Message----- > From: Peter Maydell <peter.mayd...@linaro.org> > Sent: Wednesday, February 26, 2020 9:59 PM > To: Sai Pavan Boddu <saip...@xilinx.com> > Cc: pbonz...@redhat.com; QEMU Developers <qemu-devel@nongnu.org>; > Edgar Iglesias <edg...@xilinx.com> > Subject: Re: Implementing IOMMU support for SDHCI > > On Wed, 26 Feb 2020 at 12:38, Sai Pavan Boddu <saip...@xilinx.com> > wrote: > > > > Hi Poalo/Peter, > > > > We are trying to add SMMU support for dma's used in SD controller on > ZynqMP boards. In order to do that we need a clean way to assign > MemTxAttrs to each device(i.e all devices which connect to smmu) via > "object_add_link_property/ object_set_link_property " functions. > > > > But in order to do that, first we may need to convert MemTxAttrs as QOM > object. I just need some feedback, if its advisable to do so ? > > We create and throw around MemTxAttrs structs a lot, I don't think they're > suitable to be QOM objects. I don't think you need it, anyway -- your problem > is rather that the iommu doesn't get an opportunity to sit in the middle of > transactions the way you'd like it to, and making MemTxAttrs a QOM object > doesn't help address that. [Sai Pavan Boddu] Our idea is to create dma helper function which can also pass the MemTxAttr i.e like dma_memory_rw_attr (AddressSpace *as, dma_addr_t addr, void *buf, dma_addr_t len, DMADirection dir, MemTxAttrs attr) which needs to be used in sdhci, with "AddressSpace *as" pointing to smmu.
I see we don’t need QOM variant of MemTxAttr for this functionality, but thought it would be good to use " object_add_link_property/ object_set_link_property " to set the values from machine file's. I would drop this idea, and look for other options to set the attributes. Regards, Sai Pavan > > thanks > -- PMM