Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1161096pxu; Fri, 27 Nov 2020 00:51:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlWqSxau6CgQ9r2PGC5UxN/pt0Rtn2xdcidHOrAiG98U4HX0P57PaKAg/4pEYTn8MsOxuL X-Received: by 2002:a05:6402:388:: with SMTP id o8mr6567366edv.359.1606467088447; Fri, 27 Nov 2020 00:51:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606467088; cv=none; d=google.com; s=arc-20160816; b=ZR9avlYO3r2yb//C2cVixqY7nCvwyc/WHLQqIoeht+YSol71mKV6LAR66v68HmCGtf 9EY97djXLivRoiioCjBn+T23JOEOYb6yHKsgS6eY6C0UB7S5Pc9FLb0tzSNlI4PlgOqF tV3E3wI2cztWxGKXEnkJgfLZQyLSCWS8NexU/8VmOXf9wL5VZm+H58Ez8feGsyR8S05w ndBbsrhZ2BfMrRFAgsBCAckCH7VKJbSLmiwRC8Eafe6QSm46/Fqgx9aTrB5Y13sRXjkC Z4ZvjeidDVbS+6SNNiVM2tUJUNbW+ifgA8+/iXC77agKlgUwpsijl4prkEHrOsR0aF5H jZ2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=gWFqjIgZJcUQlxaxqF4KJOYrIr+kx5lZqVQTXm3WVxc=; b=KB3nfo/1PtlCjc2x3TF5jg7rIPJE3YYxR4HGievu8wVu2TiCjJ14mFLdSvZK70TbsX RE2JotyWBbTcvdeTJa/HG7c6iu+psc3igx45tES5kOhX2/pHHhiVHpo3tOKi7/RegZTF iH0hsiBJWP4ZEn5HPL454nbXqvWGg6cNYEI2yVeRif2GoczCRpEIKow1pvr3gw2WA35d 4TM+Z05VM5Ge5yVNNVgrVLmpDc7CD3OLz+9psrrEpx5vqT5NKPKk/wU5RWP6HmRxgw3Q leDdNAi99m9vqx4pjN5F8aJCd/eKGSovx/uv7JtaixC6Ksjph1iM3ju4QwqdjHzp/h8h xeoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=qLRFbRuc; 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 dm7si5214786ejc.350.2020.11.27.00.51.05; Fri, 27 Nov 2020 00:51:28 -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; dkim=pass header.i=@mediatek.com header.s=dk header.b=qLRFbRuc; 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 S2392514AbgK0GVS (ORCPT + 99 others); Fri, 27 Nov 2020 01:21:18 -0500 Received: from Mailgw01.mediatek.com ([1.203.163.78]:47262 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2389247AbgK0GVS (ORCPT ); Fri, 27 Nov 2020 01:21:18 -0500 X-UUID: 7fd33999d69d4e238b17a63a32a1ba34-20201127 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=gWFqjIgZJcUQlxaxqF4KJOYrIr+kx5lZqVQTXm3WVxc=; b=qLRFbRucTIUtSK5qJesPIKLwZiHsaN99MkV2RYurS1zhc5QWY7DsLjpZMeuS/DB85ANJPnOsrh0znFKHjm/pqP3zHCeBD7e6JTJrKMXSWnDnYC3//8MlK/anA2zdoHztR+9m/jKPHelTrVkZQ8jOJ8i6ZujvRXTiCUBJET99jUw=; X-UUID: 7fd33999d69d4e238b17a63a32a1ba34-20201127 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 510553537; Fri, 27 Nov 2020 14:21:07 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS32N1.mediatek.inc (172.27.4.71) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 27 Nov 2020 14:21:04 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 27 Nov 2020 14:21:02 +0800 Message-ID: <1606458063.26323.190.camel@mhfsdcap03> Subject: Re: [PATCH] iommu: Improve the performance for direct_mapping From: Yong Wu To: Robin Murphy CC: Joerg Roedel , Will Deacon , , , Nicolas Boichat , , , , Krzysztof Kozlowski , Tomasz Figa , , , Matthias Brugger , Date: Fri, 27 Nov 2020 14:21:03 +0800 In-Reply-To: References: <20201120090628.6566-1-yong.wu@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 8385ECAE0D6D3223BDD513D2FBE4AE4F466D2488E98D903708BC01BA7A1574042000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gVGh1LCAyMDIwLTExLTI2IGF0IDE1OjE5ICswMDAwLCBSb2JpbiBNdXJwaHkgd3JvdGU6DQo+ IE9uIDIwMjAtMTEtMjAgMDk6MDYsIFlvbmcgV3Ugd3JvdGU6DQ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