From: Dmitry Safonov via iommu Subject: Re: [RFC 0/3] iommu/iova: Unsafe locking in find_iova() Date: Mon, 09 Jul 2018 18:57:49 +0100 Message-ID: <1531159069.3205.63.camel@arista.com> References: <20180621180823.805-1-dima@arista.com> <20180706131611.h3w2kdinmjguikgo@8bytes.org> <1530886247.3205.53.camel@arista.com> <20180706151321.sq25kc7otgjo3xvn@8bytes.org> Reply-To: Dmitry Safonov Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180706151321.sq25kc7otgjo3xvn-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Joerg Roedel Cc: Dmitry Safonov <0x7f454c46-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, David Woodhouse , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: iommu@lists.linux-foundation.org On Fri, 2018-07-06 at 17:13 +0200, Joerg Roedel wrote: > On Fri, Jul 06, 2018 at 03:10:47PM +0100, Dmitry Safonov wrote: > > Yes, as far as I can see, there are code-paths which may try to > > handle > > it at the same time: > > o memory notifiers for hot-unplug (intel-iommu.c) > > o drivers unloading calls free_iova(), which in the result calls > > find_iova() > > o I see at least one driver that frees iova during it's normal work > > too: scif_rma.c:scif_free_window_offset() > > Yeah, but the IOVAs freed in the memory notifiers are just the ones > for > the direct-mapped RMRR regions requested by firmware, not the IOVAs > allocated by any driver, so I think this shouldn't be a problem. Ok, than drop it, please. I thought that safer API + nice diffstat can justify the change, but whatever %) -- Thanks, Dmitry