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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77ECBC07E96 for ; Sun, 4 Jul 2021 21:05:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CAFF613CB for ; Sun, 4 Jul 2021 21:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbhGDVIO (ORCPT ); Sun, 4 Jul 2021 17:08:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbhGDVIO (ORCPT ); Sun, 4 Jul 2021 17:08:14 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39B89C061574; Sun, 4 Jul 2021 14:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1eUr+gbecB5vZp8b6uWu5kOh4miZGULdLwL3OofYB+o=; b=EvCMmD0n/QDhfPrCw3JMAOyG7x dydQUiG8qbs24YHnT9qafnQX0MePXUhawlwRJmI8Jpwsa9QuEyHS8mlkA4vXoPi1E24UKQvgLhVBS a5peUvgVTQaDYgxskZl+gKBdezwoce9W6Tki4euisOg9PllOipt/HV3qs51TcPCISgxKG4SF9SBFE QStujndr8c5gI2i9ZGX8mJ6O0c/KmDh7ErxxoKVviMrKMGbs78rOXKfkV6vlpsYurk85oSYZrRue9 CfZrVVAUMDfQdqEWCcRSbsMDQUjEuca6i6hT1Lsa/M4esFCCL+VBAjZ7FTM0LJy3t+kdlha/wv+F0 02Bh61eg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m09IH-009b56-3Y; Sun, 04 Jul 2021 21:04:52 +0000 Date: Sun, 4 Jul 2021 22:04:49 +0100 From: Matthew Wilcox To: ojeda@kernel.org Cc: Linus Torvalds , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho Subject: Re: [PATCH 01/17] kallsyms: support big kernel symbols (2-byte lengths) Message-ID: References: <20210704202756.29107-1-ojeda@kernel.org> <20210704202756.29107-2-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210704202756.29107-2-ojeda@kernel.org> Precedence: bulk List-ID: X-Mailing-List: rust-for-linux@vger.kernel.org On Sun, Jul 04, 2021 at 10:27:40PM +0200, ojeda@kernel.org wrote: > From: Miguel Ojeda > > Rust symbols can become quite long due to namespacing introduced > by modules, types, traits, generics, etc. > > Increasing to 255 is not enough in some cases, and therefore > we need to introduce 2-byte lengths to the symbol table. We call > these "big" symbols. > > In order to avoid increasing all lengths to 2 bytes (since most > of them only require 1 byte, including many Rust ones), we use > length zero to mark "big" symbols in the table. What happened to my suggestion from last time of encoding symbols < 128 as 0-127 and symbols larger than that as (data[0] - 128) * 256 + data[1]) ?