Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1115420ybt; Fri, 10 Jul 2020 23:54:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv7bNSECzvJbtZgG+5R6rDBm4JewE23UkkDuLvd0VgTBaxujYM7OYV0e1145dBOGx3PeOS X-Received: by 2002:a17:906:95d9:: with SMTP id n25mr66394852ejy.437.1594450496647; Fri, 10 Jul 2020 23:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594450496; cv=none; d=google.com; s=arc-20160816; b=cjrvSX2qvZMGw7OM/fOd/Co4qgb2aEo+R51Yf18HYW1gynf7Dm+dzm49yIIvZJGoAF zuvtdRYyfl90if9T53HDGJma/2wTolS2sdaen+vxL8fW6GdpwoNGz0T4iuaC+Gc7gTuv Lj7nN114G6aT2RgX3XMdnM7jAlLR1Ye2bv454EukFnXdBiQyCgcaB/jpAjNNQuGsojvD 88LDrc3w06ze5ra6ipP47Fait32BhZfdQo9MJclGqMJOqb3dBHsqkdDPFJqthMm1YupH 8EcvfgFZbyiWdHPcWyr4NvUhzehdPEkGk2rZZeYQnZeawV5nff1PXaihVYLJ41Cb2lui bkzQ== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=YUbcm/TBN5RpjbvnJmbmtx55LW0FOK8Zwv658hz9Q9w=; b=ChjZnR1II+fwYhVSfXjIjWtvkXd2HYeIMWKub2PT34VIGb2WHJsy3LMqU2bdaOCKwX 1C22LUHu2l8O4/iGPbWP/GWgDh4njQ25y2KHCeBVs7fMR0ap/RKKaT9IZLVOhiQJqCQ5 o9+PvP8bXXxbN/xsUXHb3Y5k9fqkpaaFygPuQrABop+lp5296RGe1kDH1GAO3XHnZhTE iQ5udWIwvXKosAUQtzdozHcqkt1hDqHbDkRxktRMK5OrU6d8gc+rXyt4WqKfJEq3+bG5 IqSKBVBsq82kBpe7EJoAJ4VSbyif5l495lOFapLFv7rEgbCkIQYbhee/IlEc/XAfgg57 TVnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=nUBEuMrJ; 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=pass (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 ds7si6751043ejc.717.2020.07.10.23.54.34; Fri, 10 Jul 2020 23:54:56 -0700 (PDT) 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; dkim=pass header.i=@mediatek.com header.s=dk header.b=nUBEuMrJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728290AbgGKGvv (ORCPT + 99 others); Sat, 11 Jul 2020 02:51:51 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:32522 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727984AbgGKGvv (ORCPT ); Sat, 11 Jul 2020 02:51:51 -0400 X-UUID: 0988d45bc59946f4969a52bd4972c7cc-20200711 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=YUbcm/TBN5RpjbvnJmbmtx55LW0FOK8Zwv658hz9Q9w=; b=nUBEuMrJxTmU4gj5oZNvNCTfCSfYG7LjZnG2ttLkf/x1TkEhtM8OC2PlqllGxBm783YCyQbG0fvq2DeHB1zqoAEuAF+zPnqdzQtKi/lBXv+wn/Jr49amotH4kTGygOrhe9fLuOAUsH2uYcYYH8fmTNKxSlh4bvH0OVUyZM0+NpE=; X-UUID: 0988d45bc59946f4969a52bd4972c7cc-20200711 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 912225520; Sat, 11 Jul 2020 14:51:47 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 11 Jul 2020 14:51:37 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 11 Jul 2020 14:51:36 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy CC: Will Deacon , Evan Green , "Tomasz Figa" , , , , , , , , , Nicolas Boichat , , , , , Hao Chao Subject: [PATCH 12/21] iommu/mediatek: Add iova reserved function Date: Sat, 11 Jul 2020 14:48:37 +0800 Message-ID: <20200711064846.16007-13-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200711064846.16007-1-yong.wu@mediatek.com> References: <20200711064846.16007-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: E991A55DC3F3DBDB7EA98A2A0FED2C01FE166FBEE9AB15389FC6CB8FE9770A432000:8 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rm9yIG11bHRpcGxlIGlvbW11X2RvbWFpbnMsIHdlIG5lZWQgdG8gcmVzZXJ2ZSBzb21lIGlvdmEg cmVnaW9ucywgc28gd2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