From: Peter Zijlstra <peterz@infradead.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
x86@kernel.org, Borislav Petkov <bp@alien8.de>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Babu Moger <babu.moger@amd.com>,
David.Kaplan@amd.com, Nikolay Borisov <nik.borisov@suse.com>,
gregkh@linuxfoundation.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/4] x86/srso: Rename fam17 SRSO infrastructure to srso_fam17_*()
Date: Wed, 13 Sep 2023 15:15:39 +0200 [thread overview]
Message-ID: <20230913131539.GA22758@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20230821112723.3995187-3-andrew.cooper3@citrix.com>
On Mon, Aug 21, 2023 at 12:27:21PM +0100, Andrew Cooper wrote:
> The naming is inconsistent. Rename it to fam17 to state the microarchitecture
> it is applicable to, and to mirror the srso_fam19_*() change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: x86@kernel.org
> CC: linux-kernel@vger.kernel.org
> CC: Borislav Petkov <bp@alien8.de>
> CC: Peter Zijlstra <peterz@infradead.org>
> CC: Josh Poimboeuf <jpoimboe@kernel.org>
> CC: Babu Moger <babu.moger@amd.com>
> CC: David.Kaplan@amd.com
> CC: Nikolay Borisov <nik.borisov@suse.com>
> CC: gregkh@linuxfoundation.org
> CC: Thomas Gleixner <tglx@linutronix.de>
> ---
> arch/x86/include/asm/nospec-branch.h | 4 ++--
> arch/x86/kernel/cpu/bugs.c | 2 +-
> arch/x86/kernel/vmlinux.lds.S | 2 +-
> arch/x86/lib/retpoline.S | 32 ++++++++++++++--------------
> 4 files changed, 20 insertions(+), 20 deletions(-)
>
Re your objtool woes:
> -SYM_START(srso_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE)
> + .skip 64 - (srso_fam17_safe_ret - srso_fam17_untrain_ret), 0xcc
> +SYM_START(srso_fam17_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE)
> ANNOTATE_NOENDBR
> .byte 0x48, 0xb8
>
> /*
> * This forces the function return instruction to speculate into a trap
> - * (UD2 in srso_return_thunk() below). This RET will then mispredict
> + * (UD2 in srso_fam17_return_thunk() below). This RET will then mispredict
> * and execution will continue at the return site read from the top of
> * the stack.
> */
> -SYM_INNER_LABEL(srso_safe_ret, SYM_L_GLOBAL)
> +SYM_INNER_LABEL(srso_fam17_safe_ret, SYM_L_GLOBAL)
Note that there is a mention of 'srso_safe_ret' in
tools/objtool/arch/x86/decode.c:arch_is_embedded_insn() which you
'forgot' to update.
> lea 8(%_ASM_SP), %_ASM_SP
> ret
> int3
> int3
> /* end of movabs */
> lfence
> - call srso_safe_ret
> + call srso_fam17_safe_ret
> ud2
> -SYM_CODE_END(srso_safe_ret)
> -SYM_FUNC_END(srso_untrain_ret)
> -__EXPORT_THUNK(srso_untrain_ret)
> +SYM_CODE_END(srso_fam17_safe_ret)
> +SYM_FUNC_END(srso_fam17_untrain_ret)
> +__EXPORT_THUNK(srso_fam17_untrain_ret)
next prev parent reply other threads:[~2023-09-13 13:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 11:27 [PATCH 0/4] x86/srso: Reduce overhead of the mitigation Andrew Cooper
2023-08-21 11:27 ` [PATCH 1/4] x86/srso: Rename srso_alias_*() to srso_fam19_*() Andrew Cooper
2023-09-13 13:46 ` Borislav Petkov
2023-09-13 14:27 ` Andrew Cooper
2023-09-13 14:46 ` Borislav Petkov
2023-08-21 11:27 ` [PATCH 2/4] x86/srso: Rename fam17 SRSO infrastructure to srso_fam17_*() Andrew Cooper
2023-09-13 13:15 ` Peter Zijlstra [this message]
2023-08-21 11:27 ` [PATCH RFC 3/4] x86/ret-thunk: Support CALL-ing to the ret-thunk Andrew Cooper
2023-08-21 11:27 ` [PATCH RFC 4/4] x86/srso: Use CALL-based return thunks to reduce overhead Andrew Cooper
2023-08-21 15:16 ` Josh Poimboeuf
2023-08-21 23:01 ` Andrew Cooper
2023-08-22 2:22 ` Josh Poimboeuf
2023-08-22 6:45 ` Nikolay Borisov
2023-08-22 22:18 ` Josh Poimboeuf
2023-08-23 6:08 ` Nikolay Borisov
2023-09-13 12:50 ` Peter Zijlstra
2023-09-13 13:17 ` Peter Zijlstra
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=20230913131539.GA22758@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=David.Kaplan@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=gregkh@linuxfoundation.org \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nik.borisov@suse.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®