Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31491258rwd; Thu, 6 Jul 2023 23:30:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlFiGMEFMxlV4LHP8hdQkFCX4geFH/WMBh2IOwb96FtBxITmqdmfXPOlSZEMjol/cTkh4hIC X-Received: by 2002:a17:902:bd01:b0:1b7:ef4f:f51e with SMTP id p1-20020a170902bd0100b001b7ef4ff51emr2732824pls.34.1688711444796; Thu, 06 Jul 2023 23:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688711444; cv=none; d=google.com; s=arc-20160816; b=j61Judj7fqRHxzJ34ExJSyoORcw8ZqQzncqUTKAgoR/DuFlSpO8Hef88uTZP3qNIZT 0UNiGoFmTDgI+64nyL+8Z224S/IXXPAiMwhIrxGZ0yKynD2kegvjjI5lK9ZkGBPE3SFK 5PLh+MZGsZFKAMNwQpTirf7xHNI5KnE3DO0bNZw+LulVygu1eNCF9mC/jYWn6lqJSFgi 6ROo7zt2+NUJckKkb+5SLAVvqRO8EoVq8nRTvFjGU5RkkzMR+ruNZxrxIynehwaNUDzV p9b4rGnATtpOH9dr3CLc+oE/8kdMsjEEs+E15Nh3/uECneTIPQLg4GbK7ZecyexNS272 shag== 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=dDQq5phmciKMe0tbpPtCUtjgMO65X7AyBBPaWPYFUT8=; fh=JH1gS4RW8CTQ5jWFju+Q0aowHut5wgcV93A9tyoT58o=; b=SYbotU2qdr1wf378Bb3vsWFS31yjAp46fZJZNLUC2WYUJZH7pKLOEnTIg0bvtIlsdv CSPGF9VVDZc+vVBm7CzHuVgWf43NWAvYjB5369CrlHLsHgSVVyOYwAvP469sJ9cq7Wlm pn0ZU3ALIIaki1s3M4GeevJaB241J8JGfaY6A8abgBGrdRzFN3DlOfe0AqgqQ0qM9YMN I6BhWnZKFm2S6ylbU4tOGCJXlj6UwmQN5nwiQDPMAUEcwNj+xrCIO7maUdLSubiqsHye oR6zw7Q4hiNDaU6eQb8/MjfSKOpiUe3MSeJOMYL2vxpbCspFvEyMGXyZr79e4+hPdONF 03Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=iPzdB3qU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20-20020a170902d15400b001b8bd546321si2872883plt.97.2023.07.06.23.30.31; Thu, 06 Jul 2023 23:30:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=iPzdB3qU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232073AbjGGGG0 (ORCPT + 99 others); Fri, 7 Jul 2023 02:06:26 -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> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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) { > [..]