From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936308AbdKPWO1 (ORCPT ); Thu, 16 Nov 2017 17:14:27 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:41284 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936057AbdKPWOS (ORCPT ); Thu, 16 Nov 2017 17:14:18 -0500 X-Google-Smtp-Source: AGs4zMZDeSyygfuqTnjW4+kn0uSsqEu2FB37Fe5Ih3by3Ar727eGFtouRkM1F21G/kbMNCFnoLICEvnmIjuH7D4XVcI= MIME-Version: 1.0 In-Reply-To: <20171116213702.GA10616@samitolvanen.mtv.corp.google.com> References: <20171115213428.22559-1-samitolvanen@google.com> <20171115213428.22559-9-samitolvanen@google.com> <20171116114406.GB9361@arm.com> <20171116163132.GC94341@samitolvanen.mtv.corp.google.com> <20171116213702.GA10616@samitolvanen.mtv.corp.google.com> From: Ard Biesheuvel Date: Thu, 16 Nov 2017 22:14:17 +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: Will Deacon , Mark Rutland , Andi Kleen , Kees Cook , linux-kbuild@vger.kernel.org, Nick Desaulniers , "linux-kernel@vger.kernel.org" , Greg Hackmann , Masahiro Yamada , Michal Marek , Yury Norov , Alex Matveev , Matthias Kaehlcke , "linux-arm-kernel@lists.infradead.org" , Maxim Kuvyrkov 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 16 November 2017 at 21:37, Sami Tolvanen wrote: > On Thu, Nov 16, 2017 at 04:34:03PM +0000, Ard Biesheuvel wrote: >> You still have not explained to us how GOLD avoids the erratum. > > Sorry, I didn't realize you were asking that. If gold spots erratum > sequences, looks like it creates stubs to break them up: > > https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/aarch64.cc#l8396 > > It also attempts to optimize the code by replacing adrps in these > sequences with adr where possible, but otherwise doesn't appear to > touch them: > > https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/aarch64.cc#l2053 > OK, so my concern here is that this code probably only operates on fully linked binaries, and not partially linked object files like kernel modules. The same applies to ld.bfd, which is why we need to use the large module instead of a code model that may emit adrp instructions.. What is preventing us from using the large model with clang? I know it uses movk/movz pairs rather than literals, but this shouldn't matter for modules, given that we support static ELF relocations.