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 X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7B18C433FE for ; Tue, 21 Sep 2021 15:20:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B282561165 for ; Tue, 21 Sep 2021 15:20:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233976AbhIUPWJ (ORCPT ); Tue, 21 Sep 2021 11:22:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:53824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbhIUPWH (ORCPT ); Tue, 21 Sep 2021 11:22:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 23FAA60F6D; Tue, 21 Sep 2021 15:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632237638; bh=WvJINhXcisUZky+HUN9DxgfI9FXGZMjUYALHdqdsI54=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C9Etw3YtCOWVw9JzdGgLkkidUQJqj78YNO0MHYMvVWqv58rO0GTMuE1tWD4MyhWJy +71NUacvJfBvgBdZpp02JiXZXoc+/HtcolUs5uztcIGUA780GZ9cyyWLgvKjpQGp1s YuTkcsGAMnqYQDhQXem6YbirKQJB8mvsiHp8o2oM= Date: Tue, 21 Sep 2021 17:20:34 +0200 From: Greg KH To: "Longpeng(Mike)" Cc: andraprs@amazon.com, lexnv@amazon.com, alcioa@amazon.com, linux-kernel@vger.kernel.org, arei.gonglei@huawei.com, kamal@canonical.com, pbonzini@redhat.com, sgarzare@redhat.com, stefanha@redhat.com, vkuznets@redhat.com, ne-devel-upstream@amazon.com Subject: Re: [PATCH v2 1/4] nitro_enclaves: merge contiguous physical memory regions Message-ID: References: <20210921151039.1502-1-longpeng2@huawei.com> <20210921151039.1502-2-longpeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210921151039.1502-2-longpeng2@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 21, 2021 at 11:10:36PM +0800, Longpeng(Mike) wrote: > There can be cases when there are more memory regions that need to be > set for an enclave than the maximum supported number of memory regions > per enclave. One example can be when the memory regions are backed by 2 > MiB hugepages (the minimum supported hugepage size). > > Let's merge the adjacent regions if they are physical contiguous. This > way the final number of memory regions is less than before merging and > could potentially avoid reaching maximum. > > Signed-off-by: Longpeng(Mike) > --- > drivers/virt/nitro_enclaves/ne_misc_dev.c | 87 ++++++++++++++++++++----------- > 1 file changed, 58 insertions(+), 29 deletions(-) > What changed from v1?