From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
Jason Andryuk <jason.andryuk@amd.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Teddy Astie <teddy.astie@vates.tech>,
Oleksii Kurochko <oleskii.kurochko@gmail.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH for-4.22 v3] xen/x86: Change stub page allocation/free
Date: Fri, 12 Jun 2026 11:32:59 +0200 [thread overview]
Message-ID: <aivSS-yUhIFWr7Ya@macbook.local> (raw)
In-Reply-To: <93904b00-6e26-49c4-be8f-e7d8aed8e590@suse.com>
On Fri, Jun 12, 2026 at 11:27:38AM +0200, Jan Beulich wrote:
> On 12.06.2026 10:22, Roger Pau Monne wrote:
> > From: Jason Andryuk <jason.andryuk@amd.com>
> >
> > Today the inline tracking of the stub page is problematic. 0xcc is used to
> > indicate unused, but it is also a "clear value." A !CONFIG_PV build or
> > when running with FRED support will not populate the LSTAR/CSTAR stubs at
> > CPU bringup. If a CPU is then offlined, the stubs page will be freed as
> > its content will be all 0xcc, regardless of the stubs page still begin
> > referenced by other CPUs.
> >
> > The new approach uses a global, CPU-indexed dynamically allocated array of
> > stub addresses. However, to handle NUMA aware allocations, we cannot
> > allocate all the memory in advance because of the NUMA dependency. Take
> > advantage of the fact that Xen will attempt to contiguously pack CPUs on
> > the same NUMA node (see normalise_cpu_order()), and on CPU bringup use the
> > same stubs page the previous CPU did if suitable. Note the code would
> > still function properly even if CPUs from NUMA nodes are not contiguously
> > packed, it just consumes more memory.
> >
> > stub pages are no longer freed. They remain referenced in the global
>
> Nit: Didn't you mean to s/stub/Stub/ as per Andrew's comment?
Hm, yes, I've fixed the instance below, but not the one here.
> > CPU-indexed array and are re-used if the CPU is re-onlined.
> >
> > The stubs array doesn't have an explicit lock. During boot it's accessed
> > single threaded. During runtime, &cpu_add_remove_lock serializes access.
> >
> > Fixes: 7a66ac8d1633 ("x86: move syscall trampolines off the stack")
> > Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > Tested-by: Jason Andryuk <jason.andryuk@amd.com>
> > Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
Thanks.
I will run a CI pre-commit loop and push it today if it's all fine.
Roger.
next prev parent reply other threads:[~2026-06-12 9:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 8:22 [PATCH for-4.22 v3] xen/x86: Change stub page allocation/free Roger Pau Monne
2026-06-12 9:27 ` Jan Beulich
2026-06-12 9:32 ` Roger Pau Monné [this message]
2026-06-12 9:35 ` Andrew Cooper
2026-06-12 9:51 ` Roger Pau Monné
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=aivSS-yUhIFWr7Ya@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jason.andryuk@amd.com \
--cc=jbeulich@suse.com \
--cc=oleksii.kurochko@gmail.com \
--cc=oleskii.kurochko@gmail.com \
--cc=teddy.astie@vates.tech \
--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.