Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2914212ybk; Tue, 12 May 2020 11:10:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF8p3IRv/CECuIhy6Mmcqp6iIzXe1kFSSz5cssKd3jGCsZW9v900nhqoMZYdF0xKec8AsY X-Received: by 2002:aa7:ca49:: with SMTP id j9mr1749404edt.186.1589307023972; Tue, 12 May 2020 11:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589307023; cv=none; d=google.com; s=arc-20160816; b=p04UuSoxEzTXSoIlrN6s8xYSSaMI/R40hjgvzoW1jtMgpVf16kf9/EKhs325acwXxG ugYMVBx/iTmKmhnC99/7D41doR9D6NyoigFk8j1mw8CKjaErdrIn5Y8i5/XXixPSRD66 IbxloQtmlNoSZ2CUOuzu+wOFDSi9gwW0vIZrtF4Pgag1c+La/GwabEag1mM6jFRTQOKo wzd0JU4EG223FXckUOzwIm7Hn7MFw8n3Pys0EySxjJSXQVJSh/IO5PKUdC7WIv/Vgksk cPvaI/fp9nszntRVX6baZGJU0XpFVWdA5AHmhDVv9VlIJN/8qCIDdMz5rlZYWLhHhExG HvCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date; bh=0myP8NqqHTxWeDN54HgjZVyaWnwx85q1wZhoLSHVUKM=; b=YEw7VmtcRXXPW4ArmeJq02aOxghdMSm1S9dwjC7i65jpzi9PIgvnM4wOrAJqBnDgXr VPds+0z/lAYqFcJUQMI//ltpRtfVMqwSdXNj9+OlNRi+FrdKiuI/L0Mt25EC/CCK3Cw7 MXnY/BnzMuHlTm04PwRTtvctqx73Fa7xqLE/anh/8lL/cC5Wkoc4/cgdTPavIS4R8f6b eIEV1iibKQhC0sJu7XGzqY/aOtwe3+Avsbgoy1xRtrGzLwCv7GNC3dyOeWyyj+8L04hS jkAa0xN4oee7O3gp4zTq9qYBS8jeLjQyB0DUPwP5ZdXdi90wXQ2beAcicSB0rWROiGTa EROA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ar7si4088702ejc.449.2020.05.12.11.10.00; Tue, 12 May 2020 11:10:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730210AbgELSHx (ORCPT + 99 others); Tue, 12 May 2020 14:07:53 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:48506 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726890AbgELSHw (ORCPT ); Tue, 12 May 2020 14:07:52 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Tue, 12 May 2020 11:07:50 -0700 Received: from localhost (unknown [10.200.192.41]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 6ECB0405FB; Tue, 12 May 2020 11:07:52 -0700 (PDT) Date: Tue, 12 May 2020 11:07:52 -0700 From: Matt Helsley To: Julien Thierry CC: , Josh Poimboeuf , Peter Zijlstra , Miroslav Benes , Steven Rostedt Subject: Re: [RFC][PATCH 2/5] objtool: Move struct objtool_file into arch-independent header Message-ID: <20200512180752.GH9040@rlwimi.vmware.com> Mail-Followup-To: Matt Helsley , Julien Thierry , linux-kernel@vger.kernel.org, Josh Poimboeuf , Peter Zijlstra , Miroslav Benes , Steven Rostedt References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: Received-SPF: None (EX13-EDG-OU-001.vmware.com: mhelsley@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2020 at 06:04:43PM +0100, Julien Thierry wrote: > Hi Matt, > > On 5/11/20 6:35 PM, Matt Helsley wrote: > > The objtool_file structure describing the files objtool works on is > > not architecture dependent -- it's not x86 only -- and it will be useful > > for any future commands that might not be part of the check / orc > > tooling. So we move it from the check.h header into the objtool.h header. > > > > The change itself looks alright to me, however I'd say the justification is > more about the fact the more subcommands dealing with object files are going > to be added to objtool, and all those subcommand will likely use the > objtool_file representation. > > I think it doesn't have much to do with arch specificity. (But this is > really about the commit message, otherwise the changes make sense) Good point. Here's a rewrite of the commit message: The objtool_file structure describes the files objtool works on, is used by the check subcommand, and the check.h header is included by the orc subcommands so it's presently used by all subcommands. Since the structure will be useful in all subcommands besides check, and some subcommands may not want to include check.h to get the definition, split the structure out into a new header meant for use by all objtool subcommands. Thanks! Cheers, -Matt Helsley > > > Signed-off-by: Matt Helsley > > --- > > tools/objtool/check.h | 10 +--------- > > tools/objtool/objtool.h | 20 ++++++++++++++++++++ > > 2 files changed, 21 insertions(+), 9 deletions(-) > > create mode 100644 tools/objtool/objtool.h > > > > diff --git a/tools/objtool/check.h b/tools/objtool/check.h > > index f0ce8ffe7135..ec6ff7f0970c 100644 > > --- a/tools/objtool/check.h > > +++ b/tools/objtool/check.h > > @@ -7,11 +7,10 @@ > > #define _CHECK_H > > #include > > -#include "elf.h" > > +#include "objtool.h" > > #include "cfi.h" > > #include "arch.h" > > #include "orc.h" > > -#include > > struct insn_state { > > struct cfi_reg cfa; > > @@ -47,13 +46,6 @@ struct instruction { > > struct orc_entry orc; > > }; > > -struct objtool_file { > > - struct elf *elf; > > - struct list_head insn_list; > > - DECLARE_HASHTABLE(insn_hash, 20); > > - bool ignore_unreachables, c_file, hints, rodata; > > -}; > > - > > int check(const char *objname, bool orc); > > struct instruction *find_insn(struct objtool_file *file, > > diff --git a/tools/objtool/objtool.h b/tools/objtool/objtool.h > > new file mode 100644 > > index 000000000000..afa52fe6f644 > > --- /dev/null > > +++ b/tools/objtool/objtool.h > > @@ -0,0 +1,20 @@ > > +/* SPDX-License-Identifier: GPL-2.0-or-later */ > > +/* > > + * Copyright (C) 2020 Matt Helsley > > + */ > > + > > +#ifndef _OBJTOOL_H > > +#define _OBJTOOL_H > > +#include > > +#include > > +#include > > + > > +#include "elf.h" > > + > > +struct objtool_file { > > + struct elf *elf; > > + struct list_head insn_list; > > + DECLARE_HASHTABLE(insn_hash, 20); > > + bool ignore_unreachables, c_file, hints, rodata; > > +}; > > +#endif > > > > -- > Julien Thierry >