From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 615CAC04AB5 for ; Mon, 3 Jun 2019 14:48:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3613027879 for ; Mon, 3 Jun 2019 14:48:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="Q6D29Wee"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="YYG9f7cy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729144AbfFCOs4 (ORCPT ); Mon, 3 Jun 2019 10:48:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38862 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728988AbfFCOs4 (ORCPT ); Mon, 3 Jun 2019 10:48:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 862FD60F3E; Mon, 3 Jun 2019 14:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559573335; bh=wmoyPPaA8jIHMpOlZBcNsMxuLi2MxGFaoo8cyvL/4vc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q6D29WeeBtajNgR3/diaSCi5G1OQpJ1ET9nzjd9biggspT1oqLnYYXtxlc+1w1dN4 E6RCMkzMF7PJsGZYaKgx2m3XTXUH0KFRN7NBaH5D/cJZkqSjrKYGYNe0fK3ZRu+wS1 HkbS56XHSHp43YaHJTqLnEkFUgrg9NsaxAT0RVX0= Received: from jcrouse1-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0C98C6074F; Mon, 3 Jun 2019 14:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559573334; bh=wmoyPPaA8jIHMpOlZBcNsMxuLi2MxGFaoo8cyvL/4vc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YYG9f7cy6p6luyC1AgZvLfOFGLyxCO29eirTTmZjQY4Nx4kCr3Ure3l14036D3gg7 JIphsgGXr/l6WnM/RsZEXmr93gIzSj0IA1H4IejYQYEryr3N5T4uD3PFPav4fFRAAV g8lrWkVOl5dtfEIbXdC8hf95q1ikEIc9qAZuDbO4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0C98C6074F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org Date: Mon, 3 Jun 2019 08:48:51 -0600 From: Jordan Crouse To: Thierry Reding Cc: Rob Clark , devicetree@vger.kernel.org, David Airlie , Frank Rowand , Will Deacon , Doug Anderson , dri-devel , Linux IOMMU , Rob Herring , Sean Paul , linux-arm-msm , freedreno , Robin Murphy , Christoph Hellwig , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] of/device: add blacklist for iommu dma_ops Message-ID: <20190603144851.GD23227@jcrouse1-lnx.qualcomm.com> Mail-Followup-To: Thierry Reding , Rob Clark , devicetree@vger.kernel.org, David Airlie , Frank Rowand , Will Deacon , Doug Anderson , dri-devel , Linux IOMMU , Rob Herring , Sean Paul , linux-arm-msm , freedreno , Robin Murphy , Christoph Hellwig , "linux-kernel@vger.kernel.org" References: <401f9948-14bd-27a2-34c1-fb429cae966d@arm.com> <20190603135408.GE30132@ulmo> <20190603144016.GG30132@ulmo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190603144016.GG30132@ulmo> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org > It shouldn't be a problem to hook something else up to the IOMMU > subsystem. Hopefully it's something that people are going to standardize > on. > > > 3) The automatic attach of DMA domain is also causing a different > > problem for us on the GPU side, preventing us from supporting per- > > context pagetables (since we end up with a disagreement about > > which context bank is used between arm-smmu and the firmware). > > I'm not sure I understand this issue. Is the context bank hard-coded in > the firmware somehow? Or is it possible to rewrite which one is going to > be used at runtime? Do you switch out the actual page tables rather than > the IOMMU domains for context switching? We have a rather long history on this but the tl;dr is that the GPU microcode switches the pagetables by rewriting TTBR0 on the fly (since this is arm-smmu-v2 we have no better option) and yes, unfortunately it is hard coded to use context bank 0. [1] is the current patchset to support all this, including my own take on avoiding the dma-domain (all the cool kids have one). Jordan [1] https://patchwork.freedesktop.org/series/57441/ -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project