Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2742335pxt; Mon, 9 Aug 2021 07:55:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMkbCBi1jCf/4TpjqkIRXvrEyAoIexolIKPvFc9s8wGwNKMxjId3bujLcVog1Q97pyqUs7 X-Received: by 2002:a5d:8596:: with SMTP id f22mr83210ioj.147.1628520920598; Mon, 09 Aug 2021 07:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628520920; cv=none; d=google.com; s=arc-20160816; b=vNtlT4oAcDNlD+AvKYErtHSVux05GwE6ePcbat6yT0+D8wS3vCorfmfXVkCeXi+NGU mr/nT2nqBV+hq7NlW4wFCASxGfJ+rcBfbjy4SZTPFWsfLJUkDoyQeUwyMw8dNuieJtug ktcQM6xi68J5j/j8e7H7BgAcXhVOPrQlOHhou69EQTCbN0VCJPIlaXH/suJFPtGFRR26 gcJJKCBmvmggcxk6cs0vz4AHIPFYpPrjuTt5QdT4UrASKmPhaGIVPm4q6/jfs102MWTi a2eLK+6fINuxNLENWpgeN18uu4CFwV3pruKGNrBUr4H8aci9SFmYhjXbs9bAVtWdQMqU TzIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=sFPtUU510L5ID+ali1kw++CmlUqkCBJS2RuMVdyQFcU=; b=nYky2sBYu5lkjqpxrmejMzGjaqGIK1GEgt40Z7sBZxC318fiRmDiTs5UMap3vS3vXA bspfVOefD4IV4wbYniqvfry5Ho1Uoe14mdhIplt9xLJw85ZO8IZkVW6MvSQncu7I+s8S kMDzWOmoWQt9FVpGYGYdHm34+mQ3Y2s8BTOlF4isNeq4vKudD9hCLvDXhWuXCDwBth6v Wa5kQoXNK/cTEodViP+cRFcob06P2R6BxUbYpyLhlq0QLEqtNvsElGZ6U5zIO/bnZKwC BrNtEIL+ubLIXS0fJR+GxjsPesuHuDbkqVoJcPYOTEOtfORx5bLILW/5rEhFZWKPeNqG +TUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7uTiTy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si18696172jat.32.2021.08.09.07.55.09; Mon, 09 Aug 2021 07:55:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7uTiTy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234207AbhHIOyq (ORCPT + 99 others); Mon, 9 Aug 2021 10:54:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:42788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231478AbhHIOyp (ORCPT ); Mon, 9 Aug 2021 10:54:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1060361019; Mon, 9 Aug 2021 14:54:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628520865; bh=bmXVwPlv6jk+hRMVAM5D4Cs70KB/HmWxl8NzlqT1h3Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V7uTiTy2Kf1c07ZG3hdoJ0Z0CAd7XAPl8BYfYNci13TAph9dskWb7jRojZJIntqy0 Z5TLF+8ycGekFWW2v+N94vRD3YKFQkQAWZc9PsE2q4D+uJsXpTQL6LQk1iS+yn2U6p 8awKSOLddbyn7XQ3tCY5bqnVPkJIdkv7DE97jO1qJP/EY6E8rEyWfLhp+k9B6cgdQ4 mgvkx/fnD/U32LrnmYk6XDiYt6z5v7N/Qzkp3hBvMw0+m4LZ9uEGD9Ypj553UiVlU+ xY1Ik/3nNsdT7bs14C5m1wF3tXjF3bCgTpB/4hnVAEg3TXDHF4aMEKzroKESa84wSz LoNspFqPTrubw== Date: Mon, 9 Aug 2021 15:54:20 +0100 From: Will Deacon To: Robin Murphy Cc: Ashish Mhetre , vdumpa@nvidia.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [Patch V2 0/2] iommu/arm-smmu: Fix races in iommu domain/group creation Message-ID: <20210809145420.GB1458@willie-the-truck> References: <1623961837-12540-1-git-send-email-amhetre@nvidia.com> <20210802151607.GF28735@willie-the-truck> <9c38c53c-c145-097a-4c7e-40f1c06a1f01@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c38c53c-c145-097a-4c7e-40f1c06a1f01@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 02, 2021 at 04:46:37PM +0100, Robin Murphy wrote: > On 2021-08-02 16:16, Will Deacon wrote: > > On Fri, Jun 18, 2021 at 02:00:35AM +0530, Ashish Mhetre wrote: > > > Multiple iommu domains and iommu groups are getting created for the devices > > > sharing same SID. It is expected for devices sharing same SID to be in same > > > iommu group and same iommu domain. > > > This is leading to context faults when one device is accessing IOVA from > > > other device which shouldn't be the case for devices sharing same SID. > > > Fix this by protecting iommu domain and iommu group creation with mutexes. > > > > Robin -- any chance you could take a look at these, please? You had some > > comments on the first version which convinced me that they are needed, > > but I couldn't tell whether you wanted to solve this a different way or not. > > Sorry, I was lamenting that this came to light due to the > of_iommu_configure() flow being yucky, but that wasn't meant to imply that > there aren't - or couldn't be in future - better reasons for > iommu_probe_device() to be robust against concurrency anyway. I do think > these are legitimate fixes to make in their own right, even if the current > need might get swept back under the rug in future. > > I would say, however, that the commit messages seem to focus too much on the > wrong details and aren't overly useful, and patch #2 is missing Ashish's > sign-off. Ashish -- please can you send a v3 fixing these issues? Will