[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v12 6/6] xen: retrieve reserved pages on populate_physmap


  • To: Penny Zheng <Penny.Zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 6 Sep 2022 12:42:48 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q3rZ+1mwFYsgypB89oHiViLaS3/xNfX43sEXZ6JhB68=; b=ElSpMMsHKERDq3mafud7Yqlj+D7EBQvPMcB0DnNW9ItJMlxCOpld+OJQ01lvGiPVZq9ok7hdJOdW8GL21S6zMs5kjhOOpq5q2h3c6VaOeBYnn1LquzTabLB5QPQG4twf6ah0T6MdBS5kQfI7YeyxLU5FCPMK2z8t7I3WKXBYMKM72uCGIYgOSmMeDRwKqw0uQssjm3c+1Weii0xnCPSM+HUzSGbukYuO0HRWbdJIU2FjmjpvwSXFJyflT6eGZnQfHjZOB1vbr9Gnnj2flxE3oVxlNIyWEWTJcLY7tgb4Fudkl26yKdqMr10MLHZL0Eha8iVYmsfh9ASX/hshITPRdw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VhNRA74FaOLlWZfpQJQLzaxUFK/6XmNdEGoZrFliBn6zfx1M7LMv04JvIy1GmaDjGhfSQ7Ce6VsTOcB37vDDs7YFngwACK/XNxaGt7wMm6ca0AP1uQ2AHRMUykXbKuWNuhqFAyxM/gXL7X1EQTceQayNRMh0D1Pj+Pr/5lLQtvj/kgiSlZux3rEnY3dHfpazXf70vQmTJEGR6yaerWO1oZEUJf3EyJRdCZhAhQJZmcIMyx4gb14CY9/Gbd+m8tnPvoRwxQ//lKyb4AkpVAo0wC9cXgoap72xDvKTUe+ZxYJLHNxanR4IGIV/0Bp5oNhkU9rQNNX2JIVJYaKoI/MfpA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: wei.chen@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 06 Sep 2022 10:43:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.09.2022 09:39, Penny Zheng wrote:
> When a static domain populates memory through populate_physmap at runtime,
> it shall retrieve reserved pages from resv_page_list to make sure that
> guest RAM is still restricted in statically configured memory regions.
> This commit also introduces a new helper acquire_reserved_page to make it 
> work.
> 
> Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>

Just FTR: I have no further comments here, but I'm also not going to ack
this change with ...

> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -245,6 +245,29 @@ static void populate_physmap(struct memop_args *a)
>  
>                  mfn = _mfn(gpfn);
>              }
> +            else if ( is_domain_using_staticmem(d) )
> +            {
> +                /*
> +                 * No easy way to guarantee the retrieved pages are 
> contiguous,
> +                 * so forbid non-zero-order requests here.
> +                 */
> +                if ( a->extent_order != 0 )
> +                {
> +                    gdprintk(XENLOG_WARNING,
> +                             "Cannot allocate static order-%u pages for 
> %pd\n",
> +                             a->extent_order, d);
> +                    goto out;
> +                }
> +
> +                mfn = acquire_reserved_page(d, a->memflags);
> +                if ( mfn_eq(mfn, INVALID_MFN) )
> +                {
> +                    gdprintk(XENLOG_WARNING,
> +                             "%pd: failed to retrieve a reserved page\n",
> +                             d);
> +                    goto out;
> +                }
> +            }
>              else
>              {
>                  page = alloc_domheap_pages(d, a->extent_order, a->memflags);

... the gdprintk() left in here. I'm sure someone else (Julien?) will provide
the necessary ack.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.