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

Re: [PATCH V4 3/3] libxl/arm: Add handling of extended regions for DomU




On 30.09.21 01:52, Oleksandr Tyshchenko wrote:

Hi Stefano, Julien.

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

The extended region (safe range) is a region of guest physical
address space which is unused and could be safely used to create
grant/foreign mappings instead of wasting real RAM pages from
the domain memory for establishing these mappings.

The extended regions are chosen at the domain creation time and
advertised to it via "reg" property under hypervisor node in
the guest device-tree. As region 0 is reserved for grant table
space (always present), the indexes for extended regions are 1...N.
If extended regions could not be allocated for some reason,
Xen doesn't fail and behaves as usual, so only inserts region 0.

Please note the following limitations:
- The extended region feature is only supported for 64-bit domain
   currently.
- The ACPI case is not covered.

***

The algorithm to choose extended regions for non-direct mapped
DomU is simpler in comparison with the algorithm for direct mapped
Dom0. As we have a lot of unused space above 4GB, provide single
2MB-aligned region from the second RAM bank taking into the account
the maximum supported guest address space size and the amount of
memory assigned to the guest. The maximum size of the region is 128GB.
The minimum size is 64MB.

Suggested-by: Julien Grall <jgrall@xxxxxxxxxx>
Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Acked-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
Tested-by: Michal Orzel <michal.orzel@xxxxxxx>

I though a bit more on this and decided to make a patch more functional by trying to also allocate extended region below 4GB, I think we could do with it. Actually if guest memory size is less than GUEST_RAM0_SIZE, we are able to provide unused space. I have tested with with various guest memory sizes and it worked fine. Also I decided to drop limit for maximum extended region size (128GB), we don't apply this limit in Dom0 and I don't see why we need it here, moreover the calculation became more obvious. I will drop all acks and send updated version. Are there any objections?



--
Regards,

Oleksandr Tyshchenko




 


Rackspace

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