Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3730195rdg; Wed, 18 Oct 2023 04:37:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUH3slXftQeC6tMpRs4JPBMPvvPLX9xWxg7Y5sSuzwl2FSdn+dlobs/Zk10qY5GeRzQbZM X-Received: by 2002:a05:6a21:3d85:b0:157:e4c6:766a with SMTP id bj5-20020a056a213d8500b00157e4c6766amr4182509pzc.41.1697629019792; Wed, 18 Oct 2023 04:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697629019; cv=none; d=google.com; s=arc-20160816; b=dhUgv5nJpw5hOWiVNdSwhcxV3OrEw6ohiwBpJi6sSAa7+nf6gwLPCO+mXdjWguoHNa 1lejtVOC8WRi2xUTOlEPpui7sIuAgLTnMtkcwV8xAxUs8qakIpI9YZsU43bKdfiexAoU b8/VqqU+cFJpFxsaTDASjCrjgOZdO0YoF+8xWk5bYyQOmu8p8JdbSEwCZJZP5tWhrVna 87i1ZiDnm+Sc83yolYLQ4qUjw1xZeHxVA1KTyQMAsXEggPoYfWHLLHcL4ag3gmyUmqZk lPsgq6UijpMXDJT1pqvPthtS3Cvv6ATIkSStNWpRDsHxgNLhH6F/tAINdbQ7hW9vKHYr riwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Qcnh7Yb3RLNs/zdTRsVZSMLXH6obn+OtpT7kBd3ZqDA=; fh=G8Z8hiKw7HyTxGf2Ls+8oGJTQCg5ZicHV8+9Zruf9pc=; b=EWdMwstHNzfueMCZiVOj7CgepYNC1Q6dOQEx8fElGyEhzjwmYruKEDvK1Sq+MmfoEF x+As9DJJgqk7rSdmKzqOKkr50N0P8YAe82AF82yvVfaE26isEL5sPt6G8cZ2Tm55pFJF sO7eN26SeLsygD8omCMNK6egsy/dWtOJFJ4uJpIE8tWNMi9gzJzK5o2eO7/XVbCQ9Ec8 xvum2VJLROsyXAKB16CAfJNKg+eHq3D2byyOuhqbblCEbQQlnyuchllcMt3iPdiEjis2 +GOt1o+5OQJB94dfz2gCsiTS3thYHb+x7f0qxDnQHgvUG88ExBvNz05x4i0RsvxK/8EJ 4+Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M+Wdr4Eu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id be3-20020a656e43000000b005b3b86ab19csi1915174pgb.107.2023.10.18.04.36.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 04:36:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M+Wdr4Eu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9506180A7705; Wed, 18 Oct 2023 04:36:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230292AbjJRLgE (ORCPT + 99 others); Wed, 18 Oct 2023 07:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbjJRLgC (ORCPT ); Wed, 18 Oct 2023 07:36:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01CC1FE for ; Wed, 18 Oct 2023 04:35:59 -0700 (PDT) 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-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 18 Oct 2023 04:36:29 -0700 (PDT) --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--