Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8119451rwd; Tue, 20 Jun 2023 10:22:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ZQElZNgopmbiF/+6J0Xhim6M8CJ0rMROiqcOXuTiK6ELtW73YL5wwmRr8nsXRswMPXtcL X-Received: by 2002:a17:90a:6688:b0:25b:e310:ca6 with SMTP id m8-20020a17090a668800b0025be3100ca6mr25801444pjj.9.1687281753106; Tue, 20 Jun 2023 10:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687281753; cv=none; d=google.com; s=arc-20160816; b=KkQED0SdaFT6HRv/JcnyrdcIGyFARwFyH5vmUu6qMYxiINMFYDnUQlj9nH0qlnL2Pr aZ52rFXqmYJjAXS5hkNjWO50wikel4APU0XxSdxf9IAOPH8tOD2p+djc43Md5FgAHJBy mFnZpm2QoFdOWKfCmO6iOXhEZEMLN0+KlqM2MZ0kAk/zgFS4txnEp0Mp7RQ9X2NQM9Vz dyuwMmCzk2nc36Lnh5D9cBtbJx1sJ+HZLQTt1bg1sPPPHBezlJL39lTllSYe5umNPYLz aUTOVUFDPgFf1CKsdPDQdCVhHCnfHJQlgfHW+GoD9NE3PprDpQilEuNnaBrmNLeTzm3K Z6Xg== 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=bSEahIWuWvh3A7BBDnL3sX3amCBedgDlTKV+iX+mItU=; b=wa6Ye1TiGNncPHhRxpmeDMMXIFmMWhQcs6AD3uk0S0ju1IW/JKhwMfJumcMydd1VM7 1BxTZkctOs1g2WbnjW/9QY+uD36J28HaAt//ieuuJ8+nnzwdvqE74ZfjnzLxkart+8dG 5D7wW+9PuTEsYUPQXSJqMC7A64DcS+RTf1g/JqPjiEf02e9O/r5d7V2w9nbglqJCzC2O FFyWAfOSQFF0BRbG2WUAg7VUrksJe3plqMw52dJ/AQejejWdhQBTu32bnaaMUy5p05ya le8nrRT9YySq24vXZlz7CAdg92OaleZilWgP45PJwKp+LZXjyzyWucKz9UVZ00QWq8DK N86A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@osandov-com.20221208.gappssmtp.com header.s=20221208 header.b=SxhmsbX6; 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 s7-20020a17090aa10700b0025c1f1b7527si2283413pjp.11.2023.06.20.10.22.20; Tue, 20 Jun 2023 10:22:33 -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=@osandov-com.20221208.gappssmtp.com header.s=20221208 header.b=SxhmsbX6; 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 S231688AbjFTQuG (ORCPT + 99 others); Tue, 20 Jun 2023 12:50:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbjFTQuF (ORCPT ); Tue, 20 Jun 2023 12:50:05 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4492172C for ; Tue, 20 Jun 2023 09:50:03 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-25695bb6461so4086612a91.1 for ; Tue, 20 Jun 2023 09:50:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20221208.gappssmtp.com; s=20221208; t=1687279803; x=1689871803; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bSEahIWuWvh3A7BBDnL3sX3amCBedgDlTKV+iX+mItU=; b=SxhmsbX6Uvs7i8kbMxodpZR+QM/TeG5Q9/PTbbf+nTBjNmZNZOIKh42iZEsrRuHeeF Za2QQqgN/0XBz3zQ3YTVUZp5DtXQSK5A5Zwf8tBAmDZW+SS3fnGTD34ycbx29Al92BhO 35/b7SkO7kVeliy0yEr06uneHtycCB8sm33VyVIWxz+7xDGW8L4Mi7zYZYxmxkrcBkzJ 4IC/h1iG8McWH7Zte2mCOSCnb3MdR+c1C5YN5A94+aboMoHUtKT0bA+43YHMRzrOMG4S DwjRkZm1CJHGCHg6BLv4jspf8oYa+YAAN8qntSwPW5g95H6Dux3/RpprTCvyHCzzZcNr Ht7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687279803; x=1689871803; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bSEahIWuWvh3A7BBDnL3sX3amCBedgDlTKV+iX+mItU=; b=Ph23qIyCOxtP73mybw+MazAfw8UqjVT5fImveiFZSfRBlfZ/GK2Ot70iDGLp7hM4U1 2RZplXBZK2om9YdpTANQUX3M7uxpU5wosL03KByKXDWdOhq8RAjlaqCoVC2uDjHVMCyV ATrprocoMJlwm5MRkVg8yjwj0N1BNYG04Ark3ncKKOxo9y+oK7srkiYCaHNRVsueQbgt xwzTvlI29Drf4XtX9vzd1savPA77nUWCERimgUjEA+znYikRhJhhywzvbB9e9qnkabMo sYf22ZDdiyzzZgxVSdteCN26XRLcZpq/4wIUHA8FlJqUmvZMudT1ya89gtJ6WN7vUSnL lf9g== X-Gm-Message-State: AC+VfDyV2KQj5WXN4ZjFEkI0TffdnHaAtA42djewdsrzQeZ/HxBITKI7 yGNQGg14uF7R7s6T1W71UvaDZdzXxWmd9XZq85g= X-Received: by 2002:a17:90a:430a:b0:259:bff8:17a2 with SMTP id q10-20020a17090a430a00b00259bff817a2mr25100145pjg.0.1687279802961; Tue, 20 Jun 2023 09:50:02 -0700 (PDT) Received: from telecaster ([2620:10d:c090:400::5:ea8e]) by smtp.gmail.com with ESMTPSA id na12-20020a17090b4c0c00b0023b3d80c76csm1753518pjb.4.2023.06.20.09.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 09:50:02 -0700 (PDT) Date: Tue, 20 Jun 2023 09:50:00 -0700 From: Omar Sandoval To: Peter Zijlstra Cc: Josh Poimboeuf , linux-kernel@vger.kernel.org, linux-debuggers@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH v2] x86/unwind/orc: add ELF section with ORC version identifier Message-ID: References: <20230614091751.GE1639749@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230614091751.GE1639749@hirez.programming.kicks-ass.net> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, 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 Wed, Jun 14, 2023 at 11:17:51AM +0200, Peter Zijlstra wrote: > On Tue, Jun 13, 2023 at 02:14:56PM -0700, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Commits ffb1b4a41016 ("x86/unwind/orc: Add 'signal' field to ORC > > metadata") and fb799447ae29 ("x86,objtool: Split UNWIND_HINT_EMPTY in > > two") changed the ORC format. Although ORC is internal to the kernel, > > it's the only way for external tools to get reliable kernel stack traces > > on x86-64. In particular, the drgn debugger [1] uses ORC for stack > > unwinding, and these format changes broke it [2]. As the drgn > > maintainer, I don't care how often or how much the kernel changes the > > ORC format as long as I have a way to detect the change. > > > > It suffices to store a version identifier in the vmlinux and kernel > > module ELF files (to use when parsing ORC sections from ELF), and in > > kernel memory (to use when parsing ORC from a core dump+symbol table). > > Rather than hard-coding a version number that needs to be manually > > bumped, Peterz suggested hashing the definitions from orc_types.h. If > > there is a format change that isn't caught by this, the hashing script > > can be updated. > > > > This patch adds an .orc_header allocated ELF section containing the > > 20-byte hash to vmlinux and kernel modules, along with the corresponding > > __start_orc_header and __stop_orc_header symbols in vmlinux. > > > > 1: https://github.com/osandov/drgn > > 2: https://github.com/osandov/drgn/issues/303 > > > > Signed-off-by: Omar Sandoval > > Patch looks good to me; as a follow up I suppose we could verify the orc > hash on module load, to ensure the module and main kernel agree on the > ORC version used -- but we can do that later. > > > --- > > Hi, > > > > This is v2 of my patch to make it possible for external tools like drgn > > to identify versions of the ORC format. As stated in v1 [1], I don't > > want ORC to be stable ABI; I just need a way to identify the format > > being used. > > > > This version incorporates Peter's suggestion to hash the ORC definitions > > instead of requiring a manual version number; this is easier to maintain > > and more resilient to backports. > > > > I would love to get this in before 6.4 is released, and then hopefully > > backport it to 6.3-stable. > > So we're fairly late in the cycle and it would need justification to go > into objtool/urgent -- preferably only fixes at this point. > > But given we 'broke' the ORC layout this cycle, we can mark this with > Fixes: for the two mentioned commits. > > Josh? Ping, Josh, any chance of getting this in to 6.4? Sorry to be cutting it so close.