Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2188688pxb; Mon, 11 Jan 2021 03:25:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBKGE1KfsKZsk6c4G/3HSnjq+N8kvYPeTKqkPMsVOBATGMHFLyOnFEW/eNrvV78FZ2hT2w X-Received: by 2002:a50:d604:: with SMTP id x4mr13773337edi.64.1610364346223; Mon, 11 Jan 2021 03:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610364346; cv=none; d=google.com; s=arc-20160816; b=shq/gs3XmzeeJhq+g0Iqy4MYdACipQZWASI00czpNOleouEppw9jc084IQV8RETCA+ nAUpYuo8Uygh7f4FAeJPIah5NNRYFhsbX/R/FBEDQj0EBNW8ZHEfbSqd7HUT6mVzKTcl Oz2FzLew3SdZA7UpzMitxRr3g7nqEL4BAOOkWmsQ8e8NMU90shEv5t4qYIX7oqP4J95T dbEDPx9YNEK03pQ8rlwkDRUfVhTz8i9uDRluCQK8Wg3idd8y5dAELXTMxS5Bc/1Y0me6 mAcjhB0b+B+FMYTHuVQWreZ6Zl4swhdFPEG7axBjozy+pLtsMXEVWIYQh3Ws7ueKZrqk 5sNw== 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=IEKYO1G2t7Wk4rnTtNumYPddpsTLZrdmQGNecGjmwlY=; b=Ri5x/QCYrBsELIyL+WvTVKh2wsouztgIZQIHn1rLmDcoZhFKW9+8Hja6ldZELf/mnG qLqBygobwCUaMu0VRKfXtR0Vy+2FoVtWaBGhKYcGvQ6OCRYDS2U7KjT4p4rgjrHwNONf fI/216co6bhyhY5nFJ1kpGeIasPWNUyLtEMMHxqzyTr75fADs1MBaij8D/U0DhwXnngq 5HV0bqpiAZ/PF+RYIMrz9ztVZrso7kNi4V4AMB+OZ6RoA4EWAnmqZV9yP8t0snMFYH4w 6+iV2qmjNQI5jBRSECLOtwcbgdxQ0RltoCEc+O56SzWAHPCGj/TxGkIdSAv8TbYO+Sx5 f0vg== 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 cz3si6383825edb.467.2021.01.11.03.25.23; Mon, 11 Jan 2021 03:25:46 -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 S1729740AbhAKLVf (ORCPT + 99 others); Mon, 11 Jan 2021 06:21:35 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:44470 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729735AbhAKLVe (ORCPT ); Mon, 11 Jan 2021 06:21:34 -0500 X-UUID: 044ae1d7461c445cb3ea0b575d328b23-20210111 X-UUID: 044ae1d7461c445cb3ea0b575d328b23-20210111 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 1256889645; Mon, 11 Jan 2021 19:21:13 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 11 Jan 2021 19:21:00 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 11 Jan 2021 19:21:00 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , "Matthias Brugger" , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , Subject: [PATCH v6 09/33] iommu/io-pgtable-arm-v7s: Use ias to check the valid iova in unmap Date: Mon, 11 Jan 2021 19:18:50 +0800 Message-ID: <20210111111914.22211-10-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210111111914.22211-1-yong.wu@mediatek.com> References: <20210111111914.22211-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 1d92ac948db7..eb3703bfd98e 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