Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-03-01 Thread Linus Torvalds
On Fri, Mar 1, 2019 at 2:35 AM Peter Zijlstra wrote: > > With the dodgy patch: > > CC drivers/gpu/drm/i915/i915_gem_execbuffer.o > drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: > eb_relocate_slow()+0x1f9: call to kvfree() with UACCESS enabled > drivers/gpu/drm/i915/i915_gem_e

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-03-01 Thread Linus Torvalds
On Fri, Mar 1, 2019 at 4:57 AM Peter Zijlstra wrote: > > Or.. we move the thing to assembly. Of course, I suck at (writing) asm, > so the below is probably broken in various ways. Looks sane, and makes sense. I feel that the old "mixed C and asm" was much worse. My only comment is that I think y

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-03-01 Thread Andy Lutomirski
> On Mar 1, 2019, at 6:38 AM, Peter Zijlstra wrote: > >> On Fri, Mar 01, 2019 at 01:57:18PM +0100, Peter Zijlstra wrote: >>> On Fri, Mar 01, 2019 at 01:27:45PM +0100, Peter Zijlstra wrote: >>> arch/x86/lib/usercopy_64.o: warning: objtool: .altinstr_replacement+0x30: >>> redundant UACCESS disa

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-03-01 Thread Peter Zijlstra
On Fri, Mar 01, 2019 at 01:57:18PM +0100, Peter Zijlstra wrote: > On Fri, Mar 01, 2019 at 01:27:45PM +0100, Peter Zijlstra wrote: > > arch/x86/lib/usercopy_64.o: warning: objtool: .altinstr_replacement+0x30: > > redundant UACCESS disable > > > The usercopy one is difficult, that's copy_user_handl

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-03-01 Thread Peter Zijlstra
On Fri, Mar 01, 2019 at 01:27:45PM +0100, Peter Zijlstra wrote: > arch/x86/lib/usercopy_64.o: warning: objtool: .altinstr_replacement+0x30: > redundant UACCESS disable > The usercopy one is difficult, that's copy_user_handle_tail(), it is > buggered though, because that lacks notrace and thus has

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-03-01 Thread Peter Zijlstra
On Fri, Mar 01, 2019 at 11:34:52AM +0100, Peter Zijlstra wrote: > Let me do an allmodconfig build to see how much pain is caused by that > redundant CLAC warning. arch/x86/lib/usercopy_64.o: warning: objtool: .altinstr_replacement+0x30: redundant UACCESS disable drivers/gpu/drm/i915/i915_gem_exe

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-03-01 Thread Peter Zijlstra
On Thu, Feb 28, 2019 at 08:01:11PM +0100, Peter Zijlstra wrote: > On Thu, Feb 28, 2019 at 10:29:25AM -0800, Linus Torvalds wrote: > > On Thu, Feb 28, 2019 at 10:02 AM Peter Zijlstra > > wrote: > > > > > > Weird, that jump is from C, not from a .fixup table. objtool _should_ > > > see that and com

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-02-28 Thread Peter Zijlstra
On Thu, Feb 28, 2019 at 10:29:25AM -0800, Linus Torvalds wrote: > On Thu, Feb 28, 2019 at 10:02 AM Peter Zijlstra wrote: > > > > Weird, that jump is from C, not from a .fixup table. objtool _should_ > > see that and complain if there is a AC=1 path that reaches RET. > > No, unsafe_put_user() actu

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-02-28 Thread Linus Torvalds
On Thu, Feb 28, 2019 at 10:02 AM Peter Zijlstra wrote: > > Weird, that jump is from C, not from a .fixup table. objtool _should_ > see that and complain if there is a AC=1 path that reaches RET. No, unsafe_put_user() actually does the "asm goto" thing, so the jump is literally hidden as an except

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-02-28 Thread Peter Zijlstra
On Thu, Feb 28, 2019 at 06:51:14PM +0100, Peter Zijlstra wrote: > On Thu, Feb 28, 2019 at 08:49:57AM -0800, Linus Torvalds wrote: > > Yes, it is redundant (but harmlessly so) if no fault occurs. > > Oooh, there's a label hidden in unsafe_put_user()... > > And yes, objtool seems to miss that, damn

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-02-28 Thread Peter Zijlstra
On Thu, Feb 28, 2019 at 08:49:57AM -0800, Linus Torvalds wrote: > Yes, it is redundant (but harmlessly so) if no fault occurs. Oooh, there's a label hidden in unsafe_put_user()... And yes, objtool seems to miss that, damn. I'll go stare at that.

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-02-28 Thread Linus Torvalds
On Thu, Feb 28, 2019 at 7:05 AM Peter Zijlstra wrote: > > drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: > .altinstr_replacement+0x3c: redundant UACCESS disable > drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: > .altinstr_replacement+0x66: redundant UACCESS disable

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-02-28 Thread Peter Zijlstra
On Thu, Feb 28, 2019 at 03:10:44PM +, Chris Wilson wrote: > Quoting Peter Zijlstra (2019-02-28 14:54:56) > > drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: > > .altinstr_replacement+0x3c: redundant UACCESS disable > > drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool:

Re: [PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-02-28 Thread Chris Wilson
Quoting Peter Zijlstra (2019-02-28 14:54:56) > drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: > .altinstr_replacement+0x3c: redundant UACCESS disable > drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: > .altinstr_replacement+0x66: redundant UACCESS disable > > AKA. yo

[PATCH 6/8] i915,uaccess: Fix redundant CLAC

2019-02-28 Thread Peter Zijlstra
drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: .altinstr_replacement+0x3c: redundant UACCESS disable drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: .altinstr_replacement+0x66: redundant UACCESS disable AKA. you don't need user_access_end() if user_access_begin() fai