[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230913131539.GA22758@noisy.programming.kicks-ass.net>
Date: Wed, 13 Sep 2023 15:15:39 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Andrew Cooper <andrew.cooper3@...rix.com>
Cc: LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Borislav Petkov <bp@...en8.de>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Babu Moger <babu.moger@....com>, David.Kaplan@....com,
Nikolay Borisov <nik.borisov@...e.com>,
gregkh@...uxfoundation.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 2/4] x86/srso: Rename fam17 SRSO infrastructure to
srso_fam17_*()
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@...rix.com>
> ---
> CC: x86@...nel.org
> CC: linux-kernel@...r.kernel.org
> CC: Borislav Petkov <bp@...en8.de>
> CC: Peter Zijlstra <peterz@...radead.org>
> CC: Josh Poimboeuf <jpoimboe@...nel.org>
> CC: Babu Moger <babu.moger@....com>
> CC: David.Kaplan@....com
> CC: Nikolay Borisov <nik.borisov@...e.com>
> CC: gregkh@...uxfoundation.org
> CC: Thomas Gleixner <tglx@...utronix.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)
Powered by blists - more mailing lists