Re: [BUG][PATCH] arm64: bti: fix BTI to handle local indirect branches

2020-10-06 Thread Ard Biesheuvel
On Tue, 6 Oct 2020 at 11:38, Dave Martin wrote: > > On Mon, Oct 05, 2020 at 02:24:47PM -0500, Jeremy Linton wrote: > > Hi, > > > > On 10/5/20 1:54 PM, Ard Biesheuvel wrote: > > >On Mon, 5 Oct 2020 at 20:18, Jeremy Linton wrote: > > >> > > >>The AES code uses a 'br x7' as part of a function called

Re: [BUG][PATCH] arm64: bti: fix BTI to handle local indirect branches

2020-10-06 Thread Dave Martin
On Mon, Oct 05, 2020 at 02:24:47PM -0500, Jeremy Linton wrote: > Hi, > > On 10/5/20 1:54 PM, Ard Biesheuvel wrote: > >On Mon, 5 Oct 2020 at 20:18, Jeremy Linton wrote: > >> > >>The AES code uses a 'br x7' as part of a function called by > >>a macro, that ends up needing a BTI_J as a target. > > >

Re: [BUG][PATCH] arm64: bti: fix BTI to handle local indirect branches

2020-10-06 Thread kernel test robot
Hi Jeremy, Thank you for the patch! Yet something to improve: [auto build test ERROR on arm64/for-next/core] [also build test ERROR on soc/for-next arm/for-next kvmarm/next v5.9-rc8 next-20201002] [cannot apply to xlnx/master] [If your patch is applied to the wrong git tree, kindly drop us a not

Re: [BUG][PATCH] arm64: bti: fix BTI to handle local indirect branches

2020-10-05 Thread Mark Brown
On Mon, Oct 05, 2020 at 03:10:42PM -0500, Jeremy Linton wrote: > On 10/5/20 2:59 PM, Mark Brown wrote: > > ...this is going to cause problems, SYM_CODE means that we should > > assemble *exactly* what was written since it's some non-standard thing - > > we use it for the vectors table for example.

Re: [BUG][PATCH] arm64: bti: fix BTI to handle local indirect branches

2020-10-05 Thread Jeremy Linton
Hi, On 10/5/20 2:59 PM, Mark Brown wrote: On Mon, Oct 05, 2020 at 01:18:04PM -0500, Jeremy Linton wrote: The AES code uses a 'br x7' as part of a function called by a macro, that ends up needing a BTI_J as a target. Lets define SYN_CODE_START_LOCAL() for this and replace the SYM_FUNC_START_LO

Re: [BUG][PATCH] arm64: bti: fix BTI to handle local indirect branches

2020-10-05 Thread Mark Brown
On Mon, Oct 05, 2020 at 01:18:04PM -0500, Jeremy Linton wrote: > The AES code uses a 'br x7' as part of a function called by > a macro, that ends up needing a BTI_J as a target. Lets > define SYN_CODE_START_LOCAL() for this and replace the > SYM_FUNC_START_LOCAL with a SYM_FUNC_CODE_LOCAL in the A

Re: [BUG][PATCH] arm64: bti: fix BTI to handle local indirect branches

2020-10-05 Thread Jeremy Linton
Hi, On 10/5/20 1:54 PM, Ard Biesheuvel wrote: On Mon, 5 Oct 2020 at 20:18, Jeremy Linton wrote: The AES code uses a 'br x7' as part of a function called by a macro, that ends up needing a BTI_J as a target. Could we instead just drop the tail call, i.e, replace it with a ret and do a 'bl' a

Re: [BUG][PATCH] arm64: bti: fix BTI to handle local indirect branches

2020-10-05 Thread Ard Biesheuvel
On Mon, 5 Oct 2020 at 20:18, Jeremy Linton wrote: > > The AES code uses a 'br x7' as part of a function called by > a macro, that ends up needing a BTI_J as a target. Could we instead just drop the tail call, i.e, replace it with a ret and do a 'bl' after it returns? The indirect call does not re