Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp354712pxb; Wed, 27 Oct 2021 04:20:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLNSOx/eZFkwffEDiFEJFrSTbOQz/tPSh/i1AAgzJ7kBoFLYJ5mAVF60IK4egBNwYn76YM X-Received: by 2002:a17:90b:3504:: with SMTP id ls4mr5138555pjb.111.1635333651772; Wed, 27 Oct 2021 04:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635333651; cv=none; d=google.com; s=arc-20160816; b=i66M9lsdJT+Kbtr61L7Ed52LcLwX2H6XeEHzDTCwqtTnI3kkkvu2cb3UP/LqPOVrEJ tdFgecCfsQLVT0K5OKJgDCYDjjt9SlLyXbvkYTtlrCvs+Cs950e/2elq69gRRrrfzZjQ 3Aip2fEv+6tLHpA9NM85J45kND5LN2jv40E5qBpTQG4Sq3wIwad+c/9CSut+YrEyI4TR H3OidTX3HyX9y9nsiBWuv44KtdLcrIxSQfgZO0kZxPBkAB2CtNGVeGn4MU8GxBXkZFCQ 8ZonFKKbPVYdi6JMm7LzGW6qNU4Wz46f1Kyi578u7Du/YE5MgjU8IWparCo8F8xy5sGi WLew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:cc:content-transfer-encoding :mime-version:message-id:date:subject:dkim-signature; bh=/rggbZqE5Rg53L9CWqTqFtP/omYvr2W+TYTAvnb1AJ8=; b=dsxQ4XmQhGilasp3Tn9HkxVa5OdY4FeslQeKwJgNmQ9aA1SnJrSdDDnE6aBy/uzLIR FvBs8yqkKCTHlu6wm39GX0mT+ZCNvrXyRXCHAJvKKE9E3BbiJCro37XrqJg/SFEktgYL RGoAZhTp5T9BFCnqTYqb8IwKBYQVyIWN+Ha28AOKXU7il7IeIh4bXfcHNdBNN9uzqTQ1 +bwaM6sIwIbM2XC2/MS2rUdnYMhCwokb0Xhwc3o6vQI/CjHf8QLKqP0gOXG6EkYv0Dx8 YvVjnKPRhRAe4frBtUaMdLhb4kNzK7fppSFO85+iWlhLTTU/Bl8qdJANqZp/P87xLxbH ZtNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=YYG5EFTo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u190si16139485pgd.420.2021.10.27.04.20.35; Wed, 27 Oct 2021 04:20:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=YYG5EFTo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239625AbhJZVbw (ORCPT + 99 others); Tue, 26 Oct 2021 17:31:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239631AbhJZVbn (ORCPT ); Tue, 26 Oct 2021 17:31:43 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F400C061570 for ; Tue, 26 Oct 2021 14:29:19 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id nn3-20020a17090b38c300b001a03bb6c4ebso516000pjb.1 for ; Tue, 26 Oct 2021 14:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=subject:date:message-id:mime-version:content-transfer-encoding:cc :from:to; bh=/rggbZqE5Rg53L9CWqTqFtP/omYvr2W+TYTAvnb1AJ8=; b=YYG5EFToI18HDvmKWoho9CXqxrIukv1G1OFNYY7ppapxl2/8Qo6w76wNNlYQDtC+PH TZOAyFHdjelYBkK6ckpXQQWWCZz+dDOnjlTyW/a/7Cgn5ZeD4Wo9EnQ4wYbrTM+TwZGt VdchOWOBKXov5bGwJoJYJj1RdL2T6CTIL4+qcO/Zugr18t/cSkHeutn/SgbFOov4y/ke kyrSvrGNgK9tdLyVrSPBvVaQKliTli0ymqtDxN6yRXPQIdeU92fndygK/utjZ/S6Mowi 6RMVeobFGLbDeGUzBo4oeEaEdxULO5U3Y7J1wNDAphiHC/x8scm8cR5FW4oiI2Y2maHf zdCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:date:message-id:mime-version :content-transfer-encoding:cc:from:to; bh=/rggbZqE5Rg53L9CWqTqFtP/omYvr2W+TYTAvnb1AJ8=; b=5QRyNA2xCSRcTYRu5SteS1NSa6KCFQBLZVjR8WpL6YRjx9oL+L7cTRmJHVqUw+FLgC 8kdNpIQJ7EVwLMPnqk6GPHJKNQ/ItiIqKKalSUfcsPkqb4MgPLS7G3JMfh3keQjP9Gf6 YJsVTsexv3gZmPVpwrBx6BWBtrfZyKqPKM0a+xkZjFBI5LHQrOFboG+3DrAwYMIIzq+7 qQwcqtyHZalx3zym2ryste4sCRyHmHczwKXyU/k9q/UqstpswSt2zN6gR12/fazyRIcS vcHf0UwtSX2b94kg1S/9gh3gkmG/rKTdguaXDm3x5Vof9HPsLhIVHHvZ3bKeteZ0Iky9 kqTw== X-Gm-Message-State: AOAM5309aicDMEPCXZQ+smvpKz02Osxm6ghIjY4dnTVIGdzPRsOZGEZa 2KVhAxpOOh+t3w/wA2+YhwcuUQ== X-Received: by 2002:a17:902:8b81:b0:13f:3d30:f624 with SMTP id ay1-20020a1709028b8100b0013f3d30f624mr24709007plb.51.1635283758910; Tue, 26 Oct 2021 14:29:18 -0700 (PDT) Received: from localhost ([2620:0:1000:5e10:676c:ab93:f48d:23ae]) by smtp.gmail.com with ESMTPSA id mp14sm1706539pjb.17.2021.10.26.14.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 14:29:18 -0700 (PDT) Subject: [PATCH] RISC-V: Make CONFIG_RELOCATABLE user selectable Date: Tue, 26 Oct 2021 14:28:47 -0700 Message-Id: <20211026212847.43108-1-palmer@dabbelt.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Palmer Dabbelt From: Palmer Dabbelt To: alex@ghiti.fr Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Palmer Dabbelt This should really be up to the user, as it trades off portability for performance. Signed-off-by: Palmer Dabbelt --- arch/riscv/Kconfig | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 5dea03549493..f8a36034d54b 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -212,18 +212,6 @@ config PGTABLE_LEVELS config LOCKDEP_SUPPORT def_bool y -config RELOCATABLE - bool - depends on MMU && 64BIT && !XIP_KERNEL - help - This builds a kernel as a Position Independent Executable (PIE), - which retains all relocation metadata required to relocate the - kernel binary at runtime to a different virtual address than the - address it was linked at. - Since RISCV uses the RELA relocation format, this requires a - relocation pass at runtime even if the kernel is loaded at the - same address it was linked at. - source "arch/riscv/Kconfig.socs" source "arch/riscv/Kconfig.erratas" @@ -433,6 +421,18 @@ config CRASH_DUMP For more details see Documentation/admin-guide/kdump/kdump.rst +config RELOCATABLE + bool "Build a relocatable kernel" + depends on MMU && 64BIT && !XIP_KERNEL + help + This builds a kernel as a Position Independent Executable (PIE), + which retains all relocation metadata required to relocate the + kernel binary at runtime to a different virtual address than the + address it was linked at. + Since RISCV uses the RELA relocation format, this requires a + relocation pass at runtime even if the kernel is loaded at the + same address it was linked at. + endmenu menu "Boot options" -- 2.33.0.1079.g6e70778dc9-goog