public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
To: Shachar Raindel <raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Alexey Ishchuk
	<aishchuk-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"blaschka-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org"
	<blaschka-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	"gmuelas-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org"
	<gmuelas-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>,
	"utz.bacher-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org"
	<utz.bacher-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>,
	"roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Alexey Ishchuk
	<alexey_ishchuk-JgLE2wv1ufrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 1/3] s390/kernel: add system calls for access PCI memory
Date: Mon, 13 Oct 2014 10:39:45 +0200	[thread overview]
Message-ID: <20141013103945.27be11ef@mschwide> (raw)
In-Reply-To: <f061a36c713c42c9b71530183a6e8644-Vl31pUvGNwELId+1UC+8EGu6+pknBqLbXA4E9RH9d+qIuWR1G4zioA@public.gmane.org>

On Sun, 12 Oct 2014 11:52:55 +0000
Shachar Raindel <raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:

> > +	switch (length) {
> > +	case 1:
> > +		ret = get_user(value.buf8, ((u8 *)user_buffer));
> 
> This cast (and similar casts across the code) kills the __user
> annotation of the user buffer pointer.
> First - fix this to help various static verification tools such
> as sparse work on your code.
> Second - are you sure this switch-case block achieves any
> performance gain compared to always using copy_from_user?
> If so, why not just push it into the S390 copy from user code?

The __user annotation is indeed missing. If the switch is improving
performance needs to be seen, with the compile options set for z10
the get_user is inlined while the copy_from_user calls a function.
For compiles < z10 all 5 switch cases will call the same
__copy_from_user function. So it depends, as long as the switch is
correct I am ok the code block for now.
 
> > +	switch (length) {
> > +	case 1:
> > +		value.buf8 = __raw_readb(io_addr);
> > +		ret = put_user(value.buf8, ((u8 *)user_buffer));
> 
> Add __user annotations in this code block as well.

Yes, please add.

> Generally speaking, looks OK once the __user annotation is added.
> 
> I suspect you might need ack/review from the S390 maintainer as
> well for this to be pushed, as the syscall is generic to the
> entire S390 subsystem.

With the missing __user annotations added:
Acked-by: Martin Schwidefsky <schwidefsky-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-10-13  8:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  9:34 [PATCH 0/3] DAPL support on s390x platform Alexey Ishchuk
     [not found] ` <1412933657-52641-1-git-send-email-aishchuk-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2014-10-10  9:34   ` [PATCH 1/3] s390/kernel: add system calls for access PCI memory Alexey Ishchuk
     [not found]     ` <1412933657-52641-2-git-send-email-aishchuk-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2014-10-12 11:52       ` Shachar Raindel
     [not found]         ` <f061a36c713c42c9b71530183a6e8644-Vl31pUvGNwELId+1UC+8EGu6+pknBqLbXA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-10-13  8:39           ` Martin Schwidefsky [this message]
2014-10-10  9:34   ` [PATCH 2/3] libibverbs: add support for the s390x platform Alexey Ishchuk
2014-10-10  9:34   ` [PATCH 3/3] libmlx4: " Alexey Ishchuk
2014-11-05 15:04   ` [PATCH 0/3] DAPL support on " Utz Bacher
     [not found]     ` <OF2939B020.E253C5B0-ONC1257D87.0050AE0F-C1257D87.0052C3AA-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2014-11-11 23:22       ` Roland Dreier
     [not found]         ` <CAL1RGDVLeNCAXrrq8mEhKxcm_z_xwgLUfO_wzhQE9xJz8Lnq7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12  9:34           ` Martin Schwidefsky
2014-11-12 12:38           ` Yishai Hadas
     [not found]             ` <546354D9.9050601-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-12-10 16:27               ` Utz Bacher
     [not found]                 ` <OFA12CE4AE.0DA527AB-ONC1257DAA.0057DC75-C1257DAA.005A6BB7-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2014-12-12  8:19                   ` Martin Schwidefsky

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=20141013103945.27be11ef@mschwide \
    --to=schwidefsky-ta70fqpds9bqt0dzr+alfa@public.gmane.org \
    --cc=aishchuk-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=alexey_ishchuk-JgLE2wv1ufrQT0dZR+AlfA@public.gmane.org \
    --cc=blaschka-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=gmuelas-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=utz.bacher-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox