Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5588974imm; Mon, 27 Aug 2018 00:09:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ4K9WzhdzKRcAP/JHlyUmtgR8Fnz63ObwGJg9ljeFchiA//QwGJfjnquSQgJ4HEKh6bbV+ X-Received: by 2002:a17:902:4403:: with SMTP id k3-v6mr11762082pld.243.1535353741239; Mon, 27 Aug 2018 00:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535353741; cv=none; d=google.com; s=arc-20160816; b=gMQp5Wj8bNynlZEAtafELmKM6c/aMtCBqRelknmi0ED9VIFb6H/1d+bMim2H0VX39h XqkG83vdcg87ltq7CpJOCVZlSExYZ7h8ZqbOApVf6b5c0xW++Z14GPG7ILuDnx4veHAX Yraheg8qNaR6kcGwNxnnYWjb58Hlc4nzOAsNW53+e86Gav+7o7uNSRke//ZJrBpJEaFb NURXfOXRHsqK9aAnEvtG71sYiab4faKEhXoC5PiAtnCgJf7lqM/nOyU5+a9vmazxEIZL Ub44Rf/TtLooEkF0tqXV5cO4WefHMEJZ3tXJ6GMbjhG1DK4dz6dOZIzvd3o5nT3ZXBTn UP9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=1panxVtOmSsADN3TGm/0dltLyUD+Zvze1riz4cHooIc=; b=jMoQQ+o25ZJKfOlYT6OvqT7BUb4gHyb0CJZbkpJm4vAhvf3pqaJxk9s9HZnEYzcQJJ KQgqvp2nOd3sI5gwZh9aThubFUYAo6+j5nQyAZccsBEtiMw4PdVwZd/kDxw64X4pbGA+ 00PwmrCaRiTh7NKrNPCQAU8nb3tqG95aDPzEgjROqm45A3XVkk7gu71s9QMy5E7ALF+s ae6dRpxiTIzsxR3A5FK86fNEHewBDVO5hC98gQIhmnBbKKTWZaenfbPj0wgE1KSXUwfz opqTnk6isQHbOGf11K0SgH41TvP2QJKS70ObYVhIvEnSrgoVpt5241X6WxUmZXaIOhZe JGCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XX07MH7f; 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 w7-v6si13447473plq.198.2018.08.27.00.08.45; Mon, 27 Aug 2018 00:09:01 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XX07MH7f; 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 S1727135AbeH0Kw4 (ORCPT + 99 others); Mon, 27 Aug 2018 06:52:56 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51200 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726978AbeH0Kw4 (ORCPT ); Mon, 27 Aug 2018 06:52:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1panxVtOmSsADN3TGm/0dltLyUD+Zvze1riz4cHooIc=; b=XX07MH7f5iOUsYjhQsrXHXpNv oelr+wgqF56EOMMOGycjPxGNOru7ZG8DlPDoZi0wCrqGuaPx2dzOOqfenZ5Z+olHyvt7L6sLPBsbW JQny3Sgi4SQQefnpq10t28wvSoMW9gtf8+HMqY8r4cZrfsTLploKwhl/6NhuQ9Ruvm+Efc4PJ+FO2 KFdjrtUJCuST3heJ5aLKJfSI6MoCsnzKfZo/NgE9EUOce5c1deWT7U8mmuwC95+CyiEDd5oCDb6QZ 36MGPOerNrt4TmL4dBPyQiXdHnoN2wMsYmNwgD2aBjfkvEomCuDvsvvFDpzLEWY1PlnF8UIO/ZFo7 iCigk0alw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuBca-0002cp-7N; Mon, 27 Aug 2018 07:07:32 +0000 Date: Mon, 27 Aug 2018 00:07:31 -0700 From: Christoph Hellwig To: Tom Murphy Cc: Robin Murphy , Christoph Hellwig , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org 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. Message-ID: <20180827070731.GA8588@infradead.org> References: <1535120929-5693-1-git-send-email-murphyt7@tcd.ie> <20180824145328.GA7996@infradead.org> <24d3f04a-e6e2-ed8f-e2bd-b38144f33f26@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 24, 2018 at 11:55:53PM +0100, Tom Murphy wrote: > We were going to do this by using the iommu-dma api and replacing all the > existing calls to the DMA api functions in the amd driver with their > iommu-dma equivalent like in this driver: > https://elixir.bootlin.com/linux/latest/source/arch/arm64/mm/dma-mapping.c#L810 FYI, I have a a wip branch to move the arm64 wrappers for both swiotlb and dma-iommu here: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-maybe-coherent Maybe you could try to base on top of that. > To do this we need the map/unmap callbacks to be spinlock-safe. You probably want to send the patch together with the one(s) making use of it.