[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: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 4 Feb 2026 18:46:56 +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=7zE62sc98JZNuIcLnSEs6JQyYdoRslGOmJbJEFXh/Ys=; b=oZe2IW26keKx2GeN6GPtPw5jmIpyIPmjSwxB/81n+WXZsqm6yvzD3aB9j2hA33lxUBQ9OP/uQfF6o7SWPArc8LBNb1sYShsjetfN++nsRnu7x1R5BLfD3HZDXS299KYSGBXzf/jOIbZxf8FAl4bO04VLleFJd0L4F6XxAjVNVOTpIfOabJal42aEvA4Y6+AfagkHa/2YWmwTDw+ZT2NdIsaNkmEgfOrByLCkQUgIyRTaPV2mBzJHBCQvlt1QetDW4xC7/TGHmSW1IAAv0pSzS9uiBakfbMlZurreAK6hMd6rH7Ijw6hfRRTd2xKitPHOqF8SJOPREEVGDVAd84SCOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oF7DOZg0awaoEPXqrkAsVZLHpeYYAAdmqxUZmTq3gSjGX06SMWj7sO9h0IZZaXvJTPIKYVfGJ1iJ15Ydp6Nr8nmiZ1zcyyo9BSvpqlDgIRiK0s7STxWF1Ku3rcfDKD7t3dNzetSgm/7nfWqBu/BqmdacgOsP2oSjB7Af8rwhjFtApHxW2oaEC4zOhAL2T5fbb1+HgHqzRseVdO6x5kFvd5B70SUO4QBGxdItYjv+90wCxE7NDvKmUY6AcyxS7GxbnSkRuj1s+SjfHF9LfNvu69Sxim8yf7ERYZBo3pHd5niOtPrEYtPQu4Jc33/v/s7cmHtxwlQu4+Xs49BBMWmOtA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 04 Feb 2026 17:47:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Feb 04, 2026 at 05:23:21PM +0000, Andrew Cooper wrote:
> On 04/02/2026 4:54 pm, Roger Pau Monné wrote:
> > On Wed, Feb 04, 2026 at 04:32:25PM +0100, Jan Beulich wrote:
> >> On 04.02.2026 16:12, Andrew Cooper wrote:
> >>> On 04/02/2026 3:01 pm, Roger Pau Monné wrote:
> >>>>>> +        share_xen_page_with_guest(virt_to_page(d->shared_info), d, 
> >>>>>> SHARE_rw);
> >>>>>> +        /* Ensure all references to the old shared_info page are 
> >>>>>> dropped. */
> >>>>>> +        for_each_vcpu( d, v )
> >>>>>> +            vcpu_info_reset(v);
> >>>>> switch_compat() can only occur on a domain with no memory.  How can we
> >>>>> have outstanding references?
> >>>> As Jan pointed out, it's not references, but stashed pointers to the
> >>>> previous shared_info page.  I've used the wrong wording here.
> >>> Yes, I saw that thread, but my question still stands.
> >>>
> >>> How can there be any this early in the domain's lifecycle?
> >> Can't (aren't) vCPU-s added ahead of adding memory?
> > At least on x86 when using xl/libxl the call to
> > XEN_DOMCTL_set_address_size happens after the call to
> > XEN_DOMCTL_max_vcpus, and the later calls vcpu_create() which sets the
> > pointer into the shared_info page for legacy (< 32) vCPUs.
> 
> Geez, that disaster of an interface still has spike traps we're falling
> foul of.
> 
> Please extend the comment to note the first 32 vcpu compatibility case.
> 
> But, combined with the format change (clear vs copy page), doesn't it
> mean there's an existing bug here?
> 
> Even without moving the shared_info page, aren't the cached pointers
> made wrong by switch_compat() ?

No, they are not wrong because the vcpu_info array is at the start of
shared_info, and it has the same size (64bytes) on both 32 and 64bits.
Hence the offsets into the different vcpu_info array elements are the
same regardless of bitness.

> This is one area where we've got no XTF testing at all, and I probably
> ought to see about fixing that.

Yeah, it's not great.

Thanks, Roger.



 


Rackspace

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