[RFC v2] Decode UFFDIO_* ioctls
Dmitry V. Levin
ldv at altlinux.org
Fri May 6 01:00:49 UTC 2016
On Wed, May 04, 2016 at 06:42:52PM +0100, Dr. David Alan Gilbert wrote:
> * Dmitry V. Levin (ldv at altlinux.org) wrote:
> > On Wed, May 04, 2016 at 06:00:58PM +0100, Dr. David Alan Gilbert wrote:
> > > * Dmitry V. Levin (ldv at altlinux.org) wrote:
> > > > On Tue, May 03, 2016 at 08:23:43PM +0100, Dr. David Alan Gilbert wrote:
> > > > [...]
> > > > > > > --- /dev/null
> > > > > > > +++ b/xlat/uffd_register_ioctl_flags.in
> > > > > > > @@ -0,0 +1,5 @@
> > > > > > > +#val_type uint64_t
> > > > > > > +1<< _UFFDIO_WAKE
> > > > > > > +1<< _UFFDIO_COPY
> > > > > > > +1<< _UFFDIO_ZEROPAGE
> > > > > > > +
> > > > > >
> > > > > > gen.sh doesn't handle space characters after 1<< properly (yet).
> > > > > > git am complains about empty line at EOF.
> > > > >
> > > > > Fixed. Hmm, I've removed the spaces, but the output I'm getting is:
> > > > > [pid 9644] ioctl(20, UFFDIO_REGISTER{range={start=0x7ff674200000, len=0x40000}, mode=UFFDIO_REGISTER_MODE_MISSING, ioctls=_UFFDIO_WAKE|_UFFDIO_COPY|_UFFDIO_ZEROPAGE}) = 0
> > > > >
> > > > > shouldn't I be seeing 1ull<<_UFFDIO_WAKE | 1ull << _UFFDIO_COPY etc?
> > > >
> > > > We have just a few users of this feature, and these users seem to be OK
> > > > with the current behaviour, which means we probably need another syntax
> > > > for this case.
> > >
> > > Hmm this is confusing; I see icmp flags are one of the options;
> > > so strace ping:
> > >
> > > setsockopt(3, SOL_RAW, ICMP_FILTER, ~(ICMP_ECHOREPLY|ICMP_DEST_UNREACH|ICMP_SOURCE_QUENCH|ICMP_REDIRECT|ICMP_TIME_EXCEEDED|ICMP_PARAMETERPROB), 4) = 0
> > >
> > > if we look at the source for ping:
> > > struct icmp_filter filt;
> > > filt.data = ~((1<<ICMP_SOURCE_QUENCH)|
> > > (1<<ICMP_DEST_UNREACH)|
> > > (1<<ICMP_TIME_EXCEEDED)|
> > > (1<<ICMP_PARAMETERPROB)|
> > > (1<<ICMP_REDIRECT)|
> > > (1<<ICMP_ECHOREPLY));
> > > if (setsockopt(icmp_sock, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt)) == -1)
> > >
> > > so I reckon the current decode is wrong; however, it is more readable
> > > and if we prefer readable I'm happy to stick with it.
> >
> > I think the output should be both correct and readable
> > so parser of ICMP_FILTER argument needs a fix.
>
> Right, so I think if you just change the gen.sh, the ICMP code and the
> capget code (that suffers in the same way) will both be fixed.
Indeed. Should be fixed now.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20160506/4f316254/attachment.bin>
More information about the Strace-devel
mailing list