From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D98FCDB482 for ; Wed, 18 Oct 2023 11:36:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 261FB8D0151; Wed, 18 Oct 2023 07:36:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 212128D0016; Wed, 18 Oct 2023 07:36:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 101AA8D0151; Wed, 18 Oct 2023 07:36:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 009428D0016 for ; Wed, 18 Oct 2023 07:36:02 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C1927412BB for ; Wed, 18 Oct 2023 11:36:02 +0000 (UTC) X-FDA: 81358378164.03.904A161 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf10.hostedemail.com (Postfix) with ESMTP id E62CFC0012 for ; Wed, 18 Oct 2023 11:36:00 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=M+Wdr4Eu; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf10.hostedemail.com: domain of conor@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=conor@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697628961; a=rsa-sha256; cv=none; b=H+5H0eiEmDHytwNuQ0WL8vtOtm1zzCON3WRplrJ7EzjUuU7L9K0fziSG1f9yvI7qQ80WI4 tfAQ8ALVodVY0hn1D5ajwCzIdIYxqv6v2+RSC3BqaxVCpMaZ95BgF6p6l4inGx7jSXHbHQ /1hYaeT7iv+aXTm+KNVRR/iphGlrV94= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=M+Wdr4Eu; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf10.hostedemail.com: domain of conor@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=conor@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697628961; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Qcnh7Yb3RLNs/zdTRsVZSMLXH6obn+OtpT7kBd3ZqDA=; b=zVJ8jbHTnjKpwLBazgj5vJz3bTqjFImJFqzEBxHsmJOcol5uAnYYV25+zBCCKtzFYu2mHB nhKdGlyZ+mmEyuTC7YQ4yLjGS/vEXYmpWwr6XzPfa0AWp3af3jmEPy6hv/Cqv7K3JOM16A wHzsiXKzcZHP/u8uBKmM7kj3I8Pc7gA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E90906172D; Wed, 18 Oct 2023 11:35:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC5E6C433C7; Wed, 18 Oct 2023 11:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697628959; bh=auqTNLipd3mDc/YcCEnSBeelbAAfYDDTuTo0Vv6a5uw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M+Wdr4Euwkm2PmwDzKVGLB7zKPMBqG+ksDsnufCKVlZ6EonsZSvD3BSiU/bWdstEp UzDZ+9jBq9b8KdvbrVRIdd2UlsEA9S9jsX+okvK9KCpojusNi9AvAALCxzD3bOTI3W C6VhTmhaQveG2DE4rqAKHUqsK4ms5HfOS9TSuBzlxn4nkdw1RjQYK08mDSYq0+IXBB 10JMFkBbldHjhABg4q0HmkYzc6oTVrcrbPFWuPHdKGubY+JB1N7k/5Ac7G/na/GxZT l75r0CBVjOfG0mE503xqPVEDRvcBPVxyuwGbPWFOePw60azeQM+RwbytU7L98eOILR m3m7YrOi2I3wQ== Date: Wed, 18 Oct 2023 12:35:55 +0100 From: Conor Dooley To: Charlie Jenkins Cc: linux-riscv@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Eric Biederman , Kees Cook , Paul Walmsley , Palmer Dabbelt , Albert Ou Subject: Re: [PATCH v4 0/2] riscv: Add remaining module relocations and tests Message-ID: <20231018-smite-bungee-f46b15b4ce6f@spud> References: <20231017-module_relocations-v4-0-937f5ef316f0@rivosinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1okcQQvN+RgqgcjX" Content-Disposition: inline In-Reply-To: <20231017-module_relocations-v4-0-937f5ef316f0@rivosinc.com> X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E62CFC0012 X-Stat-Signature: 7pahjfxy8r8do1s7s84m3k4aae8yut38 X-HE-Tag: 1697628960-128791 X-HE-Meta: U2FsdGVkX1/QKa0k5DiKJGujvXtjXCbbhvS6SjIij4UX+wtI7ak5JLqKnRQHTdTlU0nAtaUVXuWcD5V5vLwa4wartjtbleaE+/eRlcAKZc369dXk0OZu6jymSmlz8AmBgliwNA/w0aQjAj1wkWY0WevmcqpJYhVx6qSHJg18HcnK8SzNSDy9HrkxMMUdOwR/9/CZxvrEjZ8dKcCfRGt09ljqQxME5HSs6EMXtn8E6TbECb2/xOg7PxMIEeQY9o9YzYPHxK0Gzsmh7+9Q/H1fegghKkBeOLImWtWHMbjurQC1aUhN39TiMBzYsCugaGHlJGM/3gzQslxY+HI6Eg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HgGnjqDgRw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --1okcQQvN+RgqgcjX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Charlie, On Tue, Oct 17, 2023 at 10:34:15PM -0700, Charlie Jenkins wrote: > A handful of module relocations were missing, this patch includes the > remaining ones. I also wrote some test cases to ensure that module > loading works properly. Some relocations cannot be supported in the > kernel, these include the ones that rely on thread local storage and > dynamic linking. >=20 > ULEB128 handling is a bit special because SET and SUB relocations must > happen together, and SET must happen before SUB. A psABI proposal [1] > mandates that the first SET_ULEB128 that appears before a SUB_ULEB128 > is the associated SET_ULEB128. >=20 > This can be tested by enabling KUNIT, RUNTIME_KERNEL_TESTING_MENU, and > RISCV_MODULE_LINKING_KUNIT. >=20 > [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/403 >=20 > Signed-off-by: Charlie Jenkins > --- > Changes in v4: > - Complete removal of R_RISCV_RVC_LUI > - Fix bug in R_RISCV_SUB6 linking > - Only build ULEB128 tests if supported by toolchain > - Link to v3: https://lore.kernel.org/r/20231016-module_relocations-v3-0-= a667fd6071e9@rivosinc.com On patch 2/2: =2E./arch/riscv/kernel/tests/module_test/test_uleb128.S:18:17: error: unkno= wn relocation name =2E./arch/riscv/kernel/tests/module_test/test_uleb128.S:19:17: error: unkno= wn relocation name Same toolchain configuration in the patchwork automation as before. Cheers, Conor. >=20 > Changes in v3: > - Add prototypes to test_module_linking_main as recommended by intel > zero day bot > - Improve efficiency of ULEB128 pair matching > - Link to v2: https://lore.kernel.org/r/20231006-module_relocations-v2-0-= 47566453fedc@rivosinc.com >=20 > Changes in v2: > - Added ULEB128 relocations > - Link to v1: https://lore.kernel.org/r/20230913-module_relocations-v1-0-= bb3d8467e793@rivosinc.com >=20 > --- > Charlie Jenkins (2): > riscv: Add remaining module relocations > riscv: Add tests for riscv module loading >=20 > arch/riscv/Kconfig.debug | 1 + > arch/riscv/include/uapi/asm/elf.h | 5 +- > arch/riscv/kernel/Makefile | 1 + > arch/riscv/kernel/module.c | 207 +++++++++++++++= +++--- > arch/riscv/kernel/tests/Kconfig.debug | 35 ++++ > arch/riscv/kernel/tests/Makefile | 1 + > arch/riscv/kernel/tests/module_test/Makefile | 15 ++ > .../tests/module_test/test_module_linking_main.c | 85 +++++++++ > arch/riscv/kernel/tests/module_test/test_set16.S | 23 +++ > arch/riscv/kernel/tests/module_test/test_set32.S | 20 ++ > arch/riscv/kernel/tests/module_test/test_set6.S | 23 +++ > arch/riscv/kernel/tests/module_test/test_set8.S | 23 +++ > arch/riscv/kernel/tests/module_test/test_sub16.S | 22 +++ > arch/riscv/kernel/tests/module_test/test_sub32.S | 22 +++ > arch/riscv/kernel/tests/module_test/test_sub6.S | 22 +++ > arch/riscv/kernel/tests/module_test/test_sub64.S | 27 +++ > arch/riscv/kernel/tests/module_test/test_sub8.S | 22 +++ > arch/riscv/kernel/tests/module_test/test_uleb128.S | 20 ++ > 18 files changed, 548 insertions(+), 26 deletions(-) > --- > base-commit: 4d320c2d9a2b22f53523a1b012cda17a50220965 > change-id: 20230908-module_relocations-f63ced651bd7 > --=20 > - Charlie >=20 --1okcQQvN+RgqgcjX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZS/DGwAKCRB4tDGHoIJi 0gMDAP0WbgwU87WIuhP0GqZRc4filSavgJ3pf5gzvnAAYbBAPAEAuuKUU48p/pb4 cjTzJOq1xJ30NhLxK8Npc0BLQvqxpwU= =tuJ6 -----END PGP SIGNATURE----- --1okcQQvN+RgqgcjX--