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.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 F3A88C432C0 for ; Wed, 20 Nov 2019 19:18:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CA45A20855 for ; Wed, 20 Nov 2019 19:18:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Fkl1V7Ta"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="WGnWjh8E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA45A20855 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+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type: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:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7yY7XvD2cfJBj/3HsqtvlHK/JPMG5M5lyMcqWOdKRk4=; b=Fkl1V7Ta/lxumY DF0ZtcNMpHuLb1jLU7XQHWqzKAC26NhuspoVXzLJ/rDKau6S5A/x5o1JzXTadna8Ecg27bM9AA6Mb ZZjSDTXAbcFcjFmpJLIb0j5bVoPrGhePYsQOcnzIaY1nEEdNNPd8hbKPWBmAQFvZ/0Nz2q3CGjxoz INMrcUoS3vC9YxKmiMlWOccKOurrXHis9M2RDGytiivFdks8H4iOoUuFPYkHt8DQzRolKp2t4tw2w n8Di6Gygn6ZGi/6XdoVT1JxCMW62wS3l+WznJ0dL/HljtZ8S8pCCgwAm4yLx+mB5aOowXqNIKeBYG h6f7QJg5nsSloumG/+hw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXVUq-0006bI-5k; Wed, 20 Nov 2019 19:18:36 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXVUm-0006Yg-0U for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 19:18:33 +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 E652020855; Wed, 20 Nov 2019 19:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574277511; bh=Ssfx4CJHpMammtH5BPVwDenu7QC6d8HZXPkTNCSMfXw=; h=Date:From:To:Subject:References:In-Reply-To:From; b=WGnWjh8EO6X5mm63XsuyeBLs3ywKIWBqzkVVBChkiRDF/xkFaHFQzJhPbBNn//p5k YAgJswMFkv1+svrvAvfiRBYc0kJry7vep3GkykWRQYCIuhjS1brvMADy2gUZyD4wGa 1tQtyRbhGKTQNzMA7XM1++IBWa2JkaBtXztIu3CA= Date: Wed, 20 Nov 2019 19:18:27 +0000 From: Will Deacon To: Robin Murphy , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 10/10] iommu/io-pgtable-arm: Prepare for TTBR1 usage Message-ID: <20191120191827.GE4799@willie-the-truck> References: <9ec05935de3f1c1da5d1780201147ed40e129295.1572024120.git.robin.murphy@arm.com> <20191104234006.GC16446@jcrouse1-lnx.qualcomm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191104234006.GC16446@jcrouse1-lnx.qualcomm.com> 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-20191120_111832_079713_B7D1F4CA X-CRM114-Status: GOOD ( 18.00 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 04, 2019 at 04:40:06PM -0700, Jordan Crouse wrote: > On Fri, Oct 25, 2019 at 07:08:39PM +0100, Robin Murphy wrote: > > Now that we can correctly extract top-level indices without relying on > > the remaining upper bits being zero, the only remaining impediments to > > using a given table for TTBR1 are the address validation on map/unmap > > and the awkward TCR translation granule format. Add a quirk so that we > > can do the right thing at those points. > > This looks great. I have one comment about the TCR.A1 bit below but otherwise > this is sane. My immediate todo this week and next is to try to get something > spun up and working on the db845 for verification. How did that go? > > @@ -800,15 +812,16 @@ arm_64_lpae_alloc_pgtable_s1(struct io_pgtable_cfg *cfg, void *cookie) > > tcr->orgn = ARM_LPAE_TCR_RGN_NC; > > } > > > > + tg1 = cfg->quirks & IO_PGTABLE_QUIRK_ARM_TTBR1; > > switch (ARM_LPAE_GRANULE(data)) { > > case SZ_4K: > > - tcr->tg = ARM_LPAE_TCR_TG0_4K; > > + tcr->tg = tg1 ? ARM_LPAE_TCR_TG1_4K : ARM_LPAE_TCR_TG0_4K; > > break; > > case SZ_16K: > > - tcr->tg = ARM_LPAE_TCR_TG0_16K; > > + tcr->tg = tg1 ? ARM_LPAE_TCR_TG1_16K : ARM_LPAE_TCR_TG0_16K; > > break; > > case SZ_64K: > > - tcr->tg = ARM_LPAE_TCR_TG0_64K; > > + tcr->tg = tg1 ? ARM_LPAE_TCR_TG1_64K : ARM_LPAE_TCR_TG0_64K; > > break; > > } > > The comment in one of the previous patches about the ASID in TTBR1 triggered > something in my brain. v2 TCR A1,bit[22] controls from which TTBR the ASID is > used I'm not sure if that qualifies as a quirk here or if it should be entirely > handled within arm_smmu_lpae_tcr() but I thought I should point it out. That should be confined entirely to the driver code though, no? The io-pgtable code doesn't go near ASIDs or the A1 bit. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel