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

Re: [PATCH v2] x86/domain: adjust limitation on shared_info allocation below 4G


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 4 Feb 2026 17:46:08 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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=saiNXBLVrcDqpgsnQ0dJQ3O4Zs1V6YrfH/Ozq6SSQdE=; b=B13F6NiD072XcioiUdlWAHx5meQKl++MYD4w3296HED5lbuejIQAXECdgyCls85s9u/pwG5fFT/wj9lPJbVF6UyQ8Ms7EOZ4HTIo+WhNMFzVAqw/1ZaxUrvAnUp64K72r0KQUVSk79+JCf3sVNYccoL4S3djvMEFcJSTm0LZq71ImvxD/KApAQfOISVcCwltU4K60K33dNUuCdeQT4a9Ps2yrxxCFtxzIno6dl8OYFA2FVR8uqiIjZiGA1nc4LjwoT5rW/Pn9KdV/R5tbax5FXkQZrcjDgC6U8J85jzDltTXSRCswvKBXJjKV1iMD96+yc4H1se9FiIDAsxeAz85hA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZQjgGHiPzm5Q+H4Ly2QaI1T+CM1wM7ClPiTLhCWiDUQKYzFaSsYMBABbSysB7/4Fc9g07ur9ws0R1Tb7p6IgWt0Zxl2hBpHJY7ubl0NMePF1zZ/Ag/3qr15vWPzLGeArnxa0g03ttRdMh0m3JMPaFksTGbAc3OizljCTpkTL2jx/HXQYbaUixmrjGCIM1FsncS3Zzh+OL9xQJ0s5DETt3EMN6xe5q3mTXLRKFhJ+oIQoLhjd/ooNZFqf2yqRPT+Aqsg3YrTRysXyvrYtr132VIkSTRc9wdvWbm2yHCyaTIeuVV09qwWPAs/kguKpvZmFQ/TeeCjig10tAG8QkYxufg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 04 Feb 2026 16:46:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Feb 04, 2026 at 04:08:21PM +0100, Jan Beulich wrote:
> On 04.02.2026 15:52, Roger Pau Monné wrote:
> > On Wed, Feb 04, 2026 at 03:06:52PM +0100, Jan Beulich wrote:
> >> On 04.02.2026 13:25, Roger Pau Monne wrote:
> >>> The limitation of shared_info being allocated below 4G to fit in the
> >>> start_info field only applies to 32bit PV guests.  On 64bit PV guests the
> >>> start_info field is 64bits wide.  HVM guests don't use start_info at all.
> >>>
> >>> Drop the restriction in arch_domain_create() and instead free and
> >>> re-allocate the page from memory below 4G if needed in switch_compat(),
> >>> when the guest is set to run in 32bit PV mode.
> >>>
> >>> Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as 
> >>> it is advertised to 32-bit guests via a 32-bit machine address field in 
> >>> start_info.")
> >>
> >> The tag is here because there is the (largely theoretical?) possibility for
> >> a system to have no memory at all left below 4Gb, in which case creation of
> >> a PV64 or non-shadow HVM guest would needlessly fail?
> > 
> > It's kid of an issue we discovered when using strict domain NUMA node
> > placement.  At that point the toolstack would exhaust all memory on
> > node 0 and by doing that inadvertently consume all memory below 4G.
> 
> Right, and hence also my "memory: arrange to conserve on DMA reservation",
> where I'm still fighting with myself as to what to do with the comments you
> gave there.

Better fighting with yourself rather than fighting with me I guess ;).

That change would be controversial with what we currently do on
XenServer, because we don't (yet) special case the memory below 4G to
not account for it in the per node free amount of memory.

What would happen when you append the MEMF_no_dma flag as proposed in
your commit, but the caller is also passing MEMF_exact_node with
target node 0?  AFAICT the allocation would still refuse to use the
low 4G pool.

Also, your commit should also be expanded to avoid staking claims that
would drain the DMA pool, as then populate_physmap() won't be able to
allocate from there?  It would be weird for the toolstack to have
successfully made a claim, and then populate_physmap() returning
-ENOMEM because (part of) the claim has been made against the DMA
pool, which populate_physmap() would explicitly forbidden to allocate
from.

Thanks, Roger.



 


Rackspace

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