From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755325AbdKBJsT (ORCPT ); Thu, 2 Nov 2017 05:48:19 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:49835 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752560AbdKBJsR (ORCPT ); Thu, 2 Nov 2017 05:48:17 -0400 X-Google-Smtp-Source: ABhQp+RYeZ1i96VWj1eAEPsqwuHkli8Z2cd+CPM8JWqKX6W/DSsBpOc7DEQeE7qjqXYS0PJc6oP/7Q== Date: Thu, 2 Nov 2017 10:48:13 +0100 From: Ingo Molnar To: Andy Lutomirski Cc: X86 ML , Borislav Petkov , "linux-kernel@vger.kernel.org" , Brian Gerst , Dave Hansen , Linus Torvalds Subject: Re: [PATCH v2 13/20] x86/asm/64: Pass sp0 directly to load_sp0() Message-ID: <20171102094813.idw77gu2rarcu4zq@gmail.com> References: <2655d8b42ed940aa384fe18ee1129bbbcf730a08.1509609304.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2655d8b42ed940aa384fe18ee1129bbbcf730a08.1509609304.git.luto@kernel.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andy Lutomirski wrote: > load_sp0() had an odd signature: > > void load_sp0(struct tss_struct *tss, struct thread_struct *thread); > > Simplify it to: > > void load_sp0(unsigned long sp0); I also added this to the changelog: > Also simplify a few get_cpu()/put_cpu() sequences to > preempt_disable()/preempt_enable(). Plus: > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel/cpu/common.c > @@ -1572,7 +1572,7 @@ void cpu_init(void) > initialize_tlbstate_and_flush(); > enter_lazy_tlb(&init_mm, me); > > - load_sp0(t, ¤t->thread); > + load_sp0(current->thread.sp0); > set_tss_desc(cpu, t); > load_TR_desc(); > load_mm_ldt(&init_mm); > @@ -1627,7 +1627,7 @@ void cpu_init(void) > initialize_tlbstate_and_flush(); > enter_lazy_tlb(&init_mm, curr); > > - load_sp0(t, thread); > + load_sp0(thread->sp0); > set_tss_desc(cpu, t); > load_TR_desc(); > load_mm_ldt(&init_mm); In the 32-bit path this was the last use of 'thread', making the local variable unused - I removed it. Just curious: did you build/boot-test 32-bit kernels, or should we consider it mostly untested? Thanks, Ingo