[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b5460659-88a5-c2aa-c339-815d5618bcb5@xen.org>
Date: Tue, 28 Jul 2020 17:48:23 +0100
From: Julien Grall <julien@....org>
To: Roger Pau Monne <roger.pau@...rix.com>,
linux-kernel@...r.kernel.org
Cc: Juergen Gross <jgross@...e.com>,
Stefano Stabellini <sstabellini@...nel.org>,
Wei Liu <wl@....org>,
Oleksandr Andrushchenko <oleksandr_andrushchenko@...m.com>,
David Airlie <airlied@...ux.ie>,
Yan Yankovskyi <yyankovskyi@...il.com>,
David Hildenbrand <david@...hat.com>,
dri-devel@...ts.freedesktop.org, Michal Hocko <mhocko@...nel.org>,
linux-mm@...ck.org, Daniel Vetter <daniel@...ll.ch>,
xen-devel@...ts.xenproject.org,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Dan Williams <dan.j.williams@...el.com>,
Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH v3 4/4] xen: add helpers to allocate unpopulated memory
Hi,
On 27/07/2020 10:13, Roger Pau Monne wrote:
> To be used in order to create foreign mappings. This is based on the
> ZONE_DEVICE facility which is used by persistent memory devices in
> order to create struct pages and kernel virtual mappings for the IOMEM
> areas of such devices. Note that on kernels without support for
> ZONE_DEVICE Xen will fallback to use ballooned pages in order to
> create foreign mappings.
>
> The newly added helpers use the same parameters as the existing
> {alloc/free}_xenballooned_pages functions, which allows for in-place
> replacement of the callers. Once a memory region has been added to be
> used as scratch mapping space it will no longer be released, and pages
> returned are kept in a linked list. This allows to have a buffer of
> pages and prevents resorting to frequent additions and removals of
> regions.
>
> If enabled (because ZONE_DEVICE is supported) the usage of the new
> functionality untangles Xen balloon and RAM hotplug from the usage of
> unpopulated physical memory ranges to map foreign pages, which is the
> correct thing to do in order to avoid mappings of foreign pages depend
> on memory hotplug.
I think this is going to break Dom0 on Arm if the kernel has been built
with hotplug. This is because you may end up to re-use region that will
be used for the 1:1 mapping of a foreign map.
Note that I don't know whether hotplug has been tested on Xen on Arm
yet. So it might be possible to be already broken.
Meanwhile, my suggestion would be to make the use of hotplug in the
balloon code conditional (maybe using CONFIG_ARM64 and CONFIG_ARM)?
Cheers,
--
Julien Grall
Powered by blists - more mailing lists