Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp666151ybl; Thu, 22 Aug 2019 03:02:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaZMCpk9AEPU+iYZpNUYZD0qZ80E2kFas+kmfa+InuFYFyrGAEy54vvnbIQSg1X1q+7gqw X-Received: by 2002:a63:4e05:: with SMTP id c5mr12750469pgb.396.1566468146606; Thu, 22 Aug 2019 03:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566468146; cv=none; d=google.com; s=arc-20160816; b=VlMWpMo890VwRaSeBw/eqIxEKHbMS+koFjLn902hqA77vTsvwjp5BUB3Dlp9urjkww t4pU5UEt5E2im05nghOhEvinobW9AgVyzR+nuyCzfa451mRPTaokf9X0aYPfGh9sbTba iF5VizXCSWyPVVx2fhjra7HtvsEMh03BnBSJrEGdVjzN8e3fPlYYs469Qjs/7ViXBbST 2jyvul3SaIYmQDmNbJzuD25Ts6NwC2OzFLVl+1bPB05g+DTT+Cd9ys3bpbP4ysN2XLf+ zGWmh60FrpKf/pOXyG4oPTDiGiRUfasvBZoT1LQDBue45LkthwpEdzdJKBIRUDX65DB8 oghA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=8VJ8WuoPS0+MqxmdktaPgfa93a+iYfW/WQ2yGSKTK4c=; b=XbxsNdM3PSJdlR4RdDcoGG4X5HG0fb3hO8vsOKtJ9+83ly2cNl7ZnRdaUlu0lMIkaS TNR8NWdNtTe3V7b4uJRZ4H5avPJxrP56jR8nQWbgMQmKKqTJD+EYCTSLgheELpDdcUEd q+nsWW1iSyjm/oZwW9F685HKdxzoib0NsrgqUXBk8n2Z26yR9YmDytRCSHrHfENgx8il l3BntOLxAEgQiDdv54DF+f5Z+bPhx2148fj6smnFSLKmcd2K96FgN66UQBVTi2aWWPcs KBTfe2IN1SBSEU31Brj94NE4JSuIgZCN/BVoavHATMzJDSN3eJL38OZj1xRaKkKJ0AId OYtA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si2063335pje.43.2019.08.22.03.02.09; Thu, 22 Aug 2019 03:02:26 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732858AbfHVI7p (ORCPT + 99 others); Thu, 22 Aug 2019 04:59:45 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:59535 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731589AbfHVI7o (ORCPT ); Thu, 22 Aug 2019 04:59:44 -0400 X-UUID: a90b8171517b4b73af861d39776b16fd-20190822 X-UUID: a90b8171517b4b73af861d39776b16fd-20190822 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1899938959; Thu, 22 Aug 2019 16:59:33 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 22 Aug 2019 16:59:32 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 22 Aug 2019 16:59:31 +0800 Message-ID: <1566464375.11621.10.camel@mhfsdcap03> Subject: Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek From: Yong Wu To: Robin Murphy CC: Will Deacon , , , Nicolas Boichat , , , , Joerg Roedel , , Evan Green , Tomasz Figa , , Rob Herring , , Matthias Brugger , , , Matthias Kaehlcke , Date: Thu, 22 Aug 2019 16:59:35 +0800 In-Reply-To: <22a79977-5074-7af1-97b8-8a3e549b23c1@arm.com> 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-SNTS-SMTP: 77FDD9D92F4B2E27F773B23946AF4889BD952E4F98E058E499F22239F28748B22000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-08-21 at 16:34 +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. Yes. The HW double the lvl1 pgtable, thus it supports 33bit iova actually. We may extend ias in the future. > > Robin. > > > > > With that change: > > > > Acked-by: Will Deacon > > > > Will > > > > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek