|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen/arm: skip holes in physical address space when setting up frametable
Hi Michal, On 22/04/2026 09:25, Orzel, Michal wrote: On 22/04/2026 09:01, Julien Grall wrote:Hi Michal, On 17/04/2026 10:11, Michal Orzel wrote:Refactor setup_frametable_mappings() into init_frametable(), modeled after x86's implementation. Instead of mapping one contiguous frametable covering ram_start to ram_end (including holes), iterate the pdx_group_valid bitmap to allocate and map frametable memory only for valid PDX groups, skipping gaps in the physical address space. At the moment we don't really take into account pdx_group_valid bitmap. This reduces memory consumption on systems with sparse RAM layouts by not allocating frametable entries for non-existent memory regions. A file-local pdx_to_page() override is needed because the generic macro in xen/include/xen/pdx.h does not account for ARM's non-zero frametable_base_pdx.Can you provide a bit more details? I am a bit concerned that this could result to subttle bug in the future if code within mm.c is expecting the original behavior. It would be preferable if the change is either for everyone on Arm or the function is renamed to avoid any clash.The generic pdx_to_page macro does not account for offset which is something I mentioned in the footer and I'm willing to work on in the future. Sorry I missed the comment in the footer. But if the function is broken, then why can't we implement pdx_to_page() correctly now? I understand that ... As of today, this macro is *unused* on Arm. It's only used by x86 in some special big mem related scenario. Using generic pdx_to_page on Arm would be wrong, so a future patch doing that would be wrong (the fact that this patch adds a local redefine does not change anything). Do we need a rename for a local redefine in a file that is only related to frametable? Maybe a comment and a TODO would be ok? ... this is not meant to be used by Arm today. But given this is used in the page list, it is definitely not obvious that it is broken. The alternative is to protect/move pdx_to_page() in x86. But I don't know much churn this would involve. [...] Looking at the code, it seems to be based on SECOND_SHIFT which technically depends on the page granularity. Even though Xen supports only 4KiB, we are trying to avoid making such assumption or add least adding a BUILD_BUG_ON() (in this case, I would consider that PDX_GROUP_COUNT is always 2MiB or SECOND_SHIFT). in-loop chunks are multiple of 2MB, there is no roundup needed - zero overshoot. The last chunk may have ~2MB overshoot but it does not matter as there is nothing after it to conflict with. The downside is more TLB pressure. I am a bit warry to modify the frametable allocation method because it is used fairly often in Xen. Would it be possible to hence the loop to detect contiguous chunk and decide the size allocation based on the chunk? Alternatively, we could reduce the mapping size closer to boundaries (x86 choice) but that would require a bit more work. This would technically have the same downside as above. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |