Messages in this thread | | | Date | Mon, 21 Aug 2023 08:16:36 -0700 | From | Josh Poimboeuf <> | Subject | Re: [PATCH RFC 4/4] x86/srso: Use CALL-based return thunks to reduce overhead |
| |
On Mon, Aug 21, 2023 at 12:27:23PM +0100, Andrew Cooper wrote: > The SRSO safety depends on having a CALL to an {ADD,LEA}/RET sequence which > has been made safe in the BTB. Specifically, there needs to be no pertubance > to the RAS between a correctly predicted CALL and the subsequent RET. > > Use the new infrastructure to CALL to a return thunk. Remove > srso_fam1?_safe_ret() symbols and point srso_fam1?_return_thunk(). > > This removes one taken branch from every function return, which will reduce > the overhead of the mitigation. It also removes one of three moving pieces > from the SRSO mess.
So, the address of whatever instruction comes after the 'CALL srso_*_return_thunk' is added to the RSB/RAS, and that might be speculated to when the thunk returns. Is that a concern?
> 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> > > RFC: > > vmlinux.o: warning: objtool: srso_fam17_return_thunk(): can't find starting instruction > > Any objtool whisperers know what's going on, and particularly why > srso_fam19_return_thunk() appears to be happy? > > Also, depends on the resolution of the RFC in the previous patch.
I can take a look.
-- Josh
| |