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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 66E20C4363C for ; Mon, 21 Sep 2020 21:08:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24E7023119 for ; Mon, 21 Sep 2020 21:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600722502; bh=qXfvVdC3ovH7v/K0ck6SbGCxk1JarB8felKvT1Qvaq4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=MbcSrvpZQfKU6quORhEz+awRYFWnca1auKGtIXvnYAvvOMhOVd5mBER3mp/BSqsAJ 2I5WgQ8oSBYknXoOwi91WViNcsj0oVqCGpatANByGthnG4ica/3aGcGKwmsTqFU+rJ vT6I0AIdXyEbkfgVJZYEBtvopGQeNaI9+3EkjP4Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726455AbgIUVIV (ORCPT ); Mon, 21 Sep 2020 17:08:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:42388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726441AbgIUVIV (ORCPT ); Mon, 21 Sep 2020 17:08:21 -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 ECEDB20874; Mon, 21 Sep 2020 21:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600722500; bh=qXfvVdC3ovH7v/K0ck6SbGCxk1JarB8felKvT1Qvaq4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vtoe5ZIhPzxEaBW5SgIlqLCJtITDRRgJYx5ZnF1jq4Ies+7GtzOCtNpBnNRls2+EH SBiRA/tE8lYdH7wTjgI2Z1mvrX6OboXWDUFOSda3xExr2QReDNASNLaNO64jGeekhq x3/FRaD4gPWrBiHuQMHx8U0dJIarNFr5n04h9MG8= Date: Mon, 21 Sep 2020 22:08:15 +0100 From: Will Deacon To: Bjorn Andersson Cc: Robin Murphy , Joerg Roedel , Sai Prakash Ranjan , Jordan Crouse , Rob Clark , Sibi Sankar , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v3 6/8] iommu/arm-smmu: Add impl hook for inherit boot mappings Message-ID: <20200921210814.GE3811@willie-the-truck> References: <20200904155513.282067-1-bjorn.andersson@linaro.org> <20200904155513.282067-7-bjorn.andersson@linaro.org> <0bfcc8f7-d054-616b-834b-319461b1ecb9@arm.com> <20200913032559.GT3715@yoga> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200913032559.GT3715@yoga> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Sat, Sep 12, 2020 at 10:25:59PM -0500, Bjorn Andersson wrote: > On Fri 11 Sep 12:13 CDT 2020, Robin Murphy wrote: > > On 2020-09-04 16:55, Bjorn Andersson wrote: > > > Add a new operation to allow platform implementations to inherit any > > > stream mappings from the boot loader. > > > > Is there a reason we need an explicit step for this? The aim of the > > cfg_probe hook is that the SMMU software state should all be set up by then, > > and you can mess about with it however you like before arm_smmu_reset() > > actually commits anything to hardware. I would have thought you could > > permanently steal a context bank, configure it as your bypass hole, read out > > the previous SME configuration and tweak smmu->smrs and smmu->s2crs > > appropriately all together "invisibly" at that point. > > I did this because as of 6a79a5a3842b ("iommu/arm-smmu: Call > configuration impl hook before consuming features") we no longer have > setup pgsize_bitmap as we hit cfg_probe, which means that I need to > replicate this logic to set up the iommu_domain. > > If I avoid setting up an iommu_domain for the identity context, as you > request in patch 8, this shouldn't be needed anymore. > > > If that can't work, I'm very curious as to what I've overlooked. > > > > I believe that will work, I will rework the patches and try it out. Did you get a chance to rework this? 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=-5.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=no 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 EF0E1C4363C for ; Mon, 21 Sep 2020 21:08:26 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 7C0B923119 for ; Mon, 21 Sep 2020 21:08:26 +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="vtoe5ZIh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C0B923119 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 whitealder.osuosl.org (Postfix) with ESMTP id 380A485B36; Mon, 21 Sep 2020 21:08:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EV3a+dd-lOU5; Mon, 21 Sep 2020 21:08:25 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 52A6B84D22; Mon, 21 Sep 2020 21:08:25 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 35907C0889; Mon, 21 Sep 2020 21:08:25 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 807BAC0051 for ; Mon, 21 Sep 2020 21:08:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2B33520780 for ; Mon, 21 Sep 2020 21:08:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ObZNCwMNkfVY for ; Mon, 21 Sep 2020 21:08:21 +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 silver.osuosl.org (Postfix) with ESMTPS id 44B0120778 for ; Mon, 21 Sep 2020 21:08:21 +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 ECEDB20874; Mon, 21 Sep 2020 21:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600722500; bh=qXfvVdC3ovH7v/K0ck6SbGCxk1JarB8felKvT1Qvaq4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vtoe5ZIhPzxEaBW5SgIlqLCJtITDRRgJYx5ZnF1jq4Ies+7GtzOCtNpBnNRls2+EH SBiRA/tE8lYdH7wTjgI2Z1mvrX6OboXWDUFOSda3xExr2QReDNASNLaNO64jGeekhq x3/FRaD4gPWrBiHuQMHx8U0dJIarNFr5n04h9MG8= Date: Mon, 21 Sep 2020 22:08:15 +0100 From: Will Deacon To: Bjorn Andersson Subject: Re: [PATCH v3 6/8] iommu/arm-smmu: Add impl hook for inherit boot mappings Message-ID: <20200921210814.GE3811@willie-the-truck> References: <20200904155513.282067-1-bjorn.andersson@linaro.org> <20200904155513.282067-7-bjorn.andersson@linaro.org> <0bfcc8f7-d054-616b-834b-319461b1ecb9@arm.com> <20200913032559.GT3715@yoga> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200913032559.GT3715@yoga> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Rob Clark , linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Sibi Sankar , Robin Murphy , linux-arm-kernel@lists.infradead.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 Sat, Sep 12, 2020 at 10:25:59PM -0500, Bjorn Andersson wrote: > On Fri 11 Sep 12:13 CDT 2020, Robin Murphy wrote: > > On 2020-09-04 16:55, Bjorn Andersson wrote: > > > Add a new operation to allow platform implementations to inherit any > > > stream mappings from the boot loader. > > > > Is there a reason we need an explicit step for this? The aim of the > > cfg_probe hook is that the SMMU software state should all be set up by then, > > and you can mess about with it however you like before arm_smmu_reset() > > actually commits anything to hardware. I would have thought you could > > permanently steal a context bank, configure it as your bypass hole, read out > > the previous SME configuration and tweak smmu->smrs and smmu->s2crs > > appropriately all together "invisibly" at that point. > > I did this because as of 6a79a5a3842b ("iommu/arm-smmu: Call > configuration impl hook before consuming features") we no longer have > setup pgsize_bitmap as we hit cfg_probe, which means that I need to > replicate this logic to set up the iommu_domain. > > If I avoid setting up an iommu_domain for the identity context, as you > request in patch 8, this shouldn't be needed anymore. > > > If that can't work, I'm very curious as to what I've overlooked. > > > > I believe that will work, I will rework the patches and try it out. Did you get a chance to rework this? Will _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 58124C4363C for ; Mon, 21 Sep 2020 21:13:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 DEA9323A5C for ; Mon, 21 Sep 2020 21:13:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DnQvaOED"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="vtoe5ZIh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEA9323A5C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=l4RgexE9/wB62LLtT6P72iD3ttTJZSJRneRRzeuNw/E=; b=DnQvaOEDcz6kSYVYP7BKc/dZ2 lypAjXcrLNCcVO81Qh6n9391995PmGij7Jnu1QFKoC8G/qIUNg44DkVdCZpCdXsxGgNpfYpBxu1jo 4hhoU7fh8ahB2Wjwg1S6WRMpuSlRhLNFBwYvB9alnGHytFjfSLR9lr90w55vw7FwWX2NgG5l2q+Y1 8qq/rh58hNjIFWJEJj+bMsW6o4gxGAaaK9Y5qTw/7Xx0pCPe8v31Uk5peOLouqHf1g890bt2Kdkfb /9gyxJ02Bd4yny+6Cxrr4RTQcDBQFdszEUPoaCR/h1vYHgFAuYhwvMphbytn7k54vjDPRbj5bLL9F 1XFjNNZ5g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKT5s-0007e6-G0; Mon, 21 Sep 2020 21:11:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKT2s-0006CF-5v for linux-arm-kernel@lists.infradead.org; Mon, 21 Sep 2020 21:08:30 +0000 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 ECEDB20874; Mon, 21 Sep 2020 21:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600722500; bh=qXfvVdC3ovH7v/K0ck6SbGCxk1JarB8felKvT1Qvaq4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vtoe5ZIhPzxEaBW5SgIlqLCJtITDRRgJYx5ZnF1jq4Ies+7GtzOCtNpBnNRls2+EH SBiRA/tE8lYdH7wTjgI2Z1mvrX6OboXWDUFOSda3xExr2QReDNASNLaNO64jGeekhq x3/FRaD4gPWrBiHuQMHx8U0dJIarNFr5n04h9MG8= Date: Mon, 21 Sep 2020 22:08:15 +0100 From: Will Deacon To: Bjorn Andersson Subject: Re: [PATCH v3 6/8] iommu/arm-smmu: Add impl hook for inherit boot mappings Message-ID: <20200921210814.GE3811@willie-the-truck> References: <20200904155513.282067-1-bjorn.andersson@linaro.org> <20200904155513.282067-7-bjorn.andersson@linaro.org> <0bfcc8f7-d054-616b-834b-319461b1ecb9@arm.com> <20200913032559.GT3715@yoga> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200913032559.GT3715@yoga> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200921_170822_347763_837460A0 X-CRM114-Status: GOOD ( 25.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Sai Prakash Ranjan , linux-arm-msm@vger.kernel.org, Joerg Roedel , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jordan Crouse , Sibi Sankar , Robin Murphy , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Sep 12, 2020 at 10:25:59PM -0500, Bjorn Andersson wrote: > On Fri 11 Sep 12:13 CDT 2020, Robin Murphy wrote: > > On 2020-09-04 16:55, Bjorn Andersson wrote: > > > Add a new operation to allow platform implementations to inherit any > > > stream mappings from the boot loader. > > > > Is there a reason we need an explicit step for this? The aim of the > > cfg_probe hook is that the SMMU software state should all be set up by then, > > and you can mess about with it however you like before arm_smmu_reset() > > actually commits anything to hardware. I would have thought you could > > permanently steal a context bank, configure it as your bypass hole, read out > > the previous SME configuration and tweak smmu->smrs and smmu->s2crs > > appropriately all together "invisibly" at that point. > > I did this because as of 6a79a5a3842b ("iommu/arm-smmu: Call > configuration impl hook before consuming features") we no longer have > setup pgsize_bitmap as we hit cfg_probe, which means that I need to > replicate this logic to set up the iommu_domain. > > If I avoid setting up an iommu_domain for the identity context, as you > request in patch 8, this shouldn't be needed anymore. > > > If that can't work, I'm very curious as to what I've overlooked. > > > > I believe that will work, I will rework the patches and try it out. Did you get a chance to rework this? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel