From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753348AbbCDWNG (ORCPT ); Wed, 4 Mar 2015 17:13:06 -0500 Received: from mail-wg0-f49.google.com ([74.125.82.49]:43565 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753241AbbCDWNE (ORCPT ); Wed, 4 Mar 2015 17:13:04 -0500 Date: Wed, 4 Mar 2015 23:12:58 +0100 From: Ingo Molnar To: Andy Lutomirski Cc: X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , Oleg Nesterov , Denys Vlasenko , Linus Torvalds Subject: Re: [RFC 1/3] x86: Add this_cpu_sp0() to read sp0 for the current cpu Message-ID: <20150304221258.GA22826@gmail.com> References: <385661f737a3c430ee2fb50e1531ae002fa263a0.1424994489.git.luto@amacapital.net> <20150304080210.GA12265@gmail.com> <20150304203958.GA7247@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski wrote: > On Wed, Mar 4, 2015 at 12:39 PM, Ingo Molnar wrote: > > > > * Andy Lutomirski wrote: > > > >> On Wed, Mar 4, 2015 at 12:02 AM, Ingo Molnar wrote: > >> > > >> > * Andy Lutomirski wrote: > >> > > >> >> We currently store references to the top of the kernel stack in > >> >> multiple places: kernel_stack (with an offset) and > >> >> init_tss.x86_tss.sp0 (no offset). The latter is defined by hardware > >> >> and is a clean canonical way to find the top of the stack. Add an > >> > > >> > Btw., 'per_cpu(init_tss)' is a somewhat misleading name these days, as > >> > there's nothing 'init' about it anymore - we load it during CPU init > >> > and then manually maintain its contents. A better name would be > >> > 'current_tss' - referring to both the current CPU and the current > >> > task? > >> > >> Hmm. That seems a little odd to me, since we never change the TSS > >> pointer. It's certainly better than init_tss, though. I'll add a > >> followup to rename it. > > > > Alternatively we could use 'cpu_tss': the CPU's current TSS. > > I painted my bikeshed "singleton_tss", since cpu_tss seemed > redundant for something that's already per cpu. If you prefer your > bikeshed color, let me know. Yeah, name it *anything* but 'singleton'!! /me gets sick of design patterns ;-) Thanks, Ingo