From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Teddy Astie" <teddy.astie@vates.tech>
Subject: Re: [PATCH v2 1/3] x86: record SSP at non-guest entry points
Date: Wed, 8 Apr 2026 17:58:38 +0100 [thread overview]
Message-ID: <f08e0fbf-3570-4760-9977-4e99e651a3a4@citrix.com> (raw)
In-Reply-To: <de873764-c803-4f56-b88a-936cb948c382@suse.com>
On 08/04/2026 1:22 pm, Jan Beulich wrote:
> We will want to use that value for call trace generation, and likely
> also to eliminate the somewhat fragile shadow stack searching done in
> fixup_exception_return(). For those purposes, guest-only entry points do
> not need to record that value.
>
> To keep the saving code simple, record our own SSP that corresponds to
> an exception frame, pointing to the top of the shadow stack counterpart
> of what the CPU has saved on the regular stack. Consuming code can then
> work its way from there.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> For PUSH_AND_CLEAR_GPRS and POP_GPRS, putting the new field right next to
> the error code isn't entirely nice; putting it ahead of %r15 would entail
> other changes, though. An option may be to not make SSP handling part of
> the macros in the first place. Thoughts?
I have a firm dislike for SAVE/RESTORE_ALL, both for their substantial
complexity/inefficiency, and mixing of unrelated tasks.
I have several series trying to purge them. I suppose I really ought to
try and finish this off properly.
While classing SSP as a "register" is probably fine, the ssp= parameter
(and particular it's asymmetric nature) is on the wrong side of the
"complex" argument IMO.
> For POP_GPRS, does it really matter that it doesn't alter EFLAGS?
Yes. The SYSCALL fix for one (reviewed, but waiting on final testing
before I commit).
Then the VT-x code when swapped to use POP_GPRS.
To take a step back, you say that putting it ahead of %r15 would entail
other changes. What changes?
The resulting asm would be far cleaner. It would be an rdssp;push on
one side, and a pop into any register on the other side. Furthermore,
given that the ssp= doesn't exclude storing it for some user frames,
just store it for all. It's one push/pop into a hot cacheline, and
makes a substantial reduction in complexity.
~Andrew
next prev parent reply other threads:[~2026-04-08 16:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 12:20 [PATCH v2 0/3] x86: CET-SS related adjustments Jan Beulich
2026-04-08 12:22 ` [PATCH v2 1/3] x86: record SSP at non-guest entry points Jan Beulich
2026-04-08 16:58 ` Andrew Cooper [this message]
2026-04-09 8:13 ` Jan Beulich
2026-04-09 11:22 ` Andrew Cooper
2026-04-09 12:44 ` Jan Beulich
2026-04-08 12:23 ` [PATCH v2 2/3] x86/traps: use entry_ssp in fixup_exception_return() Jan Beulich
2026-04-08 17:34 ` Andrew Cooper
2026-04-08 12:23 ` [PATCH v2 3/3] x86: prefer shadow stack for producing call traces Jan Beulich
2026-04-08 17:53 ` Andrew Cooper
2026-04-09 8:42 ` Jan Beulich
2026-04-09 10:41 ` Jan Beulich
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=f08e0fbf-3570-4760-9977-4e99e651a3a4@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.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.