Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3032604imm; Sun, 1 Jul 2018 10:41:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKInCo4F7r4Bku/rF82REKYluvY18J1KOcLtYg02yAA/LLN+gkOdm1FH5DASjjdaH9803QJm X-Received: by 2002:a17:902:5602:: with SMTP id h2-v6mr23060307pli.314.1530466918016; Sun, 01 Jul 2018 10:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530466917; cv=none; d=google.com; s=arc-20160816; b=fzbnYvPgBhL3KgLGpQb3LVh++6riUbOdBEGvxO+3FZfRfcRKxFu5K2OXjMUTqwSqBj K88KAbFdkZltIhG/KdT+nt9UZ9eiAIyqTlVagW03lW55oPYNJVgIOG08JjRGI9Y611UQ A5Q7tpzrKCuOB826FAcWZzT2sf3PUEfcU7m8dMuJCuNoqug1sUyGPwXXeLJ2a9Kiwdid 0lKgnTm/hSafp+peyVUPcSf+B6GQL2QQbU14XI9GfD0A0xGDBSNW988Z1u5ij4Gwp1zc hek8oXwfaWwYdwGhvj2LrqJnQRQ+HDdV9HqCIX0JFETqdZkEK2InvmTfUTHRMTtDhKda Cmyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ksHAGDNVRcFPFtfTGyNZIlTNEz3xNHWReHPNca+znBk=; b=DArW5If14V6MYcd+XrCWojNROwXlBeB/vl3W6s9axcijb7+SbtFE2iRN1SF9vqKakM b3ahWCIc5TQ3qx2McUbGRPRcv2tHyj1/Zsne9DxBm9A3UxlEV0i9DmiHBAVljL7l50kx 35B85B1+MHwtt50yyd5NQHXxOQpw3J6uSY1Bzo1fWMxaNGNfnLGDXJqcPTWPB0WFUOdT rVLlf+Aovq6MBE6HX5g5WGey/j9uBrFSafo8OaIaIepDGjH6qbyFeveYvAzexVGYlcVK HsSWBF84VDQz7cnAyRAQXfXHOAKM+i6WVWbM69awdPlBipStxL+eRscRRugxhbovzTcS QyhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Frm0CCl8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si14041044pld.424.2018.07.01.10.41.43; Sun, 01 Jul 2018 10:41:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Frm0CCl8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031144AbeGARju (ORCPT + 99 others); Sun, 1 Jul 2018 13:39:50 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:39803 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031133AbeGARjp (ORCPT ); Sun, 1 Jul 2018 13:39:45 -0400 Received: by mail-io0-f196.google.com with SMTP id e13-v6so12764936iof.6 for ; Sun, 01 Jul 2018 10:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ksHAGDNVRcFPFtfTGyNZIlTNEz3xNHWReHPNca+znBk=; b=Frm0CCl8YgcwUHpOtvcn3ychgl+R6e2NghiV9W/kZU3GxvpQeiHuLKNdLUHYVgl7Pr 1/9igwYaSvIJFHtLm37yLpm4wNBySPBVesZ746jHs1clpdM/0ps4VIFhLFxk/1Q31d9t WvOdxOSvMHNiIutcY/EZp0GILMtsPZW7a4Skw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ksHAGDNVRcFPFtfTGyNZIlTNEz3xNHWReHPNca+znBk=; b=pBOzwZJsJY/5RyfWalZQYw3D2kkj/PmYAjzPzFUIm6KeyPgeFUgG8zkQ/6bTIqWXBQ 0OaJxX62/FQL3tb9XsA+LrtvrkamFb4yrmIY+cgT7iDqG0w232URKJI1/BbSKdoapxUj L/ZH2G7I5twpLkk3Rkqvg5GcV9kyruVr/vJr1plXfCJyNqXFPkhefChjq+EnlVtumr01 RK4c75uDVazQ83r61Xvx/vdj/Yt0Jfz1JAozMoleylomrjr4mOjhA1BgiEk3lxnStTY0 6f28SYU1FpABgOjNOl/OBqSPIFL7005NYp+PC2KvEXoQduRbLIpt8Nn3zWKIi+8SVP0l l1Xg== X-Gm-Message-State: APt69E2+9u0JIblxj2BY8pqMtzIDtviGKycHT0fjpck4d/H8ndeWsIuI 9RCy9hMHSFsznitCP6h0sB1hH1ZQW9DeWGVZbofEaw== X-Received: by 2002:a6b:520d:: with SMTP id g13-v6mr19518883iob.60.1530466783927; Sun, 01 Jul 2018 10:39:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bbc7:0:0:0:0:0 with HTTP; Sun, 1 Jul 2018 10:39:43 -0700 (PDT) In-Reply-To: <20180627151510.GE30631@arm.com> References: <20180626182802.19932-1-ard.biesheuvel@linaro.org> <20180627151510.GE30631@arm.com> From: Ard Biesheuvel Date: Sun, 1 Jul 2018 19:39:43 +0200 Message-ID: Subject: Re: [PATCH v9 0/6] add support for relative references in special sections To: Thomas Gleixner , "the arch/x86 maintainers" , Ingo Molnar Cc: Linux Kernel Mailing List , Arnd Bergmann , Kees Cook , Michael Ellerman , Thomas Garnier , "Serge E. Hallyn" , Bjorn Helgaas , Benjamin Herrenschmidt , Russell King , Paul Mackerras , Catalin Marinas , Petr Mladek , James Morris , Andrew Morton , Nicolas Pitre , Josh Poimboeuf , Steven Rostedt , Sergey Senozhatsky , Linus Torvalds , Jessica Yu , linux-arm-kernel , linuxppc-dev , Will Deacon Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27 June 2018 at 17:15, Will Deacon wrote: > Hi Ard, > > On Tue, Jun 26, 2018 at 08:27:55PM +0200, Ard Biesheuvel wrote: >> This adds support for emitting special sections such as initcall arrays, >> PCI fixups and tracepoints as relative references rather than absolute >> references. This reduces the size by 50% on 64-bit architectures, but >> more importantly, it removes the need for carrying relocation metadata >> for these sections in relocatable kernels (e.g., for KASLR) that needs >> to be fixed up at boot time. On arm64, this reduces the vmlinux footprint >> of such a reference by 8x (8 byte absolute reference + 24 byte RELA entry >> vs 4 byte relative reference) >> >> Patch #3 was sent out before as a single patch. This series supersedes >> the previous submission. This version makes relative ksymtab entries >> dependent on the new Kconfig symbol HAVE_ARCH_PREL32_RELOCATIONS rather >> than trying to infer from kbuild test robot replies for which architectures >> it should be blacklisted. >> >> Patch #1 introduces the new Kconfig symbol HAVE_ARCH_PREL32_RELOCATIONS, >> and sets it for the main architectures that are expected to benefit the >> most from this feature, i.e., 64-bit architectures or ones that use >> runtime relocations. >> >> Patch #2 add support for #define'ing __DISABLE_EXPORTS to get rid of >> ksymtab/kcrctab sections in decompressor and EFI stub objects when >> rebuilding existing C files to run in a different context. > > I had a small question on patch 3, but it's really for my understanding. > So, for patches 1-3: > > Reviewed-by: Will Deacon > Thanks all. Thomas, Ingo, Except for the below tweak against patch #3 for powerpc, which may apparently get confused by an input section called .discard without any suffixes, this series is good to go, but requires your ack to proceed, so I would like to ask you to share your comments and/or objections. Also, any suggestions or recommendations regarding the route these patches should take are highly appreciated. Ard. diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 2d9c63f41031..61c844d4ab48 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -287,7 +287,7 @@ unsigned long read_word_at_a_time(const void *addr) * visible to the compiler. */ #define __ADDRESSABLE(sym) \ - static void * __attribute__((section(".discard"), used)) \ + static void * __attribute__((section(".discard.addressable"), used)) \ __PASTE(__addressable_##sym, __LINE__) = (void *)&sym; /**