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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5159ECDB47E for ; Wed, 18 Oct 2023 17:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=baBlCk9f4QN/kyhTOIO/WsBii4BC/BZ6/vVHO43VGkA=; b=WXe46JT8QvIcaV 32d9XoYeoEvIOwzMHpDnIYOeAUi1IlEc6Ho1Z5GDpvdtzFrWwDtRIQj3B8R4EaquU33QMN1ldF7MR E7BqBpzxkWP8eQU4Fd+Yriq9eFf5W/314cBheqlaNjqWJ+oQDWB6WBSFFTWCLk64H5HCGXuwV75qn DxGqEEXVwnSq8dRiyGke8rPJDksrA4lnP7/HoQQx+kbW9dgQd/IWIMsDPmjWadgAfcciS7xKMMJpI gFGaO9I831riUBnehuavFv907baX3jbAlyOg5FVTgHMa5rTUKdeIVzj2kH5UO7q8r2xJ6N231R4aD QaGjc2lLi5wlIUYg8e9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtAOQ-00FKb5-12; Wed, 18 Oct 2023 17:31:38 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtAOM-00FKZr-2G for linux-riscv@lists.infradead.org; Wed, 18 Oct 2023 17:31:36 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-77421a47db6so434573585a.0 for ; Wed, 18 Oct 2023 10:31:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1697650293; x=1698255093; darn=lists.infradead.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=9bLri2X0kCXBGV92nbDG6SwJM6GKrFdnsc241iebPNs=; b=0Rn5/guvRhZLE7VcbsNEVUDwsRgvyAIzMb3yYwRc2Qm+iVGvdT+j14fk0tT9DhvU+u eOaMV/0jDKt/8kezFXv4dguQPerUwo5qEcT1rOvigHgcVxCFyfCsaWUnuELYO6i/nkxV p+WNQShK/8CIAi0ymmWR9KvvvIrw0GH/JVLXdqfFF5ko4tSQtViIiEiSNb1vTvqYeX0T XwjYxNehTBX9N0y5BMgQ3TzZsO0WJL1sOr/B4IfDYpp2k2e3zG+FGiiklQrcWiJtB4Bi lpdOYOZyVFGxWlGiaeChw2TdXW5wDopgakfqdl5SVGpZFV4bsrKe7Jfr+6KepvkPyZDC ULQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697650293; x=1698255093; 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=9bLri2X0kCXBGV92nbDG6SwJM6GKrFdnsc241iebPNs=; b=ZeQXpaUSZHAv5Z4tS6dolkQOz/EJomTXQmCIRrsgzMkhUE/Zu3mpR/gpvasttZgplH JUQnN8vJZRjwg6Rz8wqYl1kKMI8cEUY2W8lx8dGe9Sg/xAuF4/bRiNGOw4FRP2OeZdQ2 GexEaWf37AMd4c6NNsCDWozw5imJQDV6pk6SgA0buwSFPpXxLZckRSM/8DyzZVaucoFJ WJG7vBKNdaSHR3s2gQ4Dk+r6BQMC/oy4Gb2MJoWO5TKvajsGogueACNimJwmFssR6y2t ngED987k98zyfJHJw7PZZ+dBkITDC1FL7ASt0nGUJ7J43kfjpVU6jgh0RHLysRjPzOO2 P8Fg== X-Gm-Message-State: AOJu0Yw5MadFAx+f/lvuxiYRwwqcKH5uK+qmkaBSou7jUHDhU5yqv4J0 weaPA3FCQwdEvlAvbBGRRrMIIQ== X-Google-Smtp-Source: AGHT+IFo+mjFtPxRpd0jIylF9fz6tknOGNAoG6F08LeZnO+TZslObXXsbTQ7uyBbn7ocgkka/c15Cw== X-Received: by 2002:a05:620a:3994:b0:775:9c22:e901 with SMTP id ro20-20020a05620a399400b007759c22e901mr5485542qkn.15.1697650293358; Wed, 18 Oct 2023 10:31:33 -0700 (PDT) Received: from ghost ([208.116.208.98]) by smtp.gmail.com with ESMTPSA id g3-20020a05620a108300b007789a3499casm109418qkk.115.2023.10.18.10.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:31:32 -0700 (PDT) Date: Wed, 18 Oct 2023 10:31:29 -0700 From: Charlie Jenkins To: Conor Dooley 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: References: <20231017-module_relocations-v4-0-937f5ef316f0@rivosinc.com> <20231018-smite-bungee-f46b15b4ce6f@spud> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231018-smite-bungee-f46b15b4ce6f@spud> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231018_103134_742072_E7D528FC X-CRM114-Status: GOOD ( 24.00 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Oct 18, 2023 at 12:35:55PM +0100, Conor Dooley wrote: > 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. > > > > 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. > > > > This can be tested by enabling KUNIT, RUNTIME_KERNEL_TESTING_MENU, and > > RISCV_MODULE_LINKING_KUNIT. > > > > [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/403 > > > > 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: > > ../arch/riscv/kernel/tests/module_test/test_uleb128.S:18:17: error: unknown relocation name > ../arch/riscv/kernel/tests/module_test/test_uleb128.S:19:17: error: unknown relocation name > > Same toolchain configuration in the patchwork automation as before. > > Cheers, > Conor. Where do you see this error? On Patchwork I see a success [1]. [1] https://patchwork.kernel.org/project/linux-riscv/patch/20231017-module_relocations-v4-2-937f5ef316f0@rivosinc.com/ > > > > > 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 > > > > Changes in v2: > > - Added ULEB128 relocations > > - Link to v1: https://lore.kernel.org/r/20230913-module_relocations-v1-0-bb3d8467e793@rivosinc.com > > > > --- > > Charlie Jenkins (2): > > riscv: Add remaining module relocations > > riscv: Add tests for riscv module loading > > > > 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 > > -- > > - Charlie > > _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 A17B3CDB483 for ; Wed, 18 Oct 2023 17:31:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C92A8D0167; Wed, 18 Oct 2023 13:31:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 07AB18D0016; Wed, 18 Oct 2023 13:31:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E83178D0167; Wed, 18 Oct 2023 13:31:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D90ED8D0016 for ; Wed, 18 Oct 2023 13:31:36 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 598A91403FF for ; Wed, 18 Oct 2023 17:31:36 +0000 (UTC) X-FDA: 81359274192.16.215945F Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by imf04.hostedemail.com (Postfix) with ESMTP id 559394002B for ; Wed, 18 Oct 2023 17:31:34 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=GSp7R7OJ; spf=pass (imf04.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=charlie@rivosinc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697650294; 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=9bLri2X0kCXBGV92nbDG6SwJM6GKrFdnsc241iebPNs=; b=atHGDCTw0bsELAEI3UNGQRJm3w5UV5VHiEgNGBHccnqUTSxO6yusWWUIPgPFQFcOQqHKgN iIU4cEHcidBfZS1ixXBm2d9RiyphSJZqlRv8YKg6MG6ApzwD86aGyCBuYlRkvLKel+X0qE 76tLkZUVRqR1B3xY+45ydjIWosEDC6k= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=GSp7R7OJ; spf=pass (imf04.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=charlie@rivosinc.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697650294; a=rsa-sha256; cv=none; b=wo23Pbo5laRTudWjJLuYPB+5KYKOgKdIcnw81b/qK92E+sof6tfM7xRya3Dc2cD/4LzGQJ LNL0Dxu3S+ga67Zdifp2p1Y+OFsgystky32R+ebeiTVqBongNJt4kIBqgp+bm48NVYQY7I n/kCt8UnxW/F2iPV3+JIowSfR8ion88= Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-774141bb415so432760985a.3 for ; Wed, 18 Oct 2023 10:31:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1697650293; x=1698255093; darn=kvack.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=9bLri2X0kCXBGV92nbDG6SwJM6GKrFdnsc241iebPNs=; b=GSp7R7OJi+q8vbtMFwLOqB4lj/kqMj6EeMTqi9nH1RK9NQr2IEKCLhBHpg+8mpig6G K8Rn3Fe8nf9L4swQxvuRzWTgutn2wzIbuoIYdg6ZMw74K6Zdzf6nCgTfvvf8JUJVkal5 G4FGVs9o0KG9703qsRQ18DHF0nZgTboBADNBKqqUEVmB9zocuYu4Y5Hxxx0IImRRBgsw Sr/ukE6PZOjJ/AWsClA5w7oTSu7/Ewu/ba7mAlZ2Vuxa0XsHVRh6333DAJaxPCdLlMkO cySM76mb4BjsmdZCnQB0EhJeGlzchKyOzfIQxLSYjoc7PqZwtPbHFHCXOHXSHXLHSnK9 3Lzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697650293; x=1698255093; 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=9bLri2X0kCXBGV92nbDG6SwJM6GKrFdnsc241iebPNs=; b=KgKcYHjvph+b9jNdYamf0ZPDAFzSUrAdDkgtsb5SXoul2rVakrnjJ+VMhrXRNnZIvx 95vFLvO3Rlva4hOF7wKS+eV1lUn3qhvDJWSK8Q36WNASgT9dip6BnYSUPn4TX/zKsy5/ eBYSkUGpuAYB8Dmscy8Er9PR3bBgeF9HYHbLd5zY1QcoRSmhQsnSDJZalbVlqD5Qvzhp m40zB5b5rm1cPLTx+FRWGMR86a1ifoEz/vaRYEbCSFYD/S/rSZNqxsIdJHyJtMXtLQtD vCyd03/SOSQIexxay/sqi6vJPp2OWEjXiXYaoJe86k0L+XnEEkPoI1Ht+R3azlTtx+q8 75gQ== X-Gm-Message-State: AOJu0Yw0cQqao/5CST9qlH0mGikEkXr30sdV9KGTdDrizrLvCDvpzgPt UBIbI1RGsUObQGF2GWN0StZwfg== X-Google-Smtp-Source: AGHT+IFo+mjFtPxRpd0jIylF9fz6tknOGNAoG6F08LeZnO+TZslObXXsbTQ7uyBbn7ocgkka/c15Cw== X-Received: by 2002:a05:620a:3994:b0:775:9c22:e901 with SMTP id ro20-20020a05620a399400b007759c22e901mr5485542qkn.15.1697650293358; Wed, 18 Oct 2023 10:31:33 -0700 (PDT) Received: from ghost ([208.116.208.98]) by smtp.gmail.com with ESMTPSA id g3-20020a05620a108300b007789a3499casm109418qkk.115.2023.10.18.10.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:31:32 -0700 (PDT) Date: Wed, 18 Oct 2023 10:31:29 -0700 From: Charlie Jenkins To: Conor Dooley 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: References: <20231017-module_relocations-v4-0-937f5ef316f0@rivosinc.com> <20231018-smite-bungee-f46b15b4ce6f@spud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231018-smite-bungee-f46b15b4ce6f@spud> X-Rspamd-Queue-Id: 559394002B X-Rspam-User: X-Stat-Signature: 79iz45hpj51ggzs5uknzy6rg5nfuebmo X-Rspamd-Server: rspam01 X-HE-Tag: 1697650294-91661 X-HE-Meta: U2FsdGVkX19ytX8szY4MF2l9XDJ8lGxwBCmoumZfMu518bRu/Iv8vvzu4Z8Ao8GwYc7IpPPwKFWjkGNOR7SSeB7r73oUy20Qvl/RpB67fXF0jZo9KH5HoNisMp0sKkH6ytWoKazsLPcLl/pzN37tqKjlaJZozKxxGsC+a7Dj7JxJxj3YrzULifTRthYHcIW4E4slan/6q5Z3/QGyW8Q+b/tFkibmjIXqFinuOnrdVAcXua3d4wNByIC2D+/zPjtOrwpfl3tQfD1axXDXDJlZJcsGtbzfPjbMaclHGgh3rkYyLErseCIKSuLLtoMepQRvOVeZyQh8gp0N5luHX5DiQ6MizesfDGn7Rya8BpAlnv+teFf1263Dsy/C4TmnfiKQIyzf/FreBLdhl1gS7utgcnnfXU44Ae7fk3gUB7XYZLK9GawlNwZ4bM197YcUfh8OGjeabHDu4LsF7Z03R7yePxIeaXAyGQhDJ6AZUwqAl3RyjBq9MLmd5HiBG1Yap63nM/ZcgyGrSzeqghkl27E32xPjPAxf+zpY97e59oODpwD/UipmqkViKa81bfXKx+uG4AFUhh/M607EUiUVMWaps1WZZlrz9g8Q9k7CjkPBF6UNfmeB4uZfdSedaWwmv4qjxjaLrtgUNEQnOFL+76W/CtNLZbmJ5mzj29AhxbEgbe1AR8EyjZUS5hJlyBMuzMq0FQuVrXbMW4qjqM/OZrou/0J6VeOjwg53PSVStFn4o3RDfHI5C/hmF9KuJgt+mjuSOa5XNO5O0PSNT7ReIaQMjNllNuVw+iIMwFKeZiu9olJUMWBoLIdY5N6VcxCKKHS3Pgmep1BrXzjUhMJmiGAG0oLUU9MeunISLDo32c7YE35sAV7W3h8Gtx9OWmSwvUtdhYIDDZ9SPBbQ3nyI2rAFG9K/Tak+ACPULVuLiIgS7mAO18GLCdvi6RQsREEwi/9Sf1Z/kqcatCnKRYfuC31 guQyQvRJ Yg3oxVxu8/lkyWCa2B7JnypEBGN7/R4hxyD+/+NCua0omFScq0OtE3I2k0pid5cOvfYhoTjUqsDP/lX4yMKE0+0vGHBhQBDNHodcvZIIduNg6omVIFMG/BYr2U7o4F90NpRWn/J6sf3eIh8qv5730KdIRNJBHFdufVp4kWbg5pieKzVpJyZ5Lscdci4Xsfc0l49w7iCtqdRfkNRGoWqcSi4t5m3UfxPWJJGapggrAZYI/SB3gU3elGEF+hNUeqJWPoTexrPXFPReUcGxGQK76Tqlz3SXMYA8z1xNtIKpr3ovYjJPD3EV6udtNjipbSORk6tItYVZ3wtxy5Bwt8ykbfpMzTqQCuhaqz/nteNwjBOJeNnp/GCifmpg9mwQ0qfQ6me2LxnzwGzsMxY+kvsq/DNE3jshpp4nObnIYLTfHitBKFyDhXDONI491m69F8Ua0dRaTJ10R32DHsLRbiqvCdllQdKZL4/F2kYtgX9QYEV5byNAX29xIUaexsnAtrv4LxN6QZrFI4wq7rucDe/ObB28/b3fJz53to2ze X-Bogosity: Ham, tests=bogofilter, spamicity=0.000069, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 18, 2023 at 12:35:55PM +0100, Conor Dooley wrote: > 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. > > > > 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. > > > > This can be tested by enabling KUNIT, RUNTIME_KERNEL_TESTING_MENU, and > > RISCV_MODULE_LINKING_KUNIT. > > > > [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/403 > > > > 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: > > ../arch/riscv/kernel/tests/module_test/test_uleb128.S:18:17: error: unknown relocation name > ../arch/riscv/kernel/tests/module_test/test_uleb128.S:19:17: error: unknown relocation name > > Same toolchain configuration in the patchwork automation as before. > > Cheers, > Conor. Where do you see this error? On Patchwork I see a success [1]. [1] https://patchwork.kernel.org/project/linux-riscv/patch/20231017-module_relocations-v4-2-937f5ef316f0@rivosinc.com/ > > > > > 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 > > > > Changes in v2: > > - Added ULEB128 relocations > > - Link to v1: https://lore.kernel.org/r/20230913-module_relocations-v1-0-bb3d8467e793@rivosinc.com > > > > --- > > Charlie Jenkins (2): > > riscv: Add remaining module relocations > > riscv: Add tests for riscv module loading > > > > 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 > > -- > > - Charlie > >