From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758608AbdKOW33 (ORCPT ); Wed, 15 Nov 2017 17:29:29 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:42838 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758477AbdKOW3P (ORCPT ); Wed, 15 Nov 2017 17:29:15 -0500 X-Google-Smtp-Source: AGs4zMZ3H3xsX8Yz87TZ2WvVEskbdDftIzlVXd2GhlGINy4Wvi21pnTmOMxMmL0i8Nr1jqHqsrBPdB4wTuekAfdS4ZY= MIME-Version: 1.0 In-Reply-To: <20171115213428.22559-9-samitolvanen@google.com> References: <20171115213428.22559-1-samitolvanen@google.com> <20171115213428.22559-9-samitolvanen@google.com> From: Ard Biesheuvel Date: Wed, 15 Nov 2017 22:29:12 +0000 Message-ID: Subject: Re: [PATCH v2 08/18] arm64: don't disable ADR_PREL_PG_HI21* with ARM64_ERRATUM_843419 To: Sami Tolvanen Cc: Alex Matveev , Andi Kleen , Greg Hackmann , Kees Cook , "linux-arm-kernel@lists.infradead.org" , linux-kbuild@vger.kernel.org, "linux-kernel@vger.kernel.org" , Mark Rutland , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Yury Norov , Matthias Kaehlcke Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15 November 2017 at 21:34, Sami Tolvanen wrote: > CONFIG_LTO_CLANG depends on GNU gold, which can generate ADR_PREL_PG_HI21* > relocations even with --fix-cortex-a53-843419. > > Signed-off-by: Sami Tolvanen > --- > arch/arm64/kernel/module.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c > index f469e0435903..fec9a578f122 100644 > --- a/arch/arm64/kernel/module.c > +++ b/arch/arm64/kernel/module.c > @@ -336,14 +336,12 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, > ovf = reloc_insn_imm(RELOC_OP_PREL, loc, val, 0, 21, > AARCH64_INSN_IMM_ADR); > break; > -#ifndef CONFIG_ARM64_ERRATUM_843419 > case R_AARCH64_ADR_PREL_PG_HI21_NC: > overflow_check = false; > case R_AARCH64_ADR_PREL_PG_HI21: > ovf = reloc_insn_imm(RELOC_OP_PAGE, loc, val, 12, 21, > AARCH64_INSN_IMM_ADR); > break; > -#endif > case R_AARCH64_ADD_ABS_LO12_NC: > case R_AARCH64_LDST8_ABS_LO12_NC: > overflow_check = false; > -- > 2.15.0.448.gf294e3d99a-goog > I think this change is reasonable in itself, but i do wonder how we can ensure that the adrp instructions that GNU gold does generate are not affected by the erratum, given that modules are partially linked object files, not shared libraries. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f193.google.com ([209.85.223.193]:40589 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757211AbdKOW3O (ORCPT ); Wed, 15 Nov 2017 17:29:14 -0500 Received: by mail-io0-f193.google.com with SMTP id 71so3231804ior.7 for ; Wed, 15 Nov 2017 14:29:14 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20171115213428.22559-9-samitolvanen@google.com> References: <20171115213428.22559-1-samitolvanen@google.com> <20171115213428.22559-9-samitolvanen@google.com> From: Ard Biesheuvel Date: Wed, 15 Nov 2017 22:29:12 +0000 Message-ID: Subject: Re: [PATCH v2 08/18] arm64: don't disable ADR_PREL_PG_HI21* with ARM64_ERRATUM_843419 Content-Type: text/plain; charset="UTF-8" Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Sami Tolvanen Cc: Alex Matveev , Andi Kleen , Greg Hackmann , Kees Cook , "linux-arm-kernel@lists.infradead.org" , linux-kbuild@vger.kernel.org, "linux-kernel@vger.kernel.org" , Mark Rutland , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Yury Norov , Matthias Kaehlcke On 15 November 2017 at 21:34, Sami Tolvanen wrote: > CONFIG_LTO_CLANG depends on GNU gold, which can generate ADR_PREL_PG_HI21* > relocations even with --fix-cortex-a53-843419. > > Signed-off-by: Sami Tolvanen > --- > arch/arm64/kernel/module.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c > index f469e0435903..fec9a578f122 100644 > --- a/arch/arm64/kernel/module.c > +++ b/arch/arm64/kernel/module.c > @@ -336,14 +336,12 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, > ovf = reloc_insn_imm(RELOC_OP_PREL, loc, val, 0, 21, > AARCH64_INSN_IMM_ADR); > break; > -#ifndef CONFIG_ARM64_ERRATUM_843419 > case R_AARCH64_ADR_PREL_PG_HI21_NC: > overflow_check = false; > case R_AARCH64_ADR_PREL_PG_HI21: > ovf = reloc_insn_imm(RELOC_OP_PAGE, loc, val, 12, 21, > AARCH64_INSN_IMM_ADR); > break; > -#endif > case R_AARCH64_ADD_ABS_LO12_NC: > case R_AARCH64_LDST8_ABS_LO12_NC: > overflow_check = false; > -- > 2.15.0.448.gf294e3d99a-goog > I think this change is reasonable in itself, but i do wonder how we can ensure that the adrp instructions that GNU gold does generate are not affected by the erratum, given that modules are partially linked object files, not shared libraries. From mboxrd@z Thu Jan 1 00:00:00 1970 From: ard.biesheuvel@linaro.org (Ard Biesheuvel) Date: Wed, 15 Nov 2017 22:29:12 +0000 Subject: [PATCH v2 08/18] arm64: don't disable ADR_PREL_PG_HI21* with ARM64_ERRATUM_843419 In-Reply-To: <20171115213428.22559-9-samitolvanen@google.com> References: <20171115213428.22559-1-samitolvanen@google.com> <20171115213428.22559-9-samitolvanen@google.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 15 November 2017 at 21:34, Sami Tolvanen wrote: > CONFIG_LTO_CLANG depends on GNU gold, which can generate ADR_PREL_PG_HI21* > relocations even with --fix-cortex-a53-843419. > > Signed-off-by: Sami Tolvanen > --- > arch/arm64/kernel/module.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c > index f469e0435903..fec9a578f122 100644 > --- a/arch/arm64/kernel/module.c > +++ b/arch/arm64/kernel/module.c > @@ -336,14 +336,12 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, > ovf = reloc_insn_imm(RELOC_OP_PREL, loc, val, 0, 21, > AARCH64_INSN_IMM_ADR); > break; > -#ifndef CONFIG_ARM64_ERRATUM_843419 > case R_AARCH64_ADR_PREL_PG_HI21_NC: > overflow_check = false; > case R_AARCH64_ADR_PREL_PG_HI21: > ovf = reloc_insn_imm(RELOC_OP_PAGE, loc, val, 12, 21, > AARCH64_INSN_IMM_ADR); > break; > -#endif > case R_AARCH64_ADD_ABS_LO12_NC: > case R_AARCH64_LDST8_ABS_LO12_NC: > overflow_check = false; > -- > 2.15.0.448.gf294e3d99a-goog > I think this change is reasonable in itself, but i do wonder how we can ensure that the adrp instructions that GNU gold does generate are not affected by the erratum, given that modules are partially linked object files, not shared libraries.