Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp169617pxa; Wed, 26 Aug 2020 07:37:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWIRERPD2F1M6g/XY8yyj5UrG5Q033GPPNql9EaarruxeUpp5kvyUX3KKDOuVPcYP2nyki X-Received: by 2002:a50:b2a5:: with SMTP id p34mr2817360edd.385.1598452643409; Wed, 26 Aug 2020 07:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598452643; cv=none; d=google.com; s=arc-20160816; b=j9IOXKYN1OsHkp2R5k2nd+t3q6vj0fzs/m+mftZIPirEZlvsqVgEW73J6tImPF7W0/ HLbsnLkvWz24vynRIN9bug+/srGAEuVLhZmOSc9/JtP95dk4sbXYy/m52u39TD6vy8pG KzcH9A/W3NTneBEK06pPIpXUF0cc6x/m3G/AzmDICBBXkFwu/sJWlpCsyYmu5Lpkzl9K UDvQcbBYwoVFdovazK9TYDNaLLDXqrQqRrEVT0wqzSZX+KzKBoeNI+3wtbivkLtgCd1n VCqwUMfIbolig0gmKcj3lfIPFNydt3HSdmfSyC5CUS1RiGuo7e8PJCqr9pTZYFYVDUHw Zhag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=zsSzHR+bF1cTT+ULZ2Gw3I/VOuNsRElme+qixXgxggI=; b=QbY/y3wI8N/xSqj2Oj+RbxSr6Ho+YJrtU5GgGuDRG9lXxqfqLKM206G2Qy5RIeUIaw 0Zlg0kvTmhHAt87WnG0AOT7ggTRRi9sZKGZbHKwfG2DgfVBN+F4c/IGvl5iKKIAScp3K EXmebA0z8Z/Vo4AJm7odyFI8sizr9i8c7GMlz4901fx1o1elXIclqcuuA+5Dzx1RkxLj qvDW6I6lj7f1pTNNofEBUifNXTIWHmDgN691BGgJawtxczBXZgBaHiK4LYTvxWfbn78Z DRSL/MuZlV84tr+lZBVKmo38I5jBs2lVzxg64Uzxcwgblu/7Y/umffV6UXYINmLqzra5 3WOA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si1715295ejz.521.2020.08.26.07.36.59; Wed, 26 Aug 2020 07:37:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730545AbgHZN5G (ORCPT + 99 others); Wed, 26 Aug 2020 09:57:06 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3075 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730520AbgHZN5B (ORCPT ); Wed, 26 Aug 2020 09:57:01 -0400 Received: from dggeml406-hub.china.huawei.com (unknown [172.30.72.56]) by Forcepoint Email with ESMTP id 280655977C8843E0192B; Wed, 26 Aug 2020 21:56:54 +0800 (CST) Received: from DGGEML423-HUB.china.huawei.com (10.1.199.40) by dggeml406-hub.china.huawei.com (10.3.17.50) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 26 Aug 2020 21:56:53 +0800 Received: from DGGEML524-MBX.china.huawei.com ([169.254.1.71]) by dggeml423-hub.china.huawei.com ([10.1.199.40]) with mapi id 14.03.0487.000; Wed, 26 Aug 2020 21:56:43 +0800 From: "Maoming (maoming, Cloud Infrastructure Service Product Dept.)" To: Peter Xu CC: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "alex.williamson@redhat.com" , "cohuck@redhat.com" , "Zhoujian (jay)" , "Huangweidong (C)" , "aarcange@redhat.com" , wangyunjian Subject: =?utf-8?B?562U5aSNOiBbUEFUQ0ggVjJdIHZmaW8gZG1hX21hcC91bm1hcDogb3B0aW1p?= =?utf-8?Q?zed_for_hugetlbfs_pages?= Thread-Topic: [PATCH V2] vfio dma_map/unmap: optimized for hugetlbfs pages Thread-Index: AQHWcePn246e6Z2xQkKwoyKqsTP1MqlI20CAgAGejeA= Date: Wed, 26 Aug 2020 13:56:43 +0000 Message-ID: <8B561EC9A4D13649A62CF60D3A8E8CB28C2D9ABB@dggeml524-mbx.china.huawei.com> References: <20200814023729.2270-1-maoming.maoming@huawei.com> <20200825205907.GB8235@xz-x1> In-Reply-To: <20200825205907.GB8235@xz-x1> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.151.129] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DQoNCg0KDQotLS0tLemCruS7tuWOn+S7ti0tLS0tDQrlj5Hku7bkuro6IFBldGVyIFh1IFttYWls dG86cGV0ZXJ4QHJlZGhhdC5jb21dIA0K5Y+R6YCB5pe26Ze0OiAyMDIw5bm0OOaciDI25pelIDQ6 NTkNCuaUtuS7tuS6ujogTWFvbWluZyAobWFvbWluZywgQ2xvdWQgSW5mcmFzdHJ1Y3R1cmUgU2Vy dmljZSBQcm9kdWN0IERlcHQuKSA8bWFvbWluZy5tYW9taW5nQGh1YXdlaS5jb20+DQrmioTpgIE6 IGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc7IGt2bUB2Z2VyLmtlcm5lbC5vcmc7IGFsZXgu d2lsbGlhbXNvbkByZWRoYXQuY29tOyBjb2h1Y2tAcmVkaGF0LmNvbTsgWm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