lkml.org 
[lkml]   [2020]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 11/15] arm64: efi: restore x18 if it was corrupted
On Thu, Jan 16, 2020 at 9:45 AM Will Deacon <will@kernel.org> wrote:
>
> On Fri, Dec 06, 2019 at 02:13:47PM -0800, Sami Tolvanen wrote:
> > -0: b efi_handle_corrupted_x18 // tail call
> > +0:
> > +#ifdef CONFIG_SHADOW_CALL_STACK
> > + /*
> > + * Restore x18 before returning to instrumented code. This is
> > + * safe because the wrapper is called with preemption disabled and
> > + * a separate shadow stack is used for interrupts.
> > + */
> > + mov x18, x2
> > +#endif
>
> Why not restore it regardless of CONFIG_SHADOW_CALL_STACK?

The ifdefs are here only because restoring the register without SCS
isn't actually necessary, but I'm fine with dropping them (and editing
the comment) in the next version if you prefer.

Sami

\
 
 \ /
  Last update: 2020-01-16 21:37    [W:0.259 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site