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=-11.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 BD26AC433E1 for ; Thu, 13 Aug 2020 13:14:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92E0320829 for ; Thu, 13 Aug 2020 13:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597324459; bh=HCr4ngCWjVKb+xxBnt5CGWnhlxXwqewqquSGs6gY/tQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=oaKSLRMFG9GK9A+LdNhwTH2SS8XJ5lmDoSeMyYAxQLZg7O5II/Mg72lWZqj9a8av/ DbEMUjw6xdhd3pmx/H04AmfNLJ76SwttaI1tnKVRMUaSEa+OOCbK+mSZOMVg9wrA+y Rm0s0O4adS/wnGl5CgVJsk/kKw39EfnytmfPGAfo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726777AbgHMNOS (ORCPT ); Thu, 13 Aug 2020 09:14:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:35218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726768AbgHMNOR (ORCPT ); Thu, 13 Aug 2020 09:14:17 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DC2C2207DA; Thu, 13 Aug 2020 13:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597324457; bh=HCr4ngCWjVKb+xxBnt5CGWnhlxXwqewqquSGs6gY/tQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g2OzoqK45R4qfqF8Or+HHI5oAJY2/0O4pieaNJoQbathqNBIzeNkh1vtAjW4OK5/w gynmT/frIe0nHJN/Vqsht7fKwsdZZLszjSo+BMWCaVjLbOmDO1myd2i2r/L+IkhBYx 1HI6Mj4LGSBFsM7RcW5SewzVPhXmfbxDe+qTqOm4= Date: Thu, 13 Aug 2020 14:14:12 +0100 From: Will Deacon To: Jordan Crouse Cc: linux-arm-msm@vger.kernel.org, Robin Murphy , Bjorn Andersson , iommu@lists.linux-foundation.org, freedreno@lists.freedesktop.org, Sai Prakash Ranjan , Joerg Roedel , linux-kernel@vger.kernel.org Subject: Re: [PATCH v12 04/13] iommu: Add a domain attribute to get/set a pagetable configuration Message-ID: <20200813131412.GB10256@willie-the-truck> References: <20200810222657.1841322-1-jcrouse@codeaurora.org> <20200810222657.1841322-5-jcrouse@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200810222657.1841322-5-jcrouse@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Mon, Aug 10, 2020 at 04:26:48PM -0600, Jordan Crouse wrote: > Add domain attribute DOMAIN_ATTR_PGTABLE_CFG. This will be used by > arm-smmu to share the current pagetable configuration with the > leaf driver and to allow the leaf driver to set up a new pagetable > configuration under certain circumstances. > > Signed-off-by: Jordan Crouse > --- > > include/linux/iommu.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index fee209efb756..995ab8c47ef2 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -118,6 +118,7 @@ enum iommu_attr { > DOMAIN_ATTR_FSL_PAMUV1, > DOMAIN_ATTR_NESTING, /* two stages of translation */ > DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE, > + DOMAIN_ATTR_PGTABLE_CFG, > DOMAIN_ATTR_MAX, > }; Nobody other than the adreno gpu uses this, so can we avoid exposing it in the IOMMU API, please? Given that you have a reference to the adreno GPU device in the SMMU implementation code thanks to .alloc_context_bank(), can you squirrel some function pointers away in the driver data (i.e. with dev_set_drvdata()) instead? Will 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=-11.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 97932C433E3 for ; Thu, 13 Aug 2020 13:14:20 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6147D20866 for ; Thu, 13 Aug 2020 13:14:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="g2OzoqK4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6147D20866 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3FAAB86CFC; Thu, 13 Aug 2020 13:14:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QoA2Jt36m-D5; Thu, 13 Aug 2020 13:14:19 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id B678386CF3; Thu, 13 Aug 2020 13:14:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A9751C07FF; Thu, 13 Aug 2020 13:14:19 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id F1265C004D for ; Thu, 13 Aug 2020 13:14:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id ECB8688642 for ; Thu, 13 Aug 2020 13:14:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HJTanNPZEuXS for ; Thu, 13 Aug 2020 13:14:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by hemlock.osuosl.org (Postfix) with ESMTPS id 89A6C8863E for ; Thu, 13 Aug 2020 13:14:17 +0000 (UTC) Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DC2C2207DA; Thu, 13 Aug 2020 13:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597324457; bh=HCr4ngCWjVKb+xxBnt5CGWnhlxXwqewqquSGs6gY/tQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g2OzoqK45R4qfqF8Or+HHI5oAJY2/0O4pieaNJoQbathqNBIzeNkh1vtAjW4OK5/w gynmT/frIe0nHJN/Vqsht7fKwsdZZLszjSo+BMWCaVjLbOmDO1myd2i2r/L+IkhBYx 1HI6Mj4LGSBFsM7RcW5SewzVPhXmfbxDe+qTqOm4= Date: Thu, 13 Aug 2020 14:14:12 +0100 From: Will Deacon To: Jordan Crouse Subject: Re: [PATCH v12 04/13] iommu: Add a domain attribute to get/set a pagetable configuration Message-ID: <20200813131412.GB10256@willie-the-truck> References: <20200810222657.1841322-1-jcrouse@codeaurora.org> <20200810222657.1841322-5-jcrouse@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200810222657.1841322-5-jcrouse@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: linux-arm-msm@vger.kernel.org, Robin Murphy , iommu@lists.linux-foundation.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Mon, Aug 10, 2020 at 04:26:48PM -0600, Jordan Crouse wrote: > Add domain attribute DOMAIN_ATTR_PGTABLE_CFG. This will be used by > arm-smmu to share the current pagetable configuration with the > leaf driver and to allow the leaf driver to set up a new pagetable > configuration under certain circumstances. > > Signed-off-by: Jordan Crouse > --- > > include/linux/iommu.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index fee209efb756..995ab8c47ef2 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -118,6 +118,7 @@ enum iommu_attr { > DOMAIN_ATTR_FSL_PAMUV1, > DOMAIN_ATTR_NESTING, /* two stages of translation */ > DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE, > + DOMAIN_ATTR_PGTABLE_CFG, > DOMAIN_ATTR_MAX, > }; Nobody other than the adreno gpu uses this, so can we avoid exposing it in the IOMMU API, please? Given that you have a reference to the adreno GPU device in the SMMU implementation code thanks to .alloc_context_bank(), can you squirrel some function pointers away in the driver data (i.e. with dev_set_drvdata()) instead? Will _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu