Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1009425ybl; Wed, 21 Aug 2019 08:46:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzt0ig98AoF40NZJ8cpUwp5RvfcHr05eSMfq3oXhhqqNyYOJyzpsL+NC0442k3BRWgDmDIf X-Received: by 2002:a17:902:e489:: with SMTP id cj9mr29159254plb.327.1566402399185; Wed, 21 Aug 2019 08:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566402399; cv=none; d=google.com; s=arc-20160816; b=ff4NppK7xBy0k3+xsQq/DDiIkkeKi9d0wNnAGnpbOvht/yNIHrB0n1kFx08pi76Y01 /4gnqDWAvTJ+LJRYlr7B2gXVMjGwmNbvvgqiKJAueZnDkQJXEWw+3jFAhz7HdGv51Lsd NZ3HOQmLdJOWon0zZQJ4S6/9UbjstBQaAkDUOrknOcThh+PTrBFyCuNGvago45me+3ZY ReSAjIEaeys2L3VGzdPi5WZhI0A13Py/1kbAKgRRNBNFl0tgWLE9KwqDQ5GeHJfPq+vY cME/Ycxhb0+JfvcqyB7dAtCniXJgee62kM3LS5lHCNsihVI0Qo503mBeBx49Ekx1eS4P 6UFQ== 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=j7lk9+jPPU7Fu7caaoj+oQaQD89jUOucGbUdQo1msik=; b=ijUBT4Jq0IBfCpYQdjb+2mnAC41QH2x7tUFmtw5kUfqmdITrKD8EuOos96605pfTVI 7VRbWoAOCFqIotJdFnPvvSXUJ7U6zxR/Z3zzs3oUzY29FSeHxAAEh9fXJwcJg+PeLkaj MJjSAV9jMEYFUQjtcHRDKA9v0gWdtH1DOMSITYZ0m8w5xEqi9J+7bCj4srOMLHsCDUyo u52GTHjZOdkuiPiYvlonOjEJpKkoeXX0DiMMiABiuC6kU72av4u42eDSkvRbSlt837ah LAAu3TBmyf5t+tySv+ziyLTSrmn365bxp9Iv0PNqPFv4wUlW67OQWeVJ8c8UmsgPogWM hRSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RiD+8qlu; 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 s15si14259914pgm.413.2019.08.21.08.46.23; Wed, 21 Aug 2019 08:46:39 -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=RiD+8qlu; 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 S1728735AbfHUPYz (ORCPT + 99 others); Wed, 21 Aug 2019 11:24:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:58382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727943AbfHUPYz (ORCPT ); Wed, 21 Aug 2019 11:24:55 -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 01291206BA; Wed, 21 Aug 2019 15:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566401095; bh=aJZsxkGaQIRowffpW+JaxO8NMT7WvvZzsQ6yeIDlrnk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RiD+8qlujqamNghbph/UTRtAZcnnXOpbJFfcJRF+s/5Mrfv1RKTDq2/TyeRJwLysN WJYvAUdnD9ZieVbBt5P/zVGwMp/DMlFpIVIjbWDQDAXI/qNLEkrtPTM8+HKzJyLsf8 Rg6tay5H6JGnc5+Qh8NBXe3tmebq2AFCmCoYet2I= Date: Wed, 21 Aug 2019 16:24:49 +0100 From: Will Deacon To: Yong Wu Cc: Joerg Roedel , Matthias Brugger , Robin Murphy , 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: <20190821152448.qmoqjh5zznfpdi6n@willie-the-truck> References: <1566395606-7975-1-git-send-email-yong.wu@mediatek.com> <1566395606-7975-10-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1566395606-7975-10-git-send-email-yong.wu@mediatek.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 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? With that change: Acked-by: Will Deacon Will