lkml.org 
[lkml]   [2013]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: override __compiletime_object_size()

* Jan Beulich <JBeulich@suse.com> wrote:

> >>> On 27.11.13 at 15:03, Ingo Molnar <mingo@kernel.org> wrote:
>
> > * Jan Beulich <JBeulich@suse.com> wrote:
> >
> >> As discussed in the context of commits 3df7b41a ("x86: Unify
> >> copy_from_user() size checking") and 7a3d9b0f ("x86: Unify
> >> copy_to_user() and add size checking to it"), we want to leverage
> >> __builtin_object_size() also on newer gcc versions, but with other
> >> architectures still using another model of copy_*_user() verification
> >> we can't replace the global definition. Do it in the (only) header
> >> needing the construct for now.
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> Cc: Arjan van de Ven <arjan@linux.intel.com>
> >> Cc: Guenter Roeck <linux@roeck-us.net>
> >> ---
> >> arch/x86/include/asm/uaccess.h | 6 ++++++
> >> 1 file changed, 6 insertions(+)
> >>
> >> --- 3.13-rc1/arch/x86/include/asm/uaccess.h
> >> +++ 3.13-rc1-x86-compiletime-object-size/arch/x86/include/asm/uaccess.h
> >> @@ -584,6 +584,12 @@ __copy_from_user_overflow(int size, unsi
> >>
> >> #endif
> >>
> >> +/* linux/compiler-gcc4.h restricts this to gcc < 4.6, which doesn't suit us. */
> >> +#if defined(__GNUC__) && GCC_VERSION >= 40100
> >> +# undef __compiletime_object_size
> >> +# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
> >> +#endif
> >> +
> >
> > Would be nice to have a more verbose changelog that explains what
> > benefits this brings us.
>
> That makes no sense to me - the benefits of this construct should
> have been explained with its introduction; the change here just
> makes it being used under wider range of compilers (and the code
> comment already says exactly that).

Yes indeed - I should have read the referenced changelog...

Thanks, will apply it as-is, if there are no objections from others.

Thanks,

Ingo


\
 
 \ /
  Last update: 2013-11-27 16:01    [W:0.058 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site