Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965254AbdGTPSU (ORCPT ); Thu, 20 Jul 2017 11:18:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47936 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964876AbdGTPSS (ORCPT ); Thu, 20 Jul 2017 11:18:18 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6A3E03D940 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6A3E03D940 Date: Thu, 20 Jul 2017 10:18:13 -0500 From: Josh Poimboeuf To: Andrey Ryabinin Cc: Matthias Kaehlcke , Chris J Arges , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , "x86@kernel.org" , LKML , Douglas Anderson , Michael Davidson , Greg Hackmann , Nick Desaulniers , Stephen Hines , Kees Cook , Arnd Bergmann , Bernhard =?utf-8?Q?Rosenkr=C3=A4nzer?= Subject: Re: [PATCH] Revert "x86/uaccess: Add stack frame output operand in get_user() inline asm" Message-ID: <20170720151813.5wnpsb5wy7bqrpec@treble> References: <20170712232213.GE95735@google.com> <20170713180001.mvwzdmudht56hdk5@treble> <20170713184748.GF95735@google.com> <75850bb7-a60e-057d-d88b-afa0c79e94a0@gmail.com> <20170713203416.isvijqbwbcgupgj7@treble> <20170713211245.GG95735@google.com> <20170713213406.gx4ixkx6kxa4ppps@treble> <20170713215704.GJ95735@google.com> <20170719174630.kz5g553evcrnirmr@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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.30]); Thu, 20 Jul 2017 15:18:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1007 Lines: 26 On Thu, Jul 20, 2017 at 01:01:39PM +0300, Andrey Ryabinin wrote: > 2017-07-19 20:46 GMT+03:00 Josh Poimboeuf : > > > > > After doing some testing, I don't think this approach is going to work > > after all. In addition to forcing the stack frame, it also causes GCC > > to add an unnecessary extra instruction to the epilogue of each affected > > function: > > > > lea -0x10(%rbp),%rsp > > > > We shouldn't be inserting extra instructions like that. I also don't > > think the other suggestion of turning the '__sp' register variable into > > a global variable is a very good solution either, as that just wastes > > memory for no reason. > > > > Wastes memory? How is that wastes memory? That doesn't make any sense. Yes, you're right, that doesn't make any sense. I think I was trying to wrap my head around what it means to have a global register variable -- in a header file no less -- and why clang would treat that differently than a local register variable. -- Josh