Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3050890ybi; Mon, 17 Jun 2019 15:31:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTTUGGxbeZvVJAJaEG5YZupMYeQsTVDHY1MS0mcMP6zyweFBXPnQ9QdeLDrXAYD632WmFr X-Received: by 2002:a62:1a8e:: with SMTP id a136mr77348762pfa.22.1560810673113; Mon, 17 Jun 2019 15:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560810673; cv=none; d=google.com; s=arc-20160816; b=08FIqIj5O5tK+iOmme4/RZuIH76slcGFSPeKkNtCHFu1GPOuCcjZLpJOvEfq1Hc66j mKzZoWxxnvqldROy0W39oybbQnebKrhhBQpysQ2pZHcY2YyEYnPcH6dZ7br2xC6BluDY UsNLebvSA47Hw/reSc5VhMGVtU5yTJ5iJg11mX8Wlr6H+dbSzk0b7R67jVAKDP7ea8sD a2u8bOt7iCPb1W4vzZ/99uxSQSyNVlk0qUMi8Wf3x4p4Hx/GErlN++n85oorJxRHiU5W ol5KH6LxMRnZusfVqflL91Jt7ww5JG+NTq/ourN0Uu0g4cO7esoA7Qy4oCbe1JNAQVKo WS7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=EmgnUawf35aS/COYEiBvR/oQX1TKluh8z6aoSb2xf0o=; b=dW1RacrmHoRz1l0uMxKMu6o3d5ATOY/5lwtraMR0WILn48jVbmN3kP6dGG3aMW0RXs NKy57LnZZQ9wyEfPRAdgKfecojsKiK3dkozjXum0VBvPbRNm9Ay6ArFaL5EdElzLmgSA +peUWEyHW6F30IgfC56m08qkW32NUdPaHf7NvrYjMlNAjZXRYgMYuqpnHgXNRAcmw5M+ SwjijodAQHXHp4jr4qAVLzWyKpfH8kz6AS5W0dpsj4wDzffVAmd+icDhexK0J8nAFFSJ Pz38ungEFmT4UFz6Luouw6vX1jipRqLlcgG6rXVJbi55d0w0Ver/Hk1JYPR2+ruIyVGb VKPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gLFgFtlV; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si11339341pfo.138.2019.06.17.15.30.57; Mon, 17 Jun 2019 15:31:13 -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=@gmail.com header.s=20161025 header.b=gLFgFtlV; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728368AbfFQWaN (ORCPT + 99 others); Mon, 17 Jun 2019 18:30:13 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46287 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfFQWaM (ORCPT ); Mon, 17 Jun 2019 18:30:12 -0400 Received: by mail-wr1-f66.google.com with SMTP id n4so11691958wrw.13 for ; Mon, 17 Jun 2019 15:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EmgnUawf35aS/COYEiBvR/oQX1TKluh8z6aoSb2xf0o=; b=gLFgFtlVcDKfDN8uDdSejzgX1wovCYMzQtr78f8oiPm6oQDbxTudonvxj9toElDTVN /hOio1Gpja0hS3ADxE+jpsqBjl0MNIcbcw3Fy/u32FIoFfAY43c32gLHv+On0eYSMWWX twdOXUOZvLtZYXXrWYiqMsRJ/0RA+uZSTCTswq2GX30X/PLSuU0FEfFA58X4MRc6bfkM nS2ZBXs6CbBWIGi2TgL3aDKvqQNrkn3bBfYNeP+GvsmYzKsJvwGmYmn8n5olXWphtEzv kwsS7pUgJ35F/oZmpo+HvdGzP+PFjxx2oZ8oN7OIcvErHLDNEctW6oyXLsYkfClU3vs0 N5Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EmgnUawf35aS/COYEiBvR/oQX1TKluh8z6aoSb2xf0o=; b=oTsUGtddP1FI0ctp0uC/W0GlD3jaaypxrzVEEl1eMUAdYwFoDg+f6CjenHrmYe/g5u wMzDPulra20He5iPAQa3BisvHbMOXQHv1kxbORAyGRJ9xHfWzAcrR4DXD+Cqsnq22qsc ZBqvmPBK+UN/8AnFrketWSMnvOBl76iwcay8Y/9akgly4nXuKeCKguEc+kaSFfvBbjOP 9t26sXva0bokJEMp2nLieavnoDVH4HUZuaDBvOhDLf7YMi95vyJ0IhCdeEtVPawOQnfU 5nrXXh7reR9S3eZ3KCLhNoSbeIXE1W/oKgc0cBojLP490A2Au+BLJ3jOLC1Uz+cAsevl ousQ== X-Gm-Message-State: APjAAAXS/CPNro3pwt2qrHmfk60zNuQTGV/cXJdLZ2OzNUIME5K4FCq7 ih8eXa/6//I+W5hCovjWSfV28Sth X-Received: by 2002:adf:e691:: with SMTP id r17mr24374353wrm.67.1560810610247; Mon, 17 Jun 2019 15:30:10 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id v204sm501312wma.20.2019.06.17.15.30.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 17 Jun 2019 15:30:09 -0700 (PDT) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Cc: bcm-kernel-feedback-list@broadcom.com, ard.biesheuvel@linaro.org, Florian Fainelli , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3] arm64: Allow user selection of ARM64_MODULE_PLTS Date: Mon, 17 Jun 2019 15:29:59 -0700 Message-Id: <20190617223000.11403-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. config ARM64_PSEUDO_NMI bool "Support for NMI-like interrupts" -- 2.17.1