From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCC51C433F5 for ; Sat, 9 Oct 2021 01:33:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A854960FC3 for ; Sat, 9 Oct 2021 01:33:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244078AbhJIBey (ORCPT ); Fri, 8 Oct 2021 21:34:54 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:24225 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232063AbhJIBex (ORCPT ); Fri, 8 Oct 2021 21:34:53 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HR6wm6BhPzQj2h; Sat, 9 Oct 2021 09:31:52 +0800 (CST) Received: from dggpeml100016.china.huawei.com (7.185.36.216) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sat, 9 Oct 2021 09:32:53 +0800 Received: from DESKTOP-27KDQMV.china.huawei.com (10.174.148.223) by dggpeml100016.china.huawei.com (7.185.36.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sat, 9 Oct 2021 09:32:53 +0800 From: "Longpeng(Mike)" To: , , CC: , , , , , , , , , Longpeng Subject: [PATCH v3 0/4] Merge contiguous physical memory regions Date: Sat, 9 Oct 2021 09:32:44 +0800 Message-ID: <20211009013248.1174-1-longpeng2@huawei.com> X-Mailer: git-send-email 2.25.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.148.223] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml100016.china.huawei.com (7.185.36.216) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Longpeng Hi guys, This patchset try to merge the contiguous physical memory regions when set user memory regions, you can see message in PATCH 1 for details. Please review when you free, thank! Changes v2 -> v3: Patch 1: - update the commit title and commit message. [Andra] - use 'struct range' to instead of 'struct phys_mem_region'. [Andra, Greg KH] - add comments before the function definition. [Andra] - rename several variables, parameters and function. [Andra] Patch 2: - update the commit title and commit message. [Andra] - add comments before the function definition. [Andra] - remove 'inline' attribute of ne_sanity_check_phys_mem_region. [Andra] - leave a blank line before return. [Andra] - move sanity check in ne_merge_phys_contig_memory_regions to the beginning of the function. [Andra] - double sanity checking after the merge of physical contiguous memory regions has been completed. [Andra] Patch 3: - update the commit title and commit message. [Andra] - use "misc_dev"/"misc device"/"MISC_DEV" to be more specific. [Andra] Patch 4: - update the commit title and commit message. [Andra] - align the fileds in 'struct phys_regions_test'. [Andra] - rename 'phys_regions_testcases' to 'phys_regions_test_cases'. [Andra] - add comments before each test cases. [Andra] - initialize the variables in ne_misc_dev_test_merge_phys_contig_memory_regions. [Andra] Changes v1 -> v2: - update the commit message as Andra's suggestion [Andra] - remove TODO completely in ne_set_user_memory_region_ioctl [Andra] - extract the physical memory regions setup into individual function - add kunit tests [Andra] Longpeng (4): nitro_enclaves: Merge contiguous physical memory regions nitro_enclaves: Sanity check physical memory regions during merging nitro_enclaves: Add KUnit tests setup for the misc device functionality nitro_enclaves: Add KUnit tests for contiguous physical memory regions merging drivers/virt/nitro_enclaves/Kconfig | 9 ++ drivers/virt/nitro_enclaves/ne_misc_dev.c | 163 +++++++++++++++++++------ drivers/virt/nitro_enclaves/ne_misc_dev_test.c | 153 +++++++++++++++++++++++ 3 files changed, 285 insertions(+), 40 deletions(-) create mode 100644 drivers/virt/nitro_enclaves/ne_misc_dev_test.c -- 1.8.3.1