Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp909937pxb; Fri, 22 Apr 2022 14:04:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzimRz7EMySetCo2E8gNLSvrFYC6O+FvT0PrrSbM59KhDVc5H8XaYUZlnHAB8PTgn+R7n+3 X-Received: by 2002:a17:90a:138e:b0:1cb:b5f8:f12d with SMTP id i14-20020a17090a138e00b001cbb5f8f12dmr18263156pja.84.1650661471024; Fri, 22 Apr 2022 14:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650661471; cv=none; d=google.com; s=arc-20160816; b=zh8X3zalKn8LV5+IhbWDNr1ledil/pfP19o1YzTGuadjuyEmJSkqm6l5wU/uaGViy5 mrIHlag8AOPwD9Izp1Igxz4ukVsyOcWtsL860sAV73Yh/RAhVt9phQ36a4EQre7LE55s xw+xx902SB0jEjlb9C62/kMXYgGJ/exmENTg6TpivBCNC6+5J1rLhjj9SoeniB/gNgI0 uOre+9JyakfY5THtt3k++o1eel9dmV3R5azBVoiQl6vO3cGVb1OwWFeWADrzsYch65// hSwe1REF/fQzRCbbFy8p6o8LnZxsUBoGVf0h2ugDfWuG7k8lX3pNKWdtfk09Fl3O+iZa aJ1A== 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=2BuLYItnkwfQS9K8R0LN9N0nlBZ1mpVZxwoKDS2jotM=; b=uZ69fah+nV4vfnAX98JAaUPszgLvc/p9uLQym7ODmTDgLhLG1xeM2WEf1YaTZkxT1w c/RFMSQwRp4TyK+atjt426qDAPHt5E6myZEVbBH8GkqHCCKYeNC1oKhsGxiznz7L1aMC aa6KJr0Ss5NrdYrQN35oImT1e37uucMrnF6jrMGZKWVpHhpNbhumX0P35+5YyV+peTVG A2NMJl9vHDgr5q18b0QtUWnDHIyctjL7vE8vAOrvV1Fz8/f27YWbxq4iEfKCnlTJeDYu oO43ICym0Pw54KRKWW8wUDj5k1Mzp4mHSfU51b8LaMmUOK26eV0Awh3/GZQMf2XbfAW0 s9ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Xw/IHqjq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id fy6-20020a17090b020600b001d762d20a5fsi3933090pjb.118.2022.04.22.14.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:04:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Xw/IHqjq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D7E36234080; Fri, 22 Apr 2022 13:01:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350544AbiDSVoR (ORCPT + 99 others); Tue, 19 Apr 2022 17:44:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238162AbiDSVoQ (ORCPT ); Tue, 19 Apr 2022 17:44:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 810D0393F1 for ; Tue, 19 Apr 2022 14:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650404491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2BuLYItnkwfQS9K8R0LN9N0nlBZ1mpVZxwoKDS2jotM=; b=Xw/IHqjqjCXkE67LMMj62wehy4GoN2PWyuaOco/piXS9KOELslhSNLerSdLwXwiQbbOc3s 8rJldcyHjYv+QfU5YPpTFKgsRR0ulmYFk9ju5UEYDN+vEpO5a43BqSccnLnwdY8k7E/mO4 etTY3Hjhd4RObPbac91dMJV0mByA1yU= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-306-bXQLjDzPMvOPdW2o6rtokQ-1; Tue, 19 Apr 2022 17:41:29 -0400 X-MC-Unique: bXQLjDzPMvOPdW2o6rtokQ-1 Received: by mail-qt1-f200.google.com with SMTP id ay26-20020a05622a229a00b002f20573a0faso3545658qtb.13 for ; Tue, 19 Apr 2022 14:41:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2BuLYItnkwfQS9K8R0LN9N0nlBZ1mpVZxwoKDS2jotM=; b=jq1fXi8FrmNSSHdO8QADJix9hLb4HTmwDXMTxZVePc9AQ1eL9jSX8dCBeqbpxF6bNw RizW2fDEW27TsGKaeMq9IuLGDPLFpWqoZcqT9Ox+N1ibUoH6WPbAFdFIZu+yEbCVXfuS CrFxNZzN40f9EwbETIJnTb+2du+v1o5W022b2yYdBrzwuzJ3NQXacwLBZUOW8bitgDqn gC1ybRPFpgXE3kJspM7zosEQUywZ1EmIb11WLBJnW+R+YzYV/OGLn2hVAnwjmdaEOjWS Na654/TjPjO5owlXbras/XZvLucDPA0zGnXHx0LWoMJJJMCsIY+XG+gWR5D5S+IPC3KH N8tw== X-Gm-Message-State: AOAM531nybUo2K2lYL5bw2N0vunEWBVIntia4BW4NmZuQDT8rQC1/R0u rWdlEscEdOkLlEIsdpbA8DstkVpH2n1FaHukKSwxZ/v0nMqmilEFfcMeU3bIAWGOxAoZlm+poMF vNuA+vKKkn/EFfbvKwVwZGh3J X-Received: by 2002:a05:622a:1056:b0:2f1:f76a:eb6c with SMTP id f22-20020a05622a105600b002f1f76aeb6cmr10613873qte.437.1650404488962; Tue, 19 Apr 2022 14:41:28 -0700 (PDT) X-Received: by 2002:a05:622a:1056:b0:2f1:f76a:eb6c with SMTP id f22-20020a05622a105600b002f1f76aeb6cmr10613860qte.437.1650404488743; Tue, 19 Apr 2022 14:41:28 -0700 (PDT) Received: from treble ([2600:1700:6e32:6c00::35]) by smtp.gmail.com with ESMTPSA id w15-20020ac857cf000000b002f33f220c76sm489099qta.32.2022.04.19.14.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 14:41:28 -0700 (PDT) Date: Tue, 19 Apr 2022 14:41:25 -0700 From: Josh Poimboeuf To: Peter Zijlstra Cc: Borislav Petkov , linux-kernel@vger.kernel.org, x86@kernel.org, Miroslav Benes Subject: Re: [PATCH v2] scripts: Create objdump-func helper script Message-ID: <20220419214125.hnwust76a7qay3dd@treble> References: <20220419201435.GY2731@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220419201435.GY2731@worktop.programming.kicks-ass.net> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 Tue, Apr 19, 2022 at 10:14:35PM +0200, Peter Zijlstra wrote: > On Tue, Apr 19, 2022 at 09:50:01PM +0200, Borislav Petkov wrote: > > On Tue, Apr 19, 2022 at 09:12:23AM -0700, Josh Poimboeuf wrote: > > > Add a simple script which disassembles a single function from an object > > > file. Comes in handy for objtool warnings and kernel stack traces. > > > > > > Originally-by: Peter Zijlstra > > > Signed-off-by: Josh Poimboeuf > > > --- > > > v2: > > > - require gawk > > > > > > scripts/objdump-func | 18 ++++++++++++++++++ > > > 1 file changed, 18 insertions(+) > > > create mode 100755 scripts/objdump-func > > > > Was that supposed to be user-friendly too? > > > > $ ./scripts/objdump-func -h > > ./scripts/objdump-func: line 16: $1: unbound variable > > > > :-) You mean you don't want to read the script to reverse engineer the usage before running it??? > > It works tho: > > > > $ ./scripts/objdump-func vmlinux rewind_stack_and_make_dead > > 0000 ffffffff81001c00 : > > 0000 ffffffff81001c00: 31 ed xor %ebp,%ebp > > 0000 ffffffff81001c02: 65 48 8b 04 25 d0 ec 01 00 mov %gs:0x1ecd0,%rax > > 0000 ffffffff81001c0b: 48 8d a0 58 ff ff ff lea -0xa8(%rax),%rsp > > 0000 ffffffff81001c12: e8 39 24 07 00 call ffffffff81074050 > > ^^^^ > > > > I guess those zeros at the beginning are supposed to mean something... > > Use the .o file and it'll work: Should probably get fixed to work on vmlinux too... -- Josh