|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH V6 2/2] libxl/arm: Add handling of extended regions for DomU
Hi Oleksandr, On 11/10/2021 18:48, Oleksandr Tyshchenko wrote:
I understand why we want to limit to 64-bit domain for dom0. But I am not sure this is warrant for 32-bit domain. At worse, the guest will ignore the bank because it is not usable. So could we drop the check? + + res = libxl_domain_info(CTX, &info, dom->guest_domid); + if (res) return res; + + assert(info.gpaddr_bits >= 32 && info.gpaddr_bits <= 48); What could go wrong below if gpaddr_bits is not within this range? + + /* + * Try to allocate separate 2MB-aligned extended regions from the first + * (below 4GB) and second (above 4GB) RAM banks taking into the account + * the maximum supported guest physical address space size and the amount + * of memory assigned to the guest. + * As the guest memory layout is not populated yet we cannot rely on + * dom->rambank_size[], so calculate the actual size of both banks using + * "max_memkb" value. + */ At the moment, libxl doesn't know how libxc will allocate the memory. We may decide in the future to have only a small amount of memory below 4GB and then the rest above 4GB. With this approach it would be more difficult to modify the memory layout. Instead, I think we should create a placeholder that is updated once we know the banks in libxl__arch_domain_finalise_hw_description. We also probably want to mention in the memory layout in public/arch-arm.h this decision as the suggested way to find extended regions will definitely impact our decision to re-order the memory layout or shrink some regions in the future (I have in mind the PCI Passthrough work). It would be best to not rely on the fact that Bank on is always below 4GB. If the code is too complex then we should look to add a BUILD_BUG_ON() to avoid any surprise. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |