[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


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Tue, 21 Apr 2026 16:30:25 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Rt4Cg6ARxQ+ti9bjvQsDIwEWRrHzxjbCHaD1tjnpnOQ=; b=KRs+BD7WeNONiIzAZdQuWy6cP2ulGv2IrS2jmyN+226KQrd6++clA9MGkHUcDsl6CaGGndstHqJt5zce6e0yrRzlN6ydo8oZiAukJJCTynoJ1PgTV5y0JrgKy6teJVju2tOQfpF/zkbXBm21jDLGNNIPaocVquYdoHnAplt+a7d/ufRVyeHFKTPCHnzjY+KWuuDNaKt/8UjN5ADh4zF0xGYQHH5EGII414vQZATYAr1GnLC1LQSTIcHVNFkb39eWipl60gYT5LkNH0HK9qsipKHG5p6MSAnEZ5S72y/5UqUbtCYO+JHKj/PmaV6PWBuatZKmB56bsvNQkWRgnNmYSw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fTtwaSw+aVl4SH51/el9lBT2yK1EcyEyr6lqy2TgWq5PItBDL0caSo9y6CYfn8nOpAsaKQumNCq6F2mESw10nVCUDEzO4S7oJaP9HFvf/CBta2KJUf6qDlaZDabqMzU1Fl4VaVKya45tJp5iO4QFwYVRVERU4ziRXnA5vGzG/zXllUQLfiY+6CIsgC6qDo3pEmPY/eMlziminOoVRXLXE3orVSZTMrpQdm6TX+9j05VkaypMvtQnGcisGdQu2nN9zLFSOnk7nmrGGBxEnhBN5Fj8ynpAp63kXWvL1Zzd5JPKAHQcJOenPdfJt4fyEHTeMrfEMfZj2nf4NnZRPNvUzQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Delivery-date: Tue, 21 Apr 2026 14:30:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 21/04/2026 15:30, Oleksii Kurochko wrote:
> Hello Michał,
> 
> On 4/17/26 11:11 AM, 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.
>>
>> Update the MPU implementation to match the new init_frametable()
>> signature. Since MPU has no virtual address translation (ma == va),
>> hole-skipping is not possible and the frametable remains a single
>> contiguous allocation.
>>
>> Signed-off-by: Michal Orzel<michal.orzel@xxxxxxx>
>> ---
>> We've been using this approach at AMD for a while now. Without this we would 
>> not
>> be able to boot some of our boards that have huge holes in the PA space, so I
>> consider this patch a great improvement.
>>
>> Two things to consider as a follow-up in the future:
>>   - change generic pdx_to_page, page_to_pdx to take into account offset that
>>     on x86 is zero but on other arches it is not. The page list code is
>>     for now unaffected because the offset cancels out,
>>   - use the same on RISCV.
> 
> Do you have such plans to do that for RISC-V?
My plan for this release cycle is to do this for Arm as we can observe great
improvement in space management. Other things that I mentioned I planned for the
future. I don't want to add new things on our plate in this release.

~Michal




 


Rackspace

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