lkml.org 
[lkml]   [2012]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: + syscalls-x86-add-__nr_kcmp-syscall-v8.patch added to -mm tree
From
Date
On Mon, 09 Apr 2012 15:10:27 -0700, Andrew Morton said:
> Back on to kcmp.

I've totally forgotten what my original comment(s) on this patch were.. :)

> +/*
> + * 0 - equal, i.e. v1 = v2
> + * 1 - less than, i.e. v1 < v2
> + * 2 - greater than, i.e. v1 > v2
> + * 3 - not equal but ordering unavailable (reserved for future)
> + */
> +static int kcmp_ptr(void *v1, void *v2, enum kcmp_type type)
> +{
> + long ret;
> +
> + ret = kptr_obfuscate((long)v1, type) - kptr_obfuscate((long)v2, type);

I'm not able to convince myself that "less than" and "greater than" mean
anything - do we have a good proof that for all v1 and v2, the obfuscated
pointers have the same ordering as the original pointers?

Hmm... consider the simplified example v1 = 5 and v2= 16., and cookies[0] is
also 16. Then obfus(v1) == 21, and obfus(v2) == 0, and the ordering is
different. So I'm thinking 0 and 3 are the only sane return values?

Or do I need more caffeine?

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-04-11 02:05    [W:0.149 / U:0.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site