Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2697952rwd; Fri, 9 Jun 2023 15:41:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ55atDg0EwrPmVWCe2oxeygR7a2SgG9HBgxRE/N4VI5SnQcUgKOchFBJEavvGmIl2XjgO7X X-Received: by 2002:a05:6a20:9144:b0:114:b89c:f10b with SMTP id x4-20020a056a20914400b00114b89cf10bmr3183343pzc.31.1686350466167; Fri, 09 Jun 2023 15:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686350466; cv=none; d=google.com; s=arc-20160816; b=BX/4EUZKZCREx2Yzr4vIDSQD0RTLdpwH1kIgLyXhlhMfUgLPz8pDGX1lZak9YQHgVl W4bcU2VvZhlY8OYOwPMJ8A9I6a/abxshvp4WKaavRru7+iAh5JTxnKtJklGADpPh0eWy jtYdC3vl9CDEWTaQtM8yq0KYgsX1CkqB0Sj1gh6OLX79Y3Lzuba13qZrmZDW1DqG4O4I Q9Udnvt9QyyXqVBQRj/UcdngKtZes4D1mUyFBiAm24ZIBQ9gYNIHvinzzele6Qkkp/kK r00Bj2Yzp/rZtXzLtSl0KWPZUnVcnUTM15L73AmYh03OfXKn8j7EYCzgi8hReiI26Mys cMmA== 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=A3Ed0nuw7drlPiNQLGnfK26SW5DsUXhYBALdFdi4uxY=; b=q/U1IsQ8a8Buu7onpiulDHQO3EDkR87AZQiOSGULbZyYtfv86gGUTHzGY+ppxgUvFN 3civomxYZ3zMr+eJpOzSIlKEjfamR77PMml+G9c1yVYfOzUgTPm+8GkVGZtJV6Vm6WTj +Xg95QSEq0nLBqPf5rf38nEV/Eymj/eIP67qyY5SqAw42I2ZT8lC7lJP0nIXO4pxqrwV TwGoaVpwlV/aeAnfDNeoNnNiEJNf07fUOMbUQ3bCNyQ2OyOJqfJIB/qzCtuLiAt483EI hrKr8yBCsWyHtNSgW6O06sSZj406gUy8SJig3ZxCSsQuqqiZOxQyFsYWJiq5hgvTTWSv 2l1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M+veaxV9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m123-20020a625881000000b00624eb57b45dsi3115175pfb.74.2023.06.09.15.40.45; Fri, 09 Jun 2023 15:41:06 -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=@kernel.org header.s=k20201202 header.b=M+veaxV9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232647AbjFIWEg (ORCPT + 99 others); Fri, 9 Jun 2023 18:04:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjFIWEf (ORCPT ); Fri, 9 Jun 2023 18:04:35 -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 082622D44; Fri, 9 Jun 2023 15:04:34 -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 90ECF61044; Fri, 9 Jun 2023 22:04:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFD60C433D2; Fri, 9 Jun 2023 22:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686348273; bh=49WnzezBZqWAzArNQMUxsT8uVlrxotAtCA0lmcdXwvU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M+veaxV9QapnY+RNKTa5WQKeoAo4FtGCqbpAywvHvJuzDsJrooGzKT/XjeMx241uZ /LLB8iaAEQ9bQcJiPJc1mT7BPteTaNDrQU5ge8PrAEBUy9YQ5N62DSJ6ak3NjKBVtn 1WOtv5VRqXug/GEXsWnaCRyrr0iTa2pVgQovjif7a4fZHC5VGZ1PkUnFW1g6why9pN +m9M9jft2/E9N6IdWiU1enkpUJqqknzlYbMPhiujuNQ3HS2qvz5Ao3kmmhfdV15jxT 5f2tPIukaM53DOSeZ8t3zwWkFE1U2fwsbmkJcbtT/rDA6pfppmj0h22aUxFW0nHXR1 VRSJonQkTyGTA== Date: Fri, 9 Jun 2023 15:04:30 -0700 From: Josh Poimboeuf To: Omar Sandoval Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, linux-debuggers@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] x86/unwind/orc: add ELF section with ORC version number Message-ID: <20230609220430.agw2rtswmjbquzom@treble> References: <5b70bc58ef70aab0a821111cd3201eeced8bab95.1686263379.git.osandov@osandov.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5b70bc58ef70aab0a821111cd3201eeced8bab95.1686263379.git.osandov@osandov.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu, Jun 08, 2023 at 03:38:38PM -0700, Omar Sandoval wrote: > Hi, > > As mentioned in the commit message, the motivation for this patch is > allowing drgn to continue to make use of ORC for kernel stack unwinding. > > I want to make it clear that I don't want ORC to be stable ABI. The > kernel is free to change the format as much as needed, I just need a way > to detect the change. (drgn already pokes at many kernel internals and > needs updates for most kernel versions anyways. We have a big test suite > to catch changes we care about.) > > I'm not at all married to (or proud of) this particular implementation; > I'd be happy to use anything that lets me detect the format version in > both cases mentioned in the commit message (ELF file or core dump + > symbol table). > > It'd be great if we could get a solution in before 6.4 is released. I > would've reported this sooner, but I just got back from paternity leave > last week. Hi Omar, Peter and I agree this seems fine in principle. Though, instead of using an incrementing version, Peter had the idea to hash the struct, like: awk '/^struct orc_entry {$/ { p=1 } p { print } /^}/ { p=0 }' arch/x86/include/asm/orc_types.h | sha1sum That way we don't have to remember to bump the version number, and it would be more resilient to partial backports in distros. Would something like that work for you? -- Josh