From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752948AbdGLWfx (ORCPT ); Wed, 12 Jul 2017 18:35:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34256 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751036AbdGLWfv (ORCPT ); Wed, 12 Jul 2017 18:35:51 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EEA51624BB Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com EEA51624BB Date: Wed, 12 Jul 2017 17:35:47 -0500 From: Josh Poimboeuf To: Matthias Kaehlcke Cc: Chris J Arges , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Douglas Anderson , Michael Davidson , Greg Hackmann , Nick Desaulniers , Stephen Hines , Kees Cook , Arnd Bergmann , Bernhard.Rosenkranzer@linaro.org Subject: Re: [PATCH] Revert "x86/uaccess: Add stack frame output operand in get_user() inline asm" Message-ID: <20170712223547.fyra43dizqooosbs@treble> References: <20170712212744.23660-1-mka@chromium.org> <20170712221242.puv5illztsla4nph@treble> <20170712222040.GD95735@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170712222040.GD95735@google.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 12 Jul 2017 22:35:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 12, 2017 at 03:20:40PM -0700, Matthias Kaehlcke wrote: > > This is admittedly an awkward way of achieving this goal, but it's the > > only way I know how to do it with GCC. > > > > What extra instruction does clang add? > > I was looking at the get_user() call in drm_mode_setcrtc(). The code > generated by clang without the patch is: > > if (get_user(out_id, &set_connectors_ptr[i])) { > ffffffff81386955: 4a 8d 04 bd 00 00 00 lea 0x0(,%r15,4),%rax > ffffffff8138695c: 00 > ffffffff8138695d: 49 03 06 add (%r14),%rax > ffffffff81386960: e8 2b a5 f0 ff callq ffffffff81290e90 <__get_user_4> > > And with the patch: > > if (get_user(out_id, &set_connectors_ptr[i])) { > ffffffff81386a56: 4a 8d 04 bd 00 00 00 lea 0x0(,%r15,4),%rax > ffffffff81386a5d: 00 > ffffffff81386a5e: 49 03 06 add (%r14),%rax > ffffffff81386a61: 48 8b 64 24 28 mov 0x28(%rsp),%rsp > ffffffff81386a66: e8 15 a5 f0 ff callq > ffffffff81290f80 <__get_user_4> Hm, that seems odd. Can you sure the disassembly for the whole function? -- Josh