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 > >