Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2975904imm; Fri, 24 Aug 2018 08:27:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY6LqOHp8eJJpjaUIQVZQMpZAbGfNCYadOfQItIIvu3hcBj3rSCT5TgKaslLtNoRB1uyu9V X-Received: by 2002:a17:902:7d93:: with SMTP id a19-v6mr2139731plm.215.1535124459300; Fri, 24 Aug 2018 08:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535124459; cv=none; d=google.com; s=arc-20160816; b=eAkuy9DQiLsi9517g3FyJjGfjRJqSyRGkVkG7CzZ9mXSIWWUeFGcBu024AsAKwfucK d6scZjb0f7qS8arJWHiQ4FFFu+2Dw6VY+CinL1bCOceMrqaeZLjloEnd8Mytk2hUE1V+ znPb313PITkMfkLeQIA6K1f6YBOlyocINGugOuiYCAAVAIgb719aAh6Q34KqE6I2Sv2f VmR5rCiN+44x+d6iAVBiO0X93rRO/yrYkx6Ayc4USukoZ9K4e+s5y4lRzLC2nQkqTZAa 7+0ThPkFIalUZ2DL+sFjpDM1kRWILqZYxensN+1C+0sd8P3J0eF4Bp+jIzBP/LCsMcHD yWQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=aBLzZB0vY0te3JRD07A83+hwPVnE1Z8KyRmsnCW0y+4=; b=I2r8lSsZK/IAjzw9v7TTfjitYt5OIsGLnISORYX+P3B5I4VUpgq6VREHdybXaMJOA3 XR3CFcEUQg5BwKbcMe44wpi0RitqSimrHLtaT2x3wzkJjhmY+AdjRBdNW8Ex2wH/lX8q YHq2cbZa7p6mTELmZ+QFAiJB954GBAwZCzdYPALynBd+YRrtzjpj3+S9VtkwpWCIPhoO DCrjzy2IkfuGhCgRtCI4qfBUODuhhZR1Yy2SqJ+RGeEWcPxzbRaDBlElySbKJgGg5vdG 3TIbbY2AnZeLf7yQidvqGKg1FUBETcZPdLhMm70XOKPw2JPXarsY9yfN0mtcWXw33ip9 l+5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si6619952plo.350.2018.08.24.08.27.23; Fri, 24 Aug 2018 08:27:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727462AbeHXS76 (ORCPT + 99 others); Fri, 24 Aug 2018 14:59:58 -0400 Received: from foss.arm.com ([217.140.101.70]:60580 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbeHXS76 (ORCPT ); Fri, 24 Aug 2018 14:59:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E2A4CED1; Fri, 24 Aug 2018 08:24:51 -0700 (PDT) Received: from [10.4.12.131] (e110467-lin.emea.arm.com [10.4.12.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 271783F5BC; Fri, 24 Aug 2018 08:24:51 -0700 (PDT) Subject: Re: [PATCH] Changing the AMD IOMMU API path to work in an atomic context which is necessary for any custom drivers using the IOMMU API while holding a spinlock. To: Christoph Hellwig , murphyt7@tcd.ie Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <1535120929-5693-1-git-send-email-murphyt7@tcd.ie> <20180824145328.GA7996@infradead.org> From: Robin Murphy Message-ID: <24d3f04a-e6e2-ed8f-e2bd-b38144f33f26@arm.com> Date: Fri, 24 Aug 2018 16:24:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180824145328.GA7996@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/08/18 15:53, Christoph Hellwig wrote: > On Fri, Aug 24, 2018 at 02:28:49PM +0000, murphyt7@tcd.ie wrote: >> From: Tom Murphy >> >> --- >> >> This patch allows the IOMMU API path in the AMD driver to be called from an atomic context. >> This is useful for anyone building a driver which needs to call the IOMMU API while holding a spinlock. > > I don't think that is a good idea. Please point to the code in the > driver and we can't probably find a better solution. Although IIRC the AMD driver is in fact the only one whose map/unmap callbacks aren't already spinlock-safe (or at least it was last time I was looking). Stuff like iommu-dma is already relying on this in order to implement streaming DMA API calls (which may be in atomic context) on top of the corresponding IOMMU API operations. Robin.