Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1975428ybg; Fri, 5 Jun 2020 02:19:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJIJgE4xKl6nMcHy2ExNd4XvQfnoWr5dmzJI3ELRW6fqI+ZoWJrE4FqNNmaVXG3bsgPPuT X-Received: by 2002:a05:6402:1d0d:: with SMTP id dg13mr8104408edb.146.1591348771020; Fri, 05 Jun 2020 02:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591348771; cv=none; d=google.com; s=arc-20160816; b=eZ5ng3CY2d9CQufVXRy+7TfeTxODO/+FJWRRXvsxve4PeGWQb3TrqQFLp7esjocAt2 eUWSJxojfxwLuIqUpjAoffm+vSS9ZpRKFngeyK+F0gEblEKJq52WKd01LNIrlw4PlBMF HTrzqomlhfUNBWNxZSGOPDxtS3+7KsCyRU7kbIB7bFzB33LiddI9MqUR9mNCZwWQWgD+ rpVOZEcMQACg4z57y2nJEW+ht38Gr2USK8CL6amDfYdTNpWbGRmS/fGZTB6F3cjDDK45 7DzgPz46d/+0I7qAEUjHU2mX/ymn9um1unr2MNMGnK9CEId31iHyRZ9OLXlpKYR4BQ7E OKLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=TdPY4brIle4EtCaEceRx3F5uwPHDBYPC7qV6/shEPSY=; b=RGW7gGpvbVO/QVCROAAx3tGu4t3AbW9jaktApZk5DmuCwN0EvbkEpdub4PFpJ6h2uP ESaIpNceivYbhmK+ZflSklM1VphkhJ24jOsKft2EyM5z9coAybY2zthzooWMFLOLnnVZ R4Aoioqc2YY8wA22IC5Rgb2USj5csNwLPVJdZ8Mh/eHt7qVXTgwi3eCb8mRJ9J36vQl0 VwfAMbAun8nP/WA9pPATJV+aoUnq2eRnmMEQaBbbnYn4Ai5Xg1uIr22f0dUjCrFj8PMN bcWnxEcRA6bf8GJOLY+WbGBp+v7SrN7h2NJo9S77h1/SX9HZfFtlKaT9g8KbQzjoV+Zp dB+w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c29si3494267edn.61.2020.06.05.02.19.08; Fri, 05 Jun 2020 02:19:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726226AbgFEJRQ (ORCPT + 99 others); Fri, 5 Jun 2020 05:17:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:35734 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbgFEJRP (ORCPT ); Fri, 5 Jun 2020 05:17:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0D03DAD33; Fri, 5 Jun 2020 09:17:18 +0000 (UTC) Date: Fri, 5 Jun 2020 11:17:14 +0200 (CEST) From: Miroslav Benes To: Julien Thierry cc: linux-kernel@vger.kernel.org, jpoimboe@redhat.com, peterz@infradead.org, mhelsley@vmware.com Subject: Re: [PATCH 4/4] objtool: orc_gen: Move orc_entry out of instruction structure In-Reply-To: <20200604163938.21660-5-jthierry@redhat.com> Message-ID: References: <20200604163938.21660-1-jthierry@redhat.com> <20200604163938.21660-5-jthierry@redhat.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, a nit below... On Thu, 4 Jun 2020, Julien Thierry wrote: > One orc_entry is associated with each instruction in the object file, > but having the orc_entry contained by the instruction structure forces > architectures not implementing the orc subcommands to provide a dummy > definition of the orc_entry. > > Avoid that by having orc_entries in a separate list, part of the > objtool_file. > int create_orc(struct objtool_file *file) > { > struct instruction *insn; > > for_each_insn(file, insn) { > - struct orc_entry *orc = &insn->orc; > struct cfi_reg *cfa = &insn->cfi.cfa; > struct cfi_reg *bp = &insn->cfi.regs[CFI_BP]; > + struct orc_entry *orc; > + struct orc_data *od; > + > + if (!insn->sec->text) > + continue; You have the same check added by the previous check a couple of lines below. > + od = calloc(1, sizeof(*od)); > + if (!od) > + return -1; > + od->insn = insn; > + list_add_tail(&od->list, &file->orc_data_list); > + > + orc = &od->orc; > > if (!insn->sec->text) > continue; Here. The rest looks good to me, but I should probably check again with a clearer head. Overall, the patch set is a nice improvement. Miroslav