[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V2 6/6] iommu/arm: Add Renesas IPMMU-VMSA support


  • To: Oleksandr <olekstysh@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
  • Date: Thu, 8 Aug 2019 04:05:35 +0000
  • Accept-language: ja-JP, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=renesas.com;dmarc=pass action=none header.from=renesas.com;dkim=pass header.d=renesas.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V734lPgN3t4UwAEpLrqrVRXqA4vjflQ+UxXyH9eOstY=; b=TSs0gYXnTEIkzomMhZKvoP0Ce8dXqb+WeJcSY1kfB9aPGUH17zYJEmhWWhWf/7bFr36zY5ZkXRubUijUbG4wIFj9727iSt8ubAd6xUG4VCqIKMsZdqgNp6oeoOAz2Ir2iXRtKLHYrYUKa6TNgyn0+YsmS0XSehKeCNPkozfUifNPuaAAU+zhQiD+qWg2XJeRXTxXX1ckYrbu09/nJ/qfj2IKJeAafcjUXXShPMBNDyxjP8nCJL0ffOmbQuL24XV0g9TFYT3CthsGbZ14jSt5HLRYumWMArzZNPkWKRxGSFXogRhmQDNns3JTiKszFxCAFxX0gHzyHczrFx3gScq44g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VQV69Q7FHjkfw6qTZw3mkiZZZypCVy8S5S/P5WWaZZzbbX3YMcArjOchstte9cuCcgG5N2a4piDp4THqQWspc5UQ4Y/P2Cdd3GCfUOKW/SEf+MwstUBzMhlOEYawQUeqYoMWHIQxtxcblc27JJRhhGUqaFp8H9UGP6toW5zE5P6IDZP44Hlo6JoC0AYpxbMqJIhxZQdwbxVPGLOblVmv6TlFLNMmUMkTnxUUgNlpnxC/j31+/fOqWntJOwnfYzone/UUuMKKnQo6GwW4tMkimsF4PRmjeqtJlw6I0mqNV6N1HOwIpnI/F7j/xdmIJiuW/403HQgZ+BYLX2iKMioFoA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=yoshihiro.shimoda.uh@xxxxxxxxxxx;
  • Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, "julien.grall@xxxxxxx" <julien.grall@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 08 Aug 2019 04:05:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVSVDyIlUrtkBxi0Kon+v5VwnGjKbu/2/ggADgoICAAMffgA==
  • Thread-topic: [PATCH V2 6/6] iommu/arm: Add Renesas IPMMU-VMSA support

Hi Oleksandr-san,

> From: Oleksandr, Sent: Thursday, August 8, 2019 1:01 AM
> 
> 
> Hi, Shimoda-san.
> 
> Thank you for the review.

You're welcome.

<snip>
> > +/* Xen IOMMU ops */
> >> +static int __must_check ipmmu_iotlb_flush_all(struct domain *d)
> >> +{
> >> +    struct ipmmu_vmsa_xen_domain *xen_domain = dom_iommu(d)->arch.priv;
> >> +
> >> +    if ( !xen_domain || !xen_domain->root_domain )
> >> +        return 0;
> >> +
> >> +    spin_lock(&xen_domain->lock);
> > Is local irq is already disabled here?
> > If no, you should use spin_lock_irqsave() because the ipmmu_irq() also
> > gets the lock.
> 
> 
> No, it is not disabled. But, ipmmu_irq() uses another mmu->lock. So, I
> think, there won't be a deadlock.
> 
> Or I really missed something?

You're correct. I didn't realized that ipmmu_irq() used another mmu->lock.

> If we worry about ipmmu_tlb_invalidate() which is called here (to
> perform a flush by request from P2M code, which manages a page table)
> and from the irq handler (to perform a flush to resume address
> translation), I could use a tasklet to schedule ipmmu_tlb_invalidate()
> from the irq handler then. This way we would get this serialized. What
> do you think?

I just concerned about a dead-lock issue by recursive spin locks.
So, calling ipmmu_tlb_invalidate() here is OK, I think.

Best regards,
Yoshihiro Shimoda

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.