Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2956597lqo; Tue, 14 May 2024 15:03:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUF8WK8AGOms/LZLuOPh5WLMw2TBKMU2D9ER6IdiKuQnMZbEx7TeRjy7CwQAQ8pqwK6odBm/f4afvjoEktKb0usLWwQEe1zhUmmQ+DYTw== X-Google-Smtp-Source: AGHT+IHsXyFGJaGyIsR2UmTvcLUkwJxunJZY7i51/ql6kdqch53/KhgqvAhjaW/3R0HZhrInTrrh X-Received: by 2002:a05:6122:17a0:b0:4d4:2fc1:b252 with SMTP id 71dfb90a1353d-4df882a780amr12504508e0c.6.1715724237880; Tue, 14 May 2024 15:03:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715724237; cv=pass; d=google.com; s=arc-20160816; b=pytxhsag9dWpyVKvRh2oSZZ8TyHpod11zaFGZdRC0WYDq55NEJjv2TI/FpWAbkJuWk +VGpGhFFvF3JHJpvxn7aacupqe6OZxLq+X4JqiFwtvVmVMLjAPfk1MH2A13rUJyhg7my Zkrc4PvYWhhtUxQ2vVsqEPKsr7OqkkqAvJM+NB0w7T5iZqWGt5UVVMZYZ3ihlRWzuQb7 G52URYPMbj4H7VceDDJSy5uJaGXQ0tZWxrSbody4MpqglNsHr96lV5wWIIyoBBZtrwCc V/4h2Xfwm9pNekiB9EYtPMwQdU48eALngG6IGLEfFaV04DTWf1Jdj0Vhd/Kaxd+qJWQv wroQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vkiSNZElAJybtnCmIixSp8O/INwHpHiOAq0SsZz+2kI=; fh=emyAZCx5PdA3hfTiw9GtoXbwG46z6b4g2MkKtPRY2Ro=; b=T9S2LU/YHZuQhtCZhJBRKAIDnJ23SEqcsbIcZmTN84iAozs2g7Scf6EUnXaYxBazgi HpUcPlYF5rz+Xh7eJg+iIVXJDElzEIOPBt6du2eDpgAkUuTwJqlq+Gq5NYb1niAp7gs7 4bbg/O24+mAJCGeMlXU4P5ji+1SYIuTT1lVY3KXiUqoIET7wco9T0mEHawi+mVGzjcQU h9WhgjH4djXPNjCPd3g9eW3jwUf0jrCeS4NFybR7/LYxxDEiviIbv88o3kychuHuYaKb 9Q5Gv5owuIAmo79udg03cwn1F1N4oLE3n2EL7zlY/JeDYTdB5LPjAlj2R1q7pI9pd2G6 3xsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=c4ph5UTE; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-179213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179213-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 71dfb90a1353d-4df7c0aa129si1946374e0c.296.2024.05.14.15.03.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 15:03:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=c4ph5UTE; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-179213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179213-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9657A1C20BF6 for ; Tue, 14 May 2024 22:03:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A35D2181CEB; Tue, 14 May 2024 22:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="c4ph5UTE" Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A112181BBB for ; Tue, 14 May 2024 22:03:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715724231; cv=none; b=Fq0TlT5LTquCDZo2VNh7xQTb2fNhysymIt2cZ3ilHGg/efD/AlqYSQXvRh7DS9Tv2Z+aOxYZ6b1Nl3OtdJT1sw2M8YYNp6CwtoZFZCDnn4/lotiobcOxfPyi9G1ka33HKgOgk8YgP4DLTqFUZl2xtIkkU4HttAHaaJ855yOBlpA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715724231; c=relaxed/simple; bh=gmjsQJg76AF0rBjoZFW5AFzN8fWfAw46dbA4FZIhxZo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=md4jPSu77lJMlF2cODx1oxV0A2RkoyNTyEjovSaHs/BUAn5UD4AU/3L/yaVHtA/8rN5YNV5wEOmXteQsSkJYK5N1uXMJ04eXT4JE1Mnu9guFUjAtoZagGNpfkmzYlOJbzvDDzEP+4cuOcitxv20IUUHNvMHtdZWNMIvoabz1XYg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=c4ph5UTE; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6f447976de7so5344390b3a.1 for ; Tue, 14 May 2024 15:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1715724229; x=1716329029; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vkiSNZElAJybtnCmIixSp8O/INwHpHiOAq0SsZz+2kI=; b=c4ph5UTE4tt8GiFBlm4HjS6iUuPaASkKF53D0IiBBYFwfTF31eYw+jinKR0v4jklVm oL1cZZrVt5xv8lCl3McQv3ufXjY84wu7VX2ht9BDAv5vprRP8+91uISqQewl5wF+0g7T dOpim/2NDUs5T1uHSEEJRAikXrxl7/0WsTlA8fayCdCZyXvii9qkDuVvC4Mfu8qlpcxa tXf/P58TYhVJRCcEW0f5wGo2tuZc1KrDw+NkAPWFMn37MU44WJlZwU9TpjJViatdRYfc FfHISbcisXAN0F7bPwzjdoPi9R89hfcFOev6rJfZ3dVMwuL72cAfWgjlo+4A1eNfkdIu qkFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715724229; x=1716329029; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vkiSNZElAJybtnCmIixSp8O/INwHpHiOAq0SsZz+2kI=; b=p8vjb8JPnVRGT8w1yp0qz37MxTDh28C6JLoG8HE+wNxIfb/sOgwV2hGyfuLScTRDMQ FHWMuV+q8XnM+Kmffrw27xE32xImhvQS1pBfFRg0gYLRuFaWIilBDYBbXLQxxpSDJcR6 J6sJVWHgDJd/q7AGjK6g/lUYVHPxmJsJlfDigMvOdzxqg+uevrx/glf8Q3jBVv5igMBU EQd/EmThB7biYA5jk5l7x1kpIorM9CaKEdgYajRSFoxm+pK/Voeow+OgplTIwzxJo7fg L9QEKUyEstS5WF0Z0DMrYviVvZpkBKFEo9xrulamw8Pnl1Ek1k74hDRbusvfVz/H/XtT Kp8w== X-Forwarded-Encrypted: i=1; AJvYcCX6ynf5EJCdd4NDvVBPZDVQZYFtb9kGM+K3/L+uRVsoHLQwQHSWzJX4iJzmKw854c6Xr9ttyst8voorAtYjN5hehPvMyZ63cj0bWs8y X-Gm-Message-State: AOJu0YygGL8qsZS8IRRfz2FF9gRHE15Osk9oiTvNS4gmARGYv4ZJ64XJ Z0qUI+8isI6KdJW8KQKGbMeies+JYfPWU7SglmlQkhK7Vp3BdfFloFFqIZtUSMh/hDpLyzHBvyt C X-Received: by 2002:a05:6a20:5527:b0:1af:d647:3108 with SMTP id adf61e73a8af0-1afde0af5c2mr12122015637.2.1715724228879; Tue, 14 May 2024 15:03:48 -0700 (PDT) Received: from ghost ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0bf32b4dsm105280505ad.137.2024.05.14.15.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 15:03:48 -0700 (PDT) Date: Tue, 14 May 2024 15:03:45 -0700 From: Charlie Jenkins To: Qingfang Deng Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Qingfang Deng Subject: Re: [PATCH] riscv: do not select MODULE_SECTIONS by default Message-ID: References: <20240511015725.1162-1-dqfext@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240511015725.1162-1-dqfext@gmail.com> On Sat, May 11, 2024 at 09:57:25AM +0800, Qingfang Deng wrote: > From: Qingfang Deng > > Since commit aad15bc85c18 ("riscv: Change code model of module to > medany to improve data accessing"), kernel modules have not been built > with -fPIC, so they wouldn't have R_RISCV_GOT_HI20 or R_RISCV_CALL_PLT > relocations, and handling of those relocations is unnecessary. > > If RELOCATABLE=y, kernel modules will be built with -fPIE, which would > reintroduce said relocations, so only select MODULE_SECTIONS when > RELOCATABLE. > > Signed-off-by: Qingfang Deng > --- > arch/riscv/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 6bec1bce6586..3f92dd3b45d2 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -169,7 +169,6 @@ config RISCV > select LOCK_MM_AND_FIND_VMA > select MMU_GATHER_RCU_TABLE_FREE if SMP && MMU > select MODULES_USE_ELF_RELA if MODULES > - select MODULE_SECTIONS if MODULES > select OF > select OF_EARLY_FLATTREE > select OF_IRQ > @@ -858,6 +857,7 @@ config PARAVIRT_TIME_ACCOUNTING > config RELOCATABLE > bool "Build a relocatable kernel" > depends on MMU && 64BIT && !XIP_KERNEL > + select MODULE_SECTIONS if MODULES > help > This builds a kernel as a Position Independent Executable (PIE), > which retains all relocation metadata required to relocate the > -- > 2.34.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv Looks great! Reviewed-by: Charlie Jenkins