public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: will.deacon@arm•com (Will Deacon)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v4 5/5] arm64/kernel: enable A53 erratum #8434319 handling at runtime
Date: Thu, 8 Mar 2018 13:48:21 +0000	[thread overview]
Message-ID: <20180308134820.GB18452@arm.com> (raw)
In-Reply-To: <CAKv+Gu8FbZURQTxNFjBLRbwgnOWvWdN6+exZhm5d7CJGdKm-Bg@mail.gmail.com>

On Thu, Mar 08, 2018 at 01:47:26PM +0000, Ard Biesheuvel wrote:
> On 8 March 2018 at 13:46, Ard Biesheuvel <ard.biesheuvel@linaro•org> wrote:
> > On 8 March 2018 at 13:45, Will Deacon <will.deacon@arm•com> wrote:
> >> On Tue, Mar 06, 2018 at 05:15:35PM +0000, Ard Biesheuvel wrote:
> >>> Omit patching of ADRP instruction at module load time if the current
> >>> CPUs are not susceptible to the erratum.
> >>
> >> [...]
> >>
> >>> diff --git a/arch/arm64/kernel/module-plts.c b/arch/arm64/kernel/module-plts.c
> >>> index 534bf1d47119..1a583ccace00 100644
> >>> --- a/arch/arm64/kernel/module-plts.c
> >>> +++ b/arch/arm64/kernel/module-plts.c
> >>> @@ -158,7 +158,8 @@ static unsigned int count_plts(Elf64_Sym *syms, Elf64_Rela *rela, int num,
> >>>                       break;
> >>>               case R_AARCH64_ADR_PREL_PG_HI21_NC:
> >>>               case R_AARCH64_ADR_PREL_PG_HI21:
> >>> -                     if (!IS_ENABLED(CONFIG_ARM64_ERRATUM_843419))
> >>> +                     if (!IS_ENABLED(CONFIG_ARM64_ERRATUM_843419) ||
> >>> +                         !cpus_have_const_cap(ARM64_WORKAROUND_843419))
> >>>                               break;
> >>>
> >>>                       /*
> >>> diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c
> >>> index 89217704944e..47b40aaa1a5d 100644
> >>> --- a/arch/arm64/kernel/module.c
> >>> +++ b/arch/arm64/kernel/module.c
> >>> @@ -201,6 +201,7 @@ static int reloc_insn_imm(enum aarch64_reloc_op op, __le32 *place, u64 val,
> >>>  static int reloc_insn_adrp(struct module *mod, __le32 *place, u64 val)
> >>>  {
> >>>       if (!IS_ENABLED(CONFIG_ARM64_ERRATUM_843419) ||
> >>> +         !cpus_have_const_cap(ARM64_WORKAROUND_843419) ||
> >>
> >> Mind if I drop the IS_ENABLED check here and in the hunk above? The
> >> const_cap check along should be sufficient, no?
> >>
> >
> > Without the IS_ENABLED() check, the code will always be present in the
> > object file.
> >
> > I have no strong preference either way, though.
> 
> Ehm, strike that. You will probably hit a linker error if you drop it,
> because some dependent functions are #ifdef'ed out if the erratum
> workaround is disabled.

Ah, ok then. Thanks for the quick response.

Will

  reply	other threads:[~2018-03-08 13:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06 17:15 [PATCH v4 0/5] arm64/kernel: get rid of GCC large model code Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 1/5] arm64: module: don't BUG when exceeding preallocated PLT count Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 2/5] arm64/kernel: kaslr: reduce module randomization range to 4 GB Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 3/5] arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419 Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 4/5] arm64/errata: add REVIDR handling to framework Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 5/5] arm64/kernel: enable A53 erratum #8434319 handling at runtime Ard Biesheuvel
2018-03-08 13:45   ` Will Deacon
2018-03-08 13:46     ` Ard Biesheuvel
2018-03-08 13:47       ` Ard Biesheuvel
2018-03-08 13:48         ` Will Deacon [this message]
2018-03-08 13:49       ` Mark Rutland
2018-03-08 13:54         ` Ard Biesheuvel
2018-03-08 13:59           ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180308134820.GB18452@arm.com \
    --to=will.deacon@arm$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox