From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>,
xen-devel@lists.xenproject.org,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v2] x86/domain: adjust limitation on shared_info allocation below 4G
Date: Wed, 4 Feb 2026 18:46:56 +0100 [thread overview]
Message-ID: <aYOGEOxyeSYlIwNo@Mac.lan> (raw)
In-Reply-To: <3c3d3309-956e-463d-ba03-2e557e79fbab@citrix.com>
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.
prev parent reply other threads:[~2026-02-04 17:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 12:25 [PATCH v2] x86/domain: adjust limitation on shared_info allocation below 4G Roger Pau Monne
2026-02-04 14:06 ` Jan Beulich
2026-02-04 14:52 ` Roger Pau Monné
2026-02-04 15:08 ` Jan Beulich
2026-02-04 16:46 ` Roger Pau Monné
2026-02-05 8:29 ` Jan Beulich
2026-02-05 14:08 ` Roger Pau Monné
2026-02-05 14:12 ` Jan Beulich
2026-02-04 14:20 ` Andrew Cooper
2026-02-04 14:40 ` Jan Beulich
2026-02-04 15:10 ` Andrew Cooper
2026-02-04 15:01 ` Roger Pau Monné
2026-02-04 15:04 ` Jan Beulich
2026-02-04 15:12 ` Andrew Cooper
2026-02-04 15:32 ` Jan Beulich
2026-02-04 16:54 ` Roger Pau Monné
2026-02-04 17:23 ` Andrew Cooper
2026-02-04 17:46 ` Roger Pau Monné [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYOGEOxyeSYlIwNo@Mac.lan \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.