Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2060823ybg; Fri, 5 Jun 2020 04:44:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRWk55dr5BGzJaGiT4kxaF1UmYOJ6xmfLMmpwywEhNMBKbtIfsbbiQDhgslVm6smWgkxyk X-Received: by 2002:a17:906:16d3:: with SMTP id t19mr8030451ejd.297.1591357453866; Fri, 05 Jun 2020 04:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591357453; cv=none; d=google.com; s=arc-20160816; b=idR2D8wEQkAWihqJrMm0DQsy3QSd9LICl7PbMwL9hD+/P/pc3jO9pPVLukjo96LoSx zG7uCgfprRyhy4vkiGYJ87SfScwkAQ7x7zr6bkhPOt/KPSV4Ae8iOA3u2t/4XkiU1xNj cTCxojkMqjNKf0VFQAli5P671BlAqSlpdBFWiLjIViS6UfVUAzu0vo+fbK4299I/5J0g bipFBauDN7fGpWkcIcOLylU8whIb8HOVTAbpJ7vjWp7HiKXhiU83So+Yd7lCOwN5DZe8 /IjoABHkWNm8nWoOEHAm5hzl7nSDznqtYKHgQUiwrT4wEUW79dcrCeKst/a49SvVAjFq 6G+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=bP4BwMd/o1/f8MtvJilZ34AAESzOCga+hYzIgdxawGo=; b=TmuvEzNJR09BBg3zwtJo5Z19qmXY3YhqxacLpqV+Mg0V/0W68IgLR9wMiLfsfRsU0x tlpHbZpWojSmvd+u4/+Q0LSh8VO9If2A28lyJczewOVrKeWxnhE2Roytyo8VD+UQJaDp PxGD00IDywQ6A708mxOewV24Gk1OGUXNSYPCe8GZ5ErvuFGXNNfeN5tJx+cXhpktL7rC VvFZoXuDxCY6lVMzcn4vkWt4laVVZVzwgPkhG4cCfCkgraQJoOyM3I3YnpbDHPDFxVfC NSF1zKiuc2nIoQRZ7CHfs8pLUonjvNANV5cLMy2+Jic0Rq8zmi+WnrCWlFfQJmVFCsuN QKjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ARhiUqJH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si3325510eji.721.2020.06.05.04.43.50; Fri, 05 Jun 2020 04:44:13 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ARhiUqJH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbgFELkJ (ORCPT + 99 others); Fri, 5 Jun 2020 07:40:09 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:36391 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725997AbgFELkJ (ORCPT ); Fri, 5 Jun 2020 07:40:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591357207; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bP4BwMd/o1/f8MtvJilZ34AAESzOCga+hYzIgdxawGo=; b=ARhiUqJHrJt2rV68U2tIJ6YozaojJogYXtQv/7Xppl2CMBIsHMygjbjmkoiEkPmtmgHnWk GX+a5+sVDQHAJ2mB37WIESiTggmsFgJ2/7dxQj4Z9CsAVlfT1beDfTmcLpfsLVW5T3Lx8F d2OTFA7nSVw14TlY+Dh9maPTiTi05Ho= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-130-lG2Hl1QIMxW1-ATRexNRQA-1; Fri, 05 Jun 2020 07:40:02 -0400 X-MC-Unique: lG2Hl1QIMxW1-ATRexNRQA-1 Received: by mail-wr1-f70.google.com with SMTP id d6so3672517wrn.1 for ; Fri, 05 Jun 2020 04:40:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bP4BwMd/o1/f8MtvJilZ34AAESzOCga+hYzIgdxawGo=; b=tCUTM40oaleTKIm0bL7qoRjnf1Ov8o0ZDIbKSGZkSO5botaKfGNZE1KBR8sw8KvgOj koK6r/sDrYmIyZ3aQIS4Nm9r9T9iH4JtrGPe5YhRgMGJRkMks9lJajCkc3NsyhnqXEry NKkqOCgxXYRsZrj1dVKTZ2pwZHEzGs5LdsCMDsJoZu3iiYXtZl+p65jybCuw7RIQ5zW6 wy1FD/Rs53dXOcpEw2mqJiNrtzUzZYjeJffaevo9GaRpkfQk/snwZZcHZ+zzTdoqEjGW 2pn4c2BQZA3D2UKJlRcrfacZ4aeT3CPmtm9OmBJBKW4Nl2q/sRh/jc0qrZwbDVKaiuN5 Ywag== X-Gm-Message-State: AOAM5330siFxlUcrjibuIwVmM9wfizGIYYd0Ko5wdxoe+6sayxdbBPk8 zJV4sMCdRCBRVje/BbiDETyx5/0cOJaOOkNzDrINDLKhvhwEVa6UgR0JzdLzuzt22W1pTW6nlGf e6kxf7MnAmIg0PE4LVQhVDJVb X-Received: by 2002:a05:600c:2317:: with SMTP id 23mr2321309wmo.139.1591357201526; Fri, 05 Jun 2020 04:40:01 -0700 (PDT) X-Received: by 2002:a05:600c:2317:: with SMTP id 23mr2321294wmo.139.1591357201352; Fri, 05 Jun 2020 04:40:01 -0700 (PDT) Received: from ?IPv6:2a01:cb14:499:3d00:cd47:f651:9d80:157a? ([2a01:cb14:499:3d00:cd47:f651:9d80:157a]) by smtp.gmail.com with ESMTPSA id c70sm752864wme.32.2020.06.05.04.40.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Jun 2020 04:40:00 -0700 (PDT) Subject: Re: [PATCH 4/4] objtool: orc_gen: Move orc_entry out of instruction structure To: Miroslav Benes Cc: linux-kernel@vger.kernel.org, jpoimboe@redhat.com, peterz@infradead.org, mhelsley@vmware.com References: <20200604163938.21660-1-jthierry@redhat.com> <20200604163938.21660-5-jthierry@redhat.com> From: Julien Thierry Message-ID: <3b79ffe8-dd5f-7356-ff1d-dc679ce304f7@redhat.com> Date: Fri, 5 Jun 2020 12:39:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 6/5/20 10:17 AM, Miroslav Benes wrote: > 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. > Ah, I must have messed up the patch splitting/rebasing somewhere. Thanks for pointing it out, this patch shouldn't add the check (but od allocation should happen after the existing check). I'll fix that. > Overall, the patch set is a nice improvement. > Thanks! -- Julien Thierry