Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3543355ybi; Tue, 18 Jun 2019 02:30:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGVIatvungko/iRC5N1fs2u+ttftU3ihNBJADz8J/LgYsbKUnWPLBnTLsFA6TphMhUwBI/ X-Received: by 2002:a63:445b:: with SMTP id t27mr1787249pgk.56.1560850251027; Tue, 18 Jun 2019 02:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560850251; cv=none; d=google.com; s=arc-20160816; b=u7Zj75nzL103fKnCGjaOn0p1PMftLT5GtlXd+Dqxea4tSVuye/AKRZvcH9inU+rveu 5tbUmZ2pKEvetmh95g7vMdxZrLe2wo1NrKeKD7DxiceSfwBLkEFzDGLr4uAw4U5c7m39 DBwzkhHi8k1ginvNaCmTownX18PMZ0VC8l0w9PRH4SNdRxSpHmwdE36iNhkpKB3fDGzx CCbw6LyCdNNT9CHZGon60UEXxQFNdqyt5LOOa1DuIoglLo1ZT0zqAHI+l1Z+pLw42BUC 85XztbcHDwamK8kD+hHOFRoHI0mfV0evnMZKXw79a8Ek+7xAkUMKSa2Q6rRX3p0GAAnl 2mkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=HuoCDqRfaE+JWqPUrGCdRUo52jSH3ijBst1Gbzdyj/0=; b=syIMHI0nq3MNao0dPCbM7HY97Bq8cuWULXoepX/elX14VtCok2i59GJPr7xFBQt32c Y1hza1y6QnANaTjH7WUBp8I4xjOGMoBGvBn8JmNBcasSFLjmvT/s4bGxejxg98WgXBzR lHzYkyYpp7sLdkiGSl1tZg6946E8PS0tN89LLWxDeBJOGi6wXYCBPqvfE96eQewnCZdF TnKmU39exj6VmT3OKdOc+LmYcPtyHkYmV653TkV60zlYW+/KcZvkloqL4Kt754NtHaIn cbZUVEKmj1ojnzYWoOjEYtIwBtdC65KL8YM3dRCgxwVOKJ5/5QUl4EUx/5DUM4lyg95n nRSw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14si13194886pgh.128.2019.06.18.02.30.32; Tue, 18 Jun 2019 02:30:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729450AbfFRJ3v (ORCPT + 99 others); Tue, 18 Jun 2019 05:29:51 -0400 Received: from foss.arm.com ([217.140.110.172]:59424 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729207AbfFRJ3u (ORCPT ); Tue, 18 Jun 2019 05:29:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 613AA344; Tue, 18 Jun 2019 02:29:50 -0700 (PDT) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 764523F246; Tue, 18 Jun 2019 02:29:49 -0700 (PDT) Date: Tue, 18 Jun 2019 10:29:47 +0100 From: Will Deacon To: Florian Fainelli Cc: linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, ard.biesheuvel@linaro.org, Catalin Marinas , open list Subject: Re: [PATCH v3] arm64: Allow user selection of ARM64_MODULE_PLTS Message-ID: <20190618092947.GB30899@fuggles.cambridge.arm.com> References: <20190617223000.11403-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190617223000.11403-1-f.fainelli@gmail.com> User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 17, 2019 at 03:29:59PM -0700, Florian Fainelli wrote: > Make ARM64_MODULE_PLTS a selectable Kconfig symbol, since some people > might have very big modules spilling out of the dedicated module area > into vmalloc. Help text is copied from the ARM 32-bit counterpart and > modified to a mention of KASLR and specific ARM errata workaround(s). > > Signed-off-by: Florian Fainelli > --- > Changes in v3: > - take out the part about "The modules will use slightly more memory, but after > rounding up to page size, the actual memory footprint is usually the same. > - take out the "If unusure say Y", since we would really prefer this to > be off by default for maximum performance > > Changes in v2: > > - added Ard's paragraph about KASLR > - added a paragraph about specific workarounds also requiring > ARM64_MODULE_PLTS > > arch/arm64/Kconfig | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 697ea0510729..9206feaeff07 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -1418,8 +1418,26 @@ config ARM64_SVE > KVM in the same kernel image. > > config ARM64_MODULE_PLTS > - bool > + bool "Use PLTs to allow module memory to spill over into vmalloc area" > select HAVE_MOD_ARCH_SPECIFIC > + help > + Allocate PLTs when loading modules so that jumps and calls whose > + targets are too far away for their relative offsets to be encoded > + in the instructions themselves can be bounced via veneers in the > + module's PLT. This allows modules to be allocated in the generic > + vmalloc area after the dedicated module memory area has been > + exhausted. > + > + When running with address space randomization (KASLR), the module > + region itself may be too far away for ordinary relative jumps and > + calls, and so in that case, module PLTs are required and cannot be > + disabled. > + > + Specific errata workaround(s) might also force module PLTs to be > + enabled (ARM64_ERRATUM_843419). > + > + Disabling this is usually safe for small single-platform > + configurations. I think I'd still drop this last sentence, because labelling a kernel "usually safe" without this option is a bit OTT. We'll just reject large modules, nothing unsafe about that. Assuming Catalin can do that when he applies, so: Acked-by: Will Deacon Will