Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1474705

RE: [PATCH v5 4/8] char: rpmb: provide a user space interface

From "Winkler, Tomas" <tomas.winkler@intel.com>
Newsgroups linux.kernel
Subject RE: [PATCH v5 4/8] char: rpmb: provide a user space interface
Date 2016-09-01 23:50 +0200
Message-ID <scHpg-70l-43@gated-at.bofh.it> (permalink)
References <rWnkS-2Af-19@gated-at.bofh.it> <rWnkS-2Af-33@gated-at.bofh.it> <s2TBn-3Q8-1@gated-at.bofh.it> <s3sSt-21l-5@gated-at.bofh.it> <scbfH-1kx-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> 
> On Sun, Aug 07, 2016 at 09:44:03AM +0000, Winkler, Tomas wrote:
> > >
> > > On Mon 2016-07-18 23:27:49, Tomas Winkler wrote:
> > > > The user space API is achieved via two synchronous IOCTL.
> > >
> > > IOCTLs?
> >
> > Will fix
> >
> > > > Simplified one, RPMB_IOC_REQ_CMD, were read result cycles is
> > > performed
> > > > by the framework on behalf the user and second, RPMB_IOC_SEQ_CMD
> > > where
> > > > the whole RPMB sequence including RESULT_READ is supplied by the
> caller.
> > > > The latter is intended for  easier adjusting  of the  applications
> > > > that use MMC_IOC_MULTI_CMD ioctl.
> > >
> > > Why "  "?
> > Not sure I there is enough clue in your question.
> > >
> > > >
> > > > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> > >
> > > > +
> > > > +static long rpmb_ioctl(struct file *fp, unsigned int cmd,
> > > > +unsigned long arg) {
> > > > +	return __rpmb_ioctl(fp, cmd, (void __user *)arg); }
> > > > +
> > > > +#ifdef CONFIG_COMPAT
> > > > +static long rpmb_compat_ioctl(struct file *fp, unsigned int cmd,
> > > > +			      unsigned long arg)
> > > > +{
> > > > +	return	__rpmb_ioctl(fp, cmd, compat_ptr(arg));
> > > > +}
> > > > +#endif /* CONFIG_COMPAT */
> > >
> > > Description of the ioctl is missing,
> > Will add.
> >
> > and it should certainly be designed in a way
> > > that it does not need compat support.
> >
> > The compat_ioctl handler just casts the compat_ptr, I believe this
> > should be done unless the ioctl is globaly registered in
> > fs/compat_ioctl.c, but I might be wrong.
> 
> You shouldn't need a compat ioctl for anything new that is added, unless
> your api is really messed up.  Please test to be sure, and not use a compat
> ioctl at all, it isn't that hard to do.

compat_ioctl is called anyhow when CONFIG_COMPAT is set, there is no way around it, or I'm missing something?
Actually there is no more than that for the COMPAT support in this code.

Thanks
Tomas

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH v5 4/8] char: rpmb: provide a user space interface Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-08-31 12:50 +0200
  Re: [PATCH v5 4/8] char: rpmb: provide a user space interface Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-01 23:10 +0200
    Re: [PATCH v5 4/8] char: rpmb: provide a user space interface Pavel Machek <pavel@ucw.cz> - 2016-09-04 22:30 +0200
      RE: [PATCH v5 4/8] char: rpmb: provide a user space interface "Winkler, Tomas" <tomas.winkler@intel.com> - 2016-09-04 23:00 +0200
  RE: [PATCH v5 4/8] char: rpmb: provide a user space interface "Winkler, Tomas" <tomas.winkler@intel.com> - 2016-09-01 23:50 +0200

csiph-web