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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 676AFEB64D9 for ; Fri, 7 Jul 2023 06:06:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231963AbjGGGG1 (ORCPT ); Fri, 7 Jul 2023 02:06:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjGGGGY (ORCPT ); Fri, 7 Jul 2023 02:06:24 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4019B183 for ; Thu, 6 Jul 2023 23:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1688709980; bh=aqrod6vM4sEPjl4JBQgL6DNpjvHEpvtdJNSsM28V3nw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iPzdB3qUPiU/rHl7MGbdtvaOHGUzJctTZIh6MlOFqoacFVfGVpxb71/CEfHKyFipa dn+DEl005a5kV9Hs/PUHwpTTRSoldnMsSKGjD4DNGX0j9J6we/OwXWQrCnjidmVplk mop6sYaHxRW/6ARPuUWjPHMEy224tDy1cv9mXE8g= Date: Fri, 7 Jul 2023 08:06:19 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Palmer Dabbelt Cc: mcgrof@kernel.org, rdunlap@infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] module: Ignore RISC-V mapping symbols too Message-ID: <3e905882-7f96-4fc0-aecf-6054ed00372e@t-8ch.de> References: <20230707054007.32591-1-palmer@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230707054007.32591-1-palmer@rivosinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-07-06 22:40:01-0700, Palmer Dabbelt wrote: > RISC-V has an extended form of mapping symbols that we use to encode > the ISA when it changes in the middle of an ELF. This trips up modpost > as a build failure, I haven't yet verified it yet but I believe the > kallsyms difference should result in stacks looking sane again. > [..] > diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c > index ef73ae7c8909..1e988e542c5d 100644 > --- a/kernel/module/kallsyms.c > +++ b/kernel/module/kallsyms.c > @@ -12,6 +12,12 @@ > #include > #include "internal.h" > > +#ifdef CONFIG_RISCV > +#define IS_RISCV 1 > +#else > +#define IS_RISCV 0 > +#endif > + > /* Lookup exported symbol in given range of kernel_symbols */ > static const struct kernel_symbol *lookup_exported_symbol(const char *name, > const struct kernel_symbol *start, > @@ -289,7 +295,7 @@ static const char *find_kallsyms_symbol(struct module *mod, > * and inserted at a whim. > */ > if (*kallsyms_symbol_name(kallsyms, i) == '\0' || > - is_mapping_symbol(kallsyms_symbol_name(kallsyms, i))) > + is_mapping_symbol(kallsyms_symbol_name(kallsyms, i), IS_RISCV)) IS_BUILTIN(CONFIG_RISCV) or IS_ENABLED(CONFIG_RISCV) ? > continue; > > if (thisval <= addr && thisval > bestval) { > [..]