BPF List
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Cc: bpf@vger.kernel.org, daniel@iogearbox.net, jolsa@redhat.com
Subject: Re: [PATCH v2] bpf: s390: add JIT support for multi-function programs
Date: Wed, 28 Aug 2019 11:11:39 +0200	[thread overview]
Message-ID: <C3339800-0F46-4023-AC22-A985D17AAD6B@linux.ibm.com> (raw)
In-Reply-To: <D9450184-3B41-4893-8485-4A578FAA0566@linux.ibm.com>

> Am 27.08.2019 um 18:39 schrieb Ilya Leoshkevich <iii@linux.ibm.com>:
> 
>> Am 27.08.2019 um 16:53 schrieb Yauheni Kaliuta <yauheni.kaliuta@redhat.com>:
>> 
>> @@ -1316,7 +1327,9 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
>> {
>> 	struct bpf_prog *tmp, *orig_fp = fp;
>> 	struct bpf_binary_header *header;
>> +	struct s390_jit_data *jit_data;
>> 	bool tmp_blinded = false;
>> +	bool extra_pass = false;
>> 	struct bpf_jit jit;
>> 	int pass;
>> 
>> @@ -1335,6 +1348,22 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
>> 		fp = tmp;
>> 	}
>> 
>> +	jit_data = fp->aux->jit_data;
>> +	if (!jit_data) {
>> +		jit_data = kzalloc(sizeof(*jit_data), GFP_KERNEL);
>> +		if (!jit_data) {
>> +			fp = orig_fp;
>> +			goto out;
>> +		}
>> +		fp->aux->jit_data = jit_data;
>> +	}
>> +	if (jit_data->ctx.addrs) {
>> +		jit = jit_data->ctx;
>> +		header = jit_data->header;
>> +		extra_pass = true;
>> +		goto skip_init_ctx;
>> +	}
>> +
> 
> I've noticed that I'm getting the following warning, presumably because
> of the added goto skip_init_ctx:
> 
> linux/arch/s390/net/bpf_jit_comp.c: In function 'bpf_int_jit_compile':
> linux/arch/s390/net/bpf_jit_comp.c:1406:3: warning: 'pass' may be used uninitialized in this function [-Wmaybe-uninitialized]
>   bpf_jit_dump(fp->len, jit.size, pass, jit.prg_buf);
> 
> Maybe set the initial value of pass to 1?

... or save pass in s390_jit_data and do the following?

	pass = jit_data->pass + 1;
	goto skip_init_ctx;

I've also noticed that

	$ git show --format=email | scripts/checkpatch.pl --strict

complains - could you please fix these warnings?


I've finally reviewed the actual logic of the patch, and it looks good
to me.  The integration with the common code is somewhat involved, but
it follows the established architecture.


  reply	other threads:[~2019-08-28  9:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 18:20 [RFC PATCH] bpf: s390: add JIT support for multi-function programs Yauheni Kaliuta
2019-08-27 13:21 ` Ilya Leoshkevich
2019-08-27 13:46   ` Ilya Leoshkevich
2019-08-27 14:21     ` Yauheni Kaliuta
2019-08-27 14:37       ` Ilya Leoshkevich
2019-08-27 14:48         ` Yauheni Kaliuta
2019-08-27 14:25   ` Yauheni Kaliuta
2019-08-27 14:46     ` Ilya Leoshkevich
2019-08-27 15:05       ` Yauheni Kaliuta
2019-08-27 14:53 ` [PATCH v2] " Yauheni Kaliuta
2019-08-27 16:39   ` Ilya Leoshkevich
2019-08-28  9:11     ` Ilya Leoshkevich [this message]
2019-08-28 18:28 ` [PATCH v3] " Yauheni Kaliuta
2019-08-29  8:52   ` Ilya Leoshkevich
2019-08-30 23:22   ` Daniel Borkmann

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=C3339800-0F46-4023-AC22-A985D17AAD6B@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@redhat.com \
    --cc=yauheni.kaliuta@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox