Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3795021pxu; Wed, 9 Dec 2020 00:11:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPprog010ubTBNwv7tmQQWava9MmL96eQyo9ZmbiVvlS76474BrKMjW6Cimo9gddRAcFhe X-Received: by 2002:a17:906:e15:: with SMTP id l21mr1054881eji.509.1607501504263; Wed, 09 Dec 2020 00:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607501504; cv=none; d=google.com; s=arc-20160816; b=EgCImSpRoYXdBwjLZtZxJ9ZoydO2FZcMeN15RfsO89qMIGYntpzj9x/0eSH0I4htaE TbCT49AMwqYLjtaJNMVifys5tzQNK4GzSyL9YQBOootyzSs4LPdSIVPGxirNJRlfk33L 7iIBoENvXAHFsuxXolD177L/sm1QEdCdRcrG85ZRPBSmmTqRe3Lvts/8x8X++Ccnn372 zEqfdONIuxP7ivwT9XGt3y1oVwbOf/PSLJo2Pp76vc9Ej8ZlpEe894k+oL3oVrd3Ch0X G9P0WbZCpBQZZNaR4f7KJtl0LBR2aIpo6tX1H6uxtwG7mvfcsvjBU48fspfKcn556dFJ tp7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=KH9Yix3qELNNCKJ2geQM4Eb/El1hhDB2pPo1TNzeo34=; b=YZC6sfQUV8psq9Tw41OleZCtyl3pEMM5kDAy/mZL4BbL8UsTBsvEhCEZwq3RRvNqsZ enRjVEJF2Urr9+NrenG1YtXWZpmq5MqnaV5cihA3NINB9jiukYBeC+JjnqayVNCKNpVr yGxOrO1nHokufiXtEXbg5qK8zA6cFQrxFKxtr8fe130HfMtlAvpGPkeLS1wKVDHeQAJ7 xr6dO5dRaPgbcq1YYzVjGbn01d6xS0ZT0NSmGaNifbZUb4ZQEM2h/V56u6I9Rf/2DwlQ qE6/Pm5H0PlLZL+N4CkmxycUqp7vA25lsNC8j3GnnkTXs+klEL706XpxzmCueazjNyLz N12g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id f19si386320eja.89.2020.12.09.00.11.22; Wed, 09 Dec 2020 00:11:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727979AbgLIIIT (ORCPT + 99 others); Wed, 9 Dec 2020 03:08:19 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:46210 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728573AbgLIIDe (ORCPT ); Wed, 9 Dec 2020 03:03:34 -0500 X-UUID: ef9121a911db492c84e5b088f30a0248-20201209 X-UUID: ef9121a911db492c84e5b088f30a0248-20201209 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 434510376; Wed, 09 Dec 2020 16:02:51 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 9 Dec 2020 16:02:42 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 9 Dec 2020 16:02:41 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , Subject: [PATCH v5 08/27] iommu/io-pgtable-arm-v7s: Use ias to check the valid iova in unmap Date: Wed, 9 Dec 2020 16:00:43 +0800 Message-ID: <20201209080102.26626-9-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201209080102.26626-1-yong.wu@mediatek.com> References: <20201209080102.26626-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the ias for the valid iova checking in arm_v7s_unmap. This is a preparing patch for supporting iova 34bit for MediaTek. Signed-off-by: Yong Wu Reviewed-by: Robin Murphy --- drivers/iommu/io-pgtable-arm-v7s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index a688f22cbe3b..e880745ab1e8 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -717,7 +717,7 @@ static size_t arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned long iova, { struct arm_v7s_io_pgtable *data = io_pgtable_ops_to_data(ops); - if (WARN_ON(upper_32_bits(iova))) + if (WARN_ON(iova >= (1ULL << data->iop.cfg.ias))) return 0; return __arm_v7s_unmap(data, gather, iova, size, 1, data->pgd); -- 2.18.0