Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1139080ybl; Wed, 21 Aug 2019 10:42:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCYf4ClIWNgFGolaLg7vkPFEi7NvvYl2OKOxRRFj3bxrnUQosKUvQKfPVx1FYFTGMiA9a+ X-Received: by 2002:a17:902:302:: with SMTP id 2mr10088722pld.149.1566409342682; Wed, 21 Aug 2019 10:42:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566409342; cv=none; d=google.com; s=arc-20160816; b=S0bn54/H0Kgs5JdCm12Gt5ahv7NWoxxjt92VMk6Yyi5k8lPThHilMPmvt0acbi4OLt E1SvAtbYGbkRks1THBk6szOuT1RFkACage5B1JocJ5U+Y9Nc65ZIG5PhtaR+pyRxcTTL JLwLzjLYjVGeokcCllj1SXdMuF4XEJws4bW5Wwz19BMKMt7LkIq5Lkiezmj7mipsEBhD vEriVXcLWl1OoH7v5Sp6yWRhzbZjykpFemPhd14PNilJouFnM0AtND6V3DJNn+IN/Mqo evpNKRwkmxfubSQVdsvrqa8cIAslntxOWwU65PB1yA2jmIVgf2CcGpLgxLGs42c6kigc ZtiQ== 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; bh=43G7itdf7EiLCriIG/sqUQXFnHtduqgwTX8yaRHg3xw=; b=sWgPRoaMiAUxlQaGGBxic704h0xuJznjU9qxP6Uvm68Q8zsXztZnuPSoGcb6lTEoFq KanR9EgtidplSXe2xWv8Afd40NzCYgBQhjI6byMOvWs+HQx4eDG9MKIvyH7fpfHmKxUT zfAWMvsdO0eqEkkGHhCZHDQ259ZUqE35sPpqRwm6WsD2HM/e9HUAeYbfjlY5R3ca7+51 Wjz7le3sqEXoK0j88WfWi8HbD8FXjFZeeBBqFOT6RDSzYWj+mUNknhpNdFv2tDr2t+7v YEjiqRSxxQ1u2kchg91wHv7h8U/1n7AAivLE7aPnAjrGL49KHXS0Qd7WgP3lI+gvlPOu vGOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=THQSoGVc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l191si14659036pge.94.2019.08.21.10.42.07; Wed, 21 Aug 2019 10:42:22 -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=pass header.i=@kernel.org header.s=default header.b=THQSoGVc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729468AbfHUQgA (ORCPT + 99 others); Wed, 21 Aug 2019 12:36:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:55792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729367AbfHUQgA (ORCPT ); Wed, 21 Aug 2019 12:36:00 -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 E3D2D216F4; Wed, 21 Aug 2019 16:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566405360; bh=523UKRpEYgVnK4n6qoJT/UA2T1eyXvRGlZiSMko8S2I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=THQSoGVckn9loJO2YK6n0hW8Zr+qYViNc6L7hieM8yM6BUPTRpUCVjjlXy5iJ/abQ /8sxz9km+kjRuL5G/1sDfv+VWpOPpsABw8SxC1NN+XfRv9hH04pSbCObu9foGya4yP 3u+NJzArrkquuRd6l3iLVqK/x7qHKusaX9b/v5io= Date: Wed, 21 Aug 2019 17:35:54 +0100 From: Will Deacon To: Robin Murphy Cc: Yong Wu , Joerg Roedel , Matthias Brugger , Rob Herring , Evan Green , Tomasz Figa , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, youlin.pei@mediatek.com, Nicolas Boichat , anan.sun@mediatek.com, Matthias Kaehlcke , cui.zhang@mediatek.com, chao.hao@mediatek.com, ming-fan.chen@mediatek.com Subject: Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek Message-ID: <20190821163553.ymlk5fcgd6ntnpss@willie-the-truck> References: <1566395606-7975-1-git-send-email-yong.wu@mediatek.com> <1566395606-7975-10-git-send-email-yong.wu@mediatek.com> <20190821152448.qmoqjh5zznfpdi6n@willie-the-truck> <22a79977-5074-7af1-97b8-8a3e549b23c1@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22a79977-5074-7af1-97b8-8a3e549b23c1@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 21, 2019 at 04:34:27PM +0100, Robin Murphy wrote: > On 21/08/2019 16:24, Will Deacon wrote: > > On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: > > > MediaTek extend the arm v7s descriptor to support up to 34 bits PA where > > > the bit32 and bit33 are encoded in the bit9 and bit4 of the PTE > > > respectively. Meanwhile the iova still is 32bits. > > > > > > Regarding whether the pagetable address could be over 4GB, the mt8183 > > > support it while the previous mt8173 don't, thus keep it as is. > > > > > > Signed-off-by: Yong Wu > > > --- > > > drivers/iommu/io-pgtable-arm-v7s.c | 32 +++++++++++++++++++++++++------- > > > include/linux/io-pgtable.h | 7 +++---- > > > 2 files changed, 28 insertions(+), 11 deletions(-) > > > > [...] > > > > > @@ -731,7 +747,9 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg, > > > { > > > struct arm_v7s_io_pgtable *data; > > > - if (cfg->ias > ARM_V7S_ADDR_BITS || cfg->oas > ARM_V7S_ADDR_BITS) > > > + if (cfg->ias > ARM_V7S_ADDR_BITS || > > > + (cfg->oas > ARM_V7S_ADDR_BITS && > > > + !(cfg->quirks & IO_PGTABLE_QUIRK_ARM_MTK_EXT))) > > > > Please can you instead change arm_v7s_alloc_pgtable() so that it allows an > > ias of up to 34 when the IO_PGTABLE_QUIRK_ARM_MTK_EXT is set? > > You mean oas, right? I believe the hardware *does* actually support a 32-bit > ias as well, but we shouldn't pretend to support that while > __arm_v7s_alloc_table() still only knows how to allocate normal-sized > tables. Sorry, yes, oas. Will