All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Thierry <jthierry@redhat.com>
To: Miroslav Benes <mbenes@suse.cz>
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
Date: Fri, 5 Jun 2020 12:39:59 +0100	[thread overview]
Message-ID: <3b79ffe8-dd5f-7356-ff1d-dc679ce304f7@redhat.com> (raw)
In-Reply-To: <alpine.LSU.2.21.2006051115020.10354@pobox.suse.cz>

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


      reply	other threads:[~2020-06-05 11:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 16:39 [PATCH 0/4] Remove dependency of check subcmd upon orc Julien Thierry
2020-06-04 16:39 ` [PATCH 1/4] objtool: Move object file loading out of check Julien Thierry
2020-06-04 16:39 ` [PATCH 2/4] objtool: Move orc outside " Julien Thierry
2020-06-04 16:39 ` [PATCH 3/4] objtool: orc: Skip setting orc_entry for non-text sections Julien Thierry
2020-06-04 16:39 ` [PATCH 4/4] objtool: orc_gen: Move orc_entry out of instruction structure Julien Thierry
2020-06-05  9:17   ` Miroslav Benes
2020-06-05 11:39     ` Julien Thierry [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b79ffe8-dd5f-7356-ff1d-dc679ce304f7@redhat.com \
    --to=jthierry@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mhelsley@vmware.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.