Received: by 10.223.185.116 with SMTP id b49csp2589275wrg; Mon, 5 Mar 2018 05:39:27 -0800 (PST) X-Google-Smtp-Source: AG47ELsZGo+FGwFvYlyVMVXpingdwG4/OS+fdmBTAapXGwntaDhDLQ5mDp6Xu6xdUMbwrVJi1pTY X-Received: by 2002:a17:902:b43:: with SMTP id 61-v6mr13617866plq.270.1520257167160; Mon, 05 Mar 2018 05:39:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520257167; cv=none; d=google.com; s=arc-20160816; b=rwtoM9X1uGhSwWHA3w85T/9KaQ0gIYjpUtSoywkMhhw2Ec9ZxhMqmlGzLrd388iXEI F8afS2hO9iX6U7isCJq3euQ/6TgZLLPHHXSfcDio3LKqARQyUn+FQp99wZc2ZP3zpm5Q UnbOZevkGmp8RDS9tTncePIruGihoxz5IZRUTx82qqci/WXGmrAklwpSPUMNZmYLGxzJ t/eKoasfTtYcWV+OdhiLp7jEme3FTBqwu62SJE3W6wWcPvRr42GPdYHprV3o4pKN/fm6 hWBGPRk/Pb3eBQy4pAF0onjhs5RaBlS0TXIsphulAeLOmboBskFj6Z3wok86QSaNg7vk O5Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=bee9tXo+hRrFajk/kdCRhIPd4RZwBk3eFmYPaaGYwNU=; b=UZw9eITSl9ysStrR49LeGzgdoTIYopqc3/atgKnguXSWoi1Pqmy0WK0EPALTF/ubIF rSY6EHNrGx13hJ+1HO8wZqOdUPefMnR/waKUvESPYWG2b48QEzSqPhbK8dwzjvNP/elx XV0hcQ0CMIQZBX0SbYONxE16sWsvvUHoXpT7zQv+22sTTWE+dUnaKkIk6WM+NXmVskkA 6bEidDwkk3uw7ox0n6FDgdYE8bzb5bbB6V9HQTIofjuLqB9NIG1tRXJeo42lfUv896Yc wdZdqbTlIOeprIfjMevAPuV59lk+zMyZJpDvw5ua9sRW3zbUVohjSVO0da/aYI5Yc/wH XZMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=jS5r6B1+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t64si8368848pgd.435.2018.03.05.05.39.10; Mon, 05 Mar 2018 05:39:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=jS5r6B1+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934245AbeCEKca (ORCPT + 99 others); Mon, 5 Mar 2018 05:32:30 -0500 Received: from 8bytes.org ([81.169.241.247]:54586 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933742AbeCEK0O (ORCPT ); Mon, 5 Mar 2018 05:26:14 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 0A36C8EB; Mon, 5 Mar 2018 11:26:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1520245567; bh=HU/pxxBDvcZsM4ZY+I6BTc/XfaZtLTIupcT8U7QHxfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jS5r6B1+mdKIVslgajaWd9G6TSVo/zcAerNUaBtsFiLI/nwL3Q8kxWTyt968s+gn4 CoYwiJncZjFB7btrBvDvRmNyUASsRc+KQSmwNxtI39sUVjYjUvbJrcow6hJZLqAw5d LuBfZY3zxdF25IUWVMtz/Rf0hUAjyYAGlodcUDW4iZCwllgy427/y51kC5heA/hO5C 32Vnx4Yh47qBNXloWnB09rluO0fJ7blWE17bfhQUPiVsQpj22RSwzLaBTiDjv64n1Z gwEIsuiZ9Bw4WlPNfLcbNUMTiaDseZD2OJbgSoBPVhtrsdZB6/eJO0IHzxynCHDlL1 xM8I6JfIyxcBQ== From: Joerg Roedel To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , Pavel Machek , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 12/34] x86/entry/32: Simplify debug entry point Date: Mon, 5 Mar 2018 11:25:41 +0100 Message-Id: <1520245563-8444-13-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520245563-8444-1-git-send-email-joro@8bytes.org> References: <1520245563-8444-1-git-send-email-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel The common exception entry code now handles the entry-from-sysenter stack situation and makes sure to leave with the same stack as it entered the kernel. So there is no need anymore for the special handling in the debug entry code. Signed-off-by: Joerg Roedel --- arch/x86/entry/entry_32.S | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index 3a84945..b1a5f34ee 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -1215,41 +1215,12 @@ END(common_exception) ENTRY(debug) /* - * #DB can happen at the first instruction of - * entry_SYSENTER_32 or in Xen's SYSENTER prologue. If this - * happens, then we will be running on a very small stack. We - * need to detect this condition and switch to the thread - * stack before calling any C code at all. - * - * If you edit this code, keep in mind that NMIs can happen in here. + * Entry from sysenter is now handled in common_exception */ ASM_CLAC pushl $-1 # mark this as an int - - SAVE_ALL - ENCODE_FRAME_POINTER - xorl %edx, %edx # error code 0 - movl %esp, %eax # pt_regs pointer - - /* Are we currently on the SYSENTER stack? */ - movl PER_CPU_VAR(cpu_entry_area), %ecx - addl $CPU_ENTRY_AREA_entry_stack + SIZEOF_entry_stack, %ecx - subl %eax, %ecx /* ecx = (end of entry_stack) - esp */ - cmpl $SIZEOF_entry_stack, %ecx - jb .Ldebug_from_sysenter_stack - - TRACE_IRQS_OFF - call do_debug - jmp ret_from_exception - -.Ldebug_from_sysenter_stack: - /* We're on the SYSENTER stack. Switch off. */ - movl %esp, %ebx - movl PER_CPU_VAR(cpu_current_top_of_stack), %esp - TRACE_IRQS_OFF - call do_debug - movl %ebx, %esp - jmp ret_from_exception + pushl $do_debug + jmp common_exception END(debug) /* -- 2.7.4