From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752375AbbDBTl4 (ORCPT ); Thu, 2 Apr 2015 15:41:56 -0400 Received: from mail.kernel.org ([198.145.29.136]:55982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751904AbbDBTlt (ORCPT ); Thu, 2 Apr 2015 15:41:49 -0400 From: Andy Lutomirski To: Ingo Molnar , X86 ML , Denys Vlasenko Cc: linux-kernel@vger.kernel.org, Andy Lutomirski Subject: [PATCH 1/2] x86_32, asm: Improve a TOP_OF_KERNEL_STACK_PADDING comment and long asm line Date: Thu, 2 Apr 2015 12:41:44 -0700 Message-Id: <41fee7bb8490ae840fe7ef2699f9c2feb932e729.1428002830.git.luto@kernel.org> X-Mailer: git-send-email 2.3.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Lutomirski At Denys' request, clean up the comment describing stack padding in the 32-bit sysenter path. This also fixes a long line of asm. No code changes. Signed-off-by: Andy Lutomirski --- arch/x86/kernel/entry_32.S | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 4c8cc34e6d68..438d19389f67 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S @@ -395,10 +395,14 @@ sysenter_past_esp: /*CFI_REL_OFFSET cs, 0*/ /* * Push current_thread_info()->sysenter_return to the stack. - * A tiny bit of offset fixup is necessary - 4*4 means the 4 words - * pushed above; +8 corresponds to copy_thread's esp0 setting. + * A tiny bit of offset fixup is necessary: TI_sysenter_return + * is relative to thread_info, which is at the bottom of the + * kernel stack page. 4*4 means the 4 words pushed above; + * TOP_OF_KERNEL_STACK_PADDING takes us to the top of the stack; + * and THREAD_SIZE takes us to the bottom. */ - pushl_cfi ((TI_sysenter_return)-THREAD_SIZE+TOP_OF_KERNEL_STACK_PADDING+4*4)(%esp) + pushl_cfi ((TI_sysenter_return) - THREAD_SIZE + \ + TOP_OF_KERNEL_STACK_PADDING + 4*4)(%esp) CFI_REL_OFFSET eip, 0 pushl_cfi %eax -- 2.3.0