linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	bcm-kernel-feedback-list@broadcom.com,
	open list <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org, ard.biesheuvel@linaro.org
Subject: Re: [PATCH v3] arm64: Allow user selection of ARM64_MODULE_PLTS
Date: Tue, 18 Jun 2019 10:29:47 +0100	[thread overview]
Message-ID: <20190618092947.GB30899@fuggles.cambridge.arm.com> (raw)
In-Reply-To: <20190617223000.11403-1-f.fainelli@gmail.com>

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 <f.fainelli@gmail.com>
> ---
> 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.deacon@arm.com>

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-06-18  9:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 22:29 [PATCH v3] arm64: Allow user selection of ARM64_MODULE_PLTS Florian Fainelli
2019-06-18  9:29 ` Will Deacon [this message]
2019-06-25  8:29 ` Catalin Marinas
2019-06-26 17:05   ` Florian Fainelli

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=20190618092947.GB30899@fuggles.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=catalin.marinas@arm.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).