From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Date: Thu, 23 Jun 2016 20:54:27 +0200 Message-ID: <20160623185427.GP30154@twins.programming.kicks-ass.net> References: <20160623143126.GA16664@redhat.com> <20160623170352.GA17372@redhat.com> Reply-To: kernel-hardening@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Content-Disposition: inline In-Reply-To: To: Kees Cook Cc: Linus Torvalds , Oleg Nesterov , Andy Lutomirski , Andy Lutomirski , the arch/x86 maintainers , Linux Kernel Mailing List , "linux-arch@vger.kernel.org" , Borislav Petkov , Nadav Amit , Brian Gerst , "kernel-hardening@lists.openwall.com" , Josh Poimboeuf , Jann Horn , Heiko Carstens List-Id: linux-arch.vger.kernel.org On Thu, Jun 23, 2016 at 11:00:08AM -0700, Kees Cook wrote: > > Why does __mutex_lock_common() have "task" as a stack variable? That's actually a fairly common thing to do. The reason is that 'current' is far more expensive to evaluate than a local variable. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from merlin.infradead.org ([205.233.59.134]:49628 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750863AbcFWSyz (ORCPT ); Thu, 23 Jun 2016 14:54:55 -0400 Date: Thu, 23 Jun 2016 20:54:27 +0200 From: Peter Zijlstra Subject: Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Message-ID: <20160623185427.GP30154@twins.programming.kicks-ass.net> References: <20160623143126.GA16664@redhat.com> <20160623170352.GA17372@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Kees Cook Cc: Linus Torvalds , Oleg Nesterov , Andy Lutomirski , Andy Lutomirski , the arch/x86 maintainers , Linux Kernel Mailing List , "linux-arch@vger.kernel.org" , Borislav Petkov , Nadav Amit , Brian Gerst , "kernel-hardening@lists.openwall.com" , Josh Poimboeuf , Jann Horn , Heiko Carstens Message-ID: <20160623185427.8pxiF_2CCNMIw9BBYzXbDzYoc8rSRq5yQ3MVH0TWfGI@z> On Thu, Jun 23, 2016 at 11:00:08AM -0700, Kees Cook wrote: > > Why does __mutex_lock_common() have "task" as a stack variable? That's actually a fairly common thing to do. The reason is that 'current' is far more expensive to evaluate than a local variable.