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 2CDB2C6FA92 for ; Tue, 27 Sep 2022 14:57:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbiI0O5M (ORCPT ); Tue, 27 Sep 2022 10:57:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231221AbiI0O4q (ORCPT ); Tue, 27 Sep 2022 10:56:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1691F49; Tue, 27 Sep 2022 07:56:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7C7FF619FF; Tue, 27 Sep 2022 14:56:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66E8DC433D6; Tue, 27 Sep 2022 14:56:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664290571; bh=Qk0G/WZDcN4dxcPpiCPen6zY2HKM55TAGgtnQZvZuMs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kesYukV+JBTN/u2lya1V3baZinP/iQcxgujh4O9bleZt7H6tANJtmTPV2ZZ6B7+l3 1QuECVkV8T2qteCdXOmLDkjN5nI7CGOYGV+sAjF6Lw4o/4I9We97/5GGQiCHaMN1xf 0wfkAzvUAX4sXPJ5KC2hknKlp9wq1EKj32/Rn5FI= Date: Tue, 27 Sep 2022 16:56:09 +0200 From: Greg Kroah-Hartman To: Miguel Ojeda Cc: Linus Torvalds , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, patches@lists.linux.dev, Jarkko Sakkinen , Kees Cook , Petr Mladek , Alex Gaynor , Wedson Almeida Filho , Gary Guo , Boqun Feng , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Joe Lawrence , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , live-patching@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH v10 05/27] kallsyms: increase maximum kernel symbol length to 512 Message-ID: References: <20220927131518.30000-1-ojeda@kernel.org> <20220927131518.30000-6-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220927131518.30000-6-ojeda@kernel.org> Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org On Tue, Sep 27, 2022 at 03:14:36PM +0200, Miguel Ojeda wrote: > Rust symbols can become quite long due to namespacing introduced > by modules, types, traits, generics, etc. For instance, > the following code: > > pub mod my_module { > pub struct MyType; > pub struct MyGenericType(T); > > pub trait MyTrait { > fn my_method() -> u32; > } > > impl MyTrait for MyGenericType { > fn my_method() -> u32 { > 42 > } > } > } > > generates a symbol of length 96 when using the upcoming v0 mangling scheme: > > _RNvXNtCshGpAVYOtgW1_7example9my_moduleINtB2_13MyGenericTypeNtB2_6MyTypeENtB2_7MyTrait9my_method > > At the moment, Rust symbols may reach up to 300 in length. > Setting 512 as the maximum seems like a reasonable choice to > keep some headroom. > > Reviewed-by: Kees Cook > Reviewed-by: Petr Mladek > Co-developed-by: Alex Gaynor > Signed-off-by: Alex Gaynor > Co-developed-by: Wedson Almeida Filho > Signed-off-by: Wedson Almeida Filho > Co-developed-by: Gary Guo > Signed-off-by: Gary Guo > Co-developed-by: Boqun Feng > Signed-off-by: Boqun Feng > Signed-off-by: Miguel Ojeda > --- > include/linux/kallsyms.h | 2 +- > kernel/livepatch/core.c | 4 ++-- > scripts/kallsyms.c | 4 ++-- > tools/include/linux/kallsyms.h | 2 +- > tools/lib/perf/include/perf/event.h | 2 +- > tools/lib/symbol/kallsyms.h | 2 +- > 6 files changed, 8 insertions(+), 8 deletions(-) Reviewed-by: Greg Kroah-Hartman