Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2836922ybi; Mon, 17 Jun 2019 11:11:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5SyEbVptjsoWsABu8gwdeO/VThCs7Uck1RnaHydZR6a8UCU23tFEC4R247OZUMu3tdNBq X-Received: by 2002:a62:1ac8:: with SMTP id a191mr53436045pfa.164.1560795088638; Mon, 17 Jun 2019 11:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560795088; cv=none; d=google.com; s=arc-20160816; b=bUROjWW0Jy1cJJ2NEcqlQbpZxXd80mPrJYU5gh0+Fr62yMIoo1qBwpd5k/6ln+e833 ZmG9k2qZpd25JtjB30FqNai+XqwF8MOW+HfX6iPiGV/xD7TCjn/uNHsjEEEuDPWKhgTY Ec9bBCB+itc9W9h4RXjDDcaYUb9Qkx8+OphB/pdhxy3oCGywb9y13iP4U3E2/Ru2alzL dX0JhKNzglzypbi+8ZikWwsG1iTEiBWH2/VJB/6FG0ZMk8mv6q//mp6CDqhkvt2MidBA mP5lLsD6AgClP5ZQOVTxJftqufPLd7yAzEVQQ+E1cPjIWL4wVmFE1mcdxrc2P5ufFCTV /YGA== 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:dkim-signature; bh=YwiG5QtG+wvVvuclSWSBDPGEu9iN43zpVlz7FdR3uV8=; b=oOK70lTkGe/ndTLOcDjx5yPx6mcDTsrWz/RoveAvMxYIPVouqWMjxPheuJ45auLvpM T/L5TAVdaTj5/zY156awtckfxGwKZqNkJ8wYKNhQn3yIdd4CsUOlf35suGWJrtKY5hhW RPAA9SBBXTtMLdreydKTWPJiAQ1YsVrHaISy2DlCPzPM39zINaSOjHuJsTtjERxPHdRB g5aRHLbLW3nf16tZ1PJNJqdV1D5iTIMw7Ia//KTY2r5cLpeOYS2Z4nQoIOZ+9qaGNQsu xxDdiH+Hdpe2lu8ZWJlnFqUt2cBdH+TT/ZoT1LB5cxn8bNfzQZGm56pyccnvAkJVl+hD UwPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jcI1FxBB; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22si11507817pgb.292.2019.06.17.11.11.13; Mon, 17 Jun 2019 11:11:28 -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=@kernel.org header.s=default header.b=jcI1FxBB; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726797AbfFQSKv (ORCPT + 99 others); Mon, 17 Jun 2019 14:10:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:45034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726091AbfFQSKu (ORCPT ); Mon, 17 Jun 2019 14:10:50 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7D42B208C0; Mon, 17 Jun 2019 18:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560795049; bh=FUMyawJcKwbgBq1KBzfgBo/OSPZ3Ne48mCmHGmTnYa8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jcI1FxBBGA3pU+DeRfee97d7nwghNbUJ6glZCY9nO2A6deGImGozosVBQuYy2Zyib /Y+MS2INO9y8v/NC+3rITV+N5RU/Sk/Wwq4E0EcQOtX8bBHgj2aWC3Qf7ZiPH+rQQD y0J4qJyt6ukMIvBjxb0fTHJe3Wa81NjhSgw9XkyY= Date: Mon, 17 Jun 2019 19:10:45 +0100 From: Will Deacon To: Florian Fainelli Cc: Will Deacon , linux-arm-kernel@vger.kernel.org, bcm-kernel-feedback-list@Broadcom.com, ard.biesheuvel@linaro.org, Catalin Marinas , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , open list Subject: Re: [PATCH] arm64: Allow user selection of ARM64_MODULE_PLTS Message-ID: <20190617181045.fekodnky6un4i723@willie-the-truck> References: <20190614025932.533-1-f.fainelli@gmail.com> <20190617173241.GM30800@fuggles.cambridge.arm.com> <2624ce8b-0206-a217-8793-c1223178246c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2624ce8b-0206-a217-8793-c1223178246c@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) 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 11:03:28AM -0700, Florian Fainelli wrote: > On 6/17/19 10:32 AM, Will Deacon wrote: > > On Thu, Jun 13, 2019 at 07:59:32PM -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. > >> > >> Signed-off-by: Florian Fainelli > >> --- > >> arch/arm64/Kconfig | 14 +++++++++++++- > >> 1 file changed, 13 insertions(+), 1 deletion(-) > >> > >> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > >> index 697ea0510729..36befe987b73 100644 > >> --- a/arch/arm64/Kconfig > >> +++ b/arch/arm64/Kconfig > >> @@ -1418,8 +1418,20 @@ 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. The modules will use slightly more memory, but after > >> + rounding up to page size, the actual memory footprint is usually > >> + the same. > > > > Isn't the worry really about the runtime performance overhead introduced > > by the veneers, as opposed to the memory usage of the module? > > The main concern is indeed runtime performance (both added veneers and > possibly increased cache trashing) and second could be the increased > vmalloc usage. Do you want me to rephrase that part, or drop it? Whichever you prefer. > > > >> + Disabling this is usually safe for small single-platform > >> + configurations. If unsure, say y. > > > > So should this be on by default? > > It is turned on under certain conditions that require it (v2 makes that > clearer, based on Ard's feedback), having it turned off by default at > least makes people realize (or rather can be used as argument) that the > modules are possibly too big. > > Under certain build configurations like test/manufacturing, you might > have a set of large modules that should still load, hence this patch. I'm fine with leaving it default off, but then let's not say "If unsure, say y". In fact, you can remove that whole "disabling this is usually safe" part I reckon. Will