Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp692980pxb; Wed, 27 Oct 2021 10:30:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFPebbeiL7pY8jXwVCTLK03guLJjDjwvpYG+Zed0rYBRkVExEWOsOwuTmjeDrFue1UwTBO X-Received: by 2002:a17:907:d08:: with SMTP id gn8mr39627984ejc.395.1635355838819; Wed, 27 Oct 2021 10:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635355838; cv=none; d=google.com; s=arc-20160816; b=RR1qu9O0Wher3MRX84mvWiXR/smFXXGmp4Xgq4/aj0c8oD3e4huSGEc1fAcIlXk4IL 4n7zD/HMLpqliBYBG0FnW02OOjdVMEHqucdPfmc5DFUvstNVXYuX+tz2jBvTBvwDNTHm RzterD8LGKnFPJCOKx9YP9Cv6KGJUtITEL4q+0AAtuliwUiDga1qd2mwu8BHnh5M7xRA 0eHeqdyZ7+PEUvmatmfxHzV8znFVfYvpkAdIMS6i6GPz/747V5By7rpbkhe7EV5DA8+9 L6zSN2lVgCuH0EyXk12vRevn1aiBzRxvQ2YDq8Pu8/gxGJOaq9m2eXbc0Z/wrCyBW5Mp 4zIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=CkZ0h3oA76c5vymTedDlrFqUUmcky83Gmn3eDLb8QrI=; b=qAyP0YX94UCJ1aGLRyPSCOAAosH1y88JYJm2eolTdC43lgp1O6RHcZxOa/1df1s+hU zOMqXJlFepLshsnmYt0DosNUrgvS8WNjKTH6U1Uq6wrsZXkAdGlBHA8uNfR+koD/gNT8 9EIDBt8K7Keaa9Hw1D7QUoV9yNYELJDFJIGEf7S7vRZHUaaWt8xIrmdSDMuK3LBUWhXM AjRAnJ8rVsIXde3XDem2VjLovtACmiR6WvEHpJlAXYA0uO8wTAWqb3hF3X1AkkPsx4LL aJFozgSe+10NmjUiPYTcCpz8h7CJIyZZlio6JILb7PRJ1xI8nkKfQSLjlWowyFVWgiL1 yNJQ== ARC-Authentication-Results: i=1; mx.google.com; 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 r23si546708edo.463.2021.10.27.10.30.02; Wed, 27 Oct 2021 10:30:38 -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; 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 S238206AbhJ0FKN (ORCPT + 99 others); Wed, 27 Oct 2021 01:10:13 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:48737 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230349AbhJ0FKM (ORCPT ); Wed, 27 Oct 2021 01:10:12 -0400 Received: (Authenticated sender: alex@ghiti.fr) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 5837520007; Wed, 27 Oct 2021 05:07:45 +0000 (UTC) Subject: Re: [PATCH] RISC-V: Make CONFIG_RELOCATABLE user selectable To: Palmer Dabbelt Cc: Paul Walmsley , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Palmer Dabbelt References: <20211026212847.43108-1-palmer@dabbelt.com> From: Alexandre ghiti Message-ID: Date: Wed, 27 Oct 2021 07:07:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211026212847.43108-1-palmer@dabbelt.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Palmer, On 10/26/21 11:28 PM, Palmer Dabbelt wrote: > 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" Agreed, you can add: Reviewed-by: Alexandre Ghiti Thanks for the patch, Alex