Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2997551pxb; Tue, 21 Sep 2021 12:07:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh+8ch5kvdIZRGPx7G1DlVgl56HrUk3LE3ZdhQnmMHeinwLvlPv8zcro3pkXiBK2zFyWW7 X-Received: by 2002:a05:6e02:1b03:: with SMTP id i3mr4046469ilv.251.1632251221474; Tue, 21 Sep 2021 12:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632251221; cv=none; d=google.com; s=arc-20160816; b=xzgC3xtnflS9dxHZKXS8kMKXh3xLJ5GVDU+v5FRIE32wuAUEAZaxOnFsAnWo8d+P8p pdlUd33sCV9bBU7t0KuQIZ+rg/sFAwkPoV5Ya3y5OSptDBk9wMj5wYDD8+OPHCKe8iTn EHoTk3oil4ypeGGAoxrHQEsDG9a611oe9r9Ygil/9DaOsAvR+mNGTKnQXNYPFMZ/Q2cg xvMsvdhUgsANGj9+kDN2Flxff5Y8XL0w0E8hIX/hkXy+X34ATC2UNydWNh1oZ8mWFSds 6tRwosjh+IByG3iEmORKbjYsqEXOcQ4KZ2900tA0voQxQ1ttbOn0swmrdd2BBzSjz1BM QACg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+9exDJn/guwTQ6u1PK1NdVAeVgzUnt48MvTLrXQLRkg=; b=dk70HaQoul6J8TwsrAu5Yc6qqtqNmi9loTPtpxKkw7E0VeJ67xl1iKBsqEkZ8dVxEA coLoJgMcskaItIhMXzm7mi8M8DcX8m5yFsKvwLK3LC0EOyb4YzmYAbgdXK0GiMrAd3Fp 14UUvGa4wxVkkYUIwDFj8BDZUVY7lW1Nq5K6LuhfZk7G041nUOcSZqtbraDuE0+VDCV6 w/Sb9NzOQCZq+fC+SOsOTxLeS4NTIW4aeG3VI8Fk4sLZQG1gLQgHLqvxyZwGgVrrByFQ GnnoHTlSU8TONJ553YslphHmO0+a6Xtj7W3bpODlhy/5MoWCiLw8krEMtrP0etphBO9h 34wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C9Etw3Yt; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 62si616685jaf.46.2021.09.21.12.06.48; Tue, 21 Sep 2021 12:07:01 -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=@linuxfoundation.org header.s=korg header.b=C9Etw3Yt; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233954AbhIUPWH (ORCPT + 99 others); Tue, 21 Sep 2021 11:22:07 -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?