Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp320606pxb; Wed, 11 Nov 2020 04:42:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyIqDJK0DqBqbofnFjBKN87mhvsAN+iDWi+8IL04FCzvLYpC3tv8IRnhylEjc6KzA0tbM3 X-Received: by 2002:a17:906:b043:: with SMTP id bj3mr24259999ejb.338.1605098540955; Wed, 11 Nov 2020 04:42:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605098540; cv=none; d=google.com; s=arc-20160816; b=f48O210ZwExzmzBAZjTS26l9RmYTbNZSWCewlgwm1vtQ6KqjGl08S/nqeUXxIHiLo5 OEZVuXeCafzbRwYQUmfkjVjO6fIUrtduyw7wFXK3MDHy0IrSGE6MuMoAjsBB6bZOWh8N G8SfNtJVvjnIzaObTUNe+z5lsm3Rdvgm6+MJlmMufmlmjbgPpjwbG6j0/NqaG8Ehmbr/ CIxUNGJrDuCe45Hu+XDEYlP4gTEebtxwtsgdezpvu+wP/HmMLk568t4/Rt/hm5HLPK/V jASoRciQ9Bd35623YzAjXdmwhKq+NbA8SV6aAUc3vl6V06IJMZuQ0aL6Jdu3E1owDVDo gTKg== 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=/3LFCLrrOOmULLsAyX/ITC8Nw6YqSMkBIsTS6Dse1CA=; b=KjkOhjoJ0QilpOveCbA4OpsjUmZoH8XxP36fv1rTgZNVQE1pmoRKrmLkRAe4PNdcaS Ga/y8Yr5U8tUY2bCG8jFx0945oteOaQWLvVbp7h7Jqcn+OyxrTWu+5HypWR3C/Qqu8w3 oZC6wcYy1qRXpJiNxdkeOafsPYpga+5MvzI9S+6Zei5quVWF0UtbiqA73wSIcj3cHqHy cIhzdKPHP8LVkzT+2Y34J5WpFpCD++ENT4anUQIlYe807sp8HsnzIej0fFW2WsksMMnz 7ClZGeeP6SwGOrkUijxVsUi8BG8iUI2uHFSe4F2JulpQrLdtWWL8WikzJEfUf1ObDEH2 7S/w== 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 s20si1463703eji.711.2020.11.11.04.41.56; Wed, 11 Nov 2020 04:42:20 -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 S1726788AbgKKMj4 (ORCPT + 99 others); Wed, 11 Nov 2020 07:39:56 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:57231 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726784AbgKKMjy (ORCPT ); Wed, 11 Nov 2020 07:39:54 -0500 X-UUID: 821f586a59cb463f932f3a5a26b3e48a-20201111 X-UUID: 821f586a59cb463f932f3a5a26b3e48a-20201111 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 2138906237; Wed, 11 Nov 2020 20:39:51 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 11 Nov 2020 20:39:48 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 11 Nov 2020 20:39:48 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , , Greg Kroah-Hartman , Subject: [PATCH v4 07/24] iommu/io-pgtable-arm-v7s: Use ias to check the valid iova in unmap Date: Wed, 11 Nov 2020 20:38:21 +0800 Message-ID: <20201111123838.15682-8-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201111123838.15682-1-yong.wu@mediatek.com> References: <20201111123838.15682-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 --- 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