Re: [PATCH 4.4] Revert "crypto: arm64/sha - avoid non-standard inline asm tricks"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 7, 2020 at 11:29 AM Ard Biesheuvel <ardb@xxxxxxxxxx> wrote:
>
> On Mon, 7 Dec 2020 at 19:08, dann frazier <dann.frazier@xxxxxxxxxxxxx> wrote:
> >
> > On Mon, Dec 7, 2020 at 10:50 AM Ard Biesheuvel <ardb@xxxxxxxxxx> wrote:
> > >
> > > On Mon, 7 Dec 2020 at 18:26, dann frazier <dann.frazier@xxxxxxxxxxxxx> wrote:
> > > >
> > > > This reverts commit c042dd600f4e89b6e7bdffa00aea4d1d3c1e9686.
> > > >
> > > > This caused the build to emit ADR_PREL_PG_HI21 relocations in the sha{1,2}_ce
> > > > modules. This relocation type is not supported by the linux-4.4.y kernel
> > > > module loader when CONFIG_ARM64_ERRATUM_843419=y, which we have enabled, so
> > > > these modules now fail to load:
> > > >
> > > >   [   37.866250] module sha1_ce: unsupported RELA relocation: 275
> > > >
> > > > This issue does not exist with the backport to 4.9+. Bisection shows that
> > > > this is due to those kernels also having a backport of
> > > > commit 41c066f ("arm64: assembler: make adr_l work in modules under KASLR")
> > >
> > > Hi Dann,
> > >
> > > Would it be an option to backport 41c066f as well?
> >
> > Hi Ard,
> >
> > That was attempted before, but caused a build failure which would
> > still happen today:
> >   https://www.spinics.net/lists/stable/msg179709.html
> > Specifically, head.S still has a 3 argument usage of adr_l. I'm not
> > sure how to safely fix that up myself.
> >
>
> Given that the original reason for reverting the backport of 41c066f
> no longer holds (as there are other users of adr_l in v4.4 now), I
> think the best solution is to backport it again, but with the hunk
> below folded in. (This just replaces the macro invocation with its
> output when called with the 3 arguments in question, so the generated
> code is identical)
>
> --- a/arch/arm64/kernel/head.S
> +++ b/arch/arm64/kernel/head.S
> @@ -424,7 +424,8 @@ __mmap_switched:
>         str     xzr, [x6], #8                   // Clear BSS
>         b       1b
>  2:
> -       adr_l   sp, initial_sp, x4
> +       adrp    x4, initial_sp
> +       add     sp, x4, :lo12:initial_sp
>         str_l   x21, __fdt_pointer, x5          // Save FDT pointer
>         str_l   x24, memstart_addr, x6          // Save PHYS_OFFSET
>         mov     x29, #0

Thanks Ard - that works. I'll follow-up with a backport patch.

  -dann



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux