From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752019AbdKAKXx (ORCPT ); Wed, 1 Nov 2017 06:23:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:34064 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbdKAKXw (ORCPT ); Wed, 1 Nov 2017 06:23:52 -0400 Date: Wed, 1 Nov 2017 11:23:46 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , Dave Hansen , Linus Torvalds Subject: Re: [PATCH 17/18] x86/asm/64: Remove thread_struct::sp0 Message-ID: <20171101102346.vnv3bdncc6p7ke3e@pd.tnic> References: <7272938bf9f494d73f3061a052e194f763c99ce2.1509006199.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7272938bf9f494d73f3061a052e194f763c99ce2.1509006199.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 On Thu, Oct 26, 2017 at 01:26:49AM -0700, Andy Lutomirski wrote: > On x86_64, we can easily calculate sp0 when needed instead of > storing it in thread_struct. > > On x86_32, a similar cleanup would be possible, but it would require > cleaning up the vm86 code first, and that can wait for a later > cleanup series. > > Signed-off-by: Andy Lutomirski ... > @@ -816,23 +825,6 @@ static inline void spin_lock_prefetch(const void *x) > .addr_limit = KERNEL_DS, \ > } > > -/* > - * TOP_OF_KERNEL_STACK_PADDING reserves 8 bytes on top of the ring0 stack. > - * This is necessary to guarantee that the entire "struct pt_regs" > - * is accessible even if the CPU haven't stored the SS/ESP registers > - * on the stack (interrupt gate does not save these registers > - * when switching to the same priv ring). > - * Therefore beware: accessing the ss/esp fields of the > - * "struct pt_regs" is possible, but they may contain the > - * completely wrong values. > - */ Why are we removing the explaination of TOP_OF_KERNEL_STACK_PADDING? Is that going to change later? -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --