Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp397874imm; Wed, 11 Jul 2018 04:34:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdKLQFNOCW9vvomte0yrTK7EvERs9CDDBP+CLuXMQuwOJbkTDaBC4eMlthbt/1zKSnGab1W X-Received: by 2002:a17:902:1e6:: with SMTP id b93-v6mr28630651plb.149.1531308870940; Wed, 11 Jul 2018 04:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531308870; cv=none; d=google.com; s=arc-20160816; b=pBsdsQ2s2neJJVPVdSF/X/jDsuDJZwidtTb6cdCij0lDk9YEXY3muavp3+0VcWkGgV hPCBd259h+QtNnhOweN+IMeWRx4rYiyl8jfC5wmRkmq0Xgn2j7KGX8G7/taIVJHbrhFR UNC3mZ7reE5v2afJ7JHuzbD6hHkijw3pmQXNeEpZwV8dsQEw+DXdnj3hXFe89p0b6zBl 2YuJNEClq8lcTKT18WzEQftEMenZVBq51lGompsPr26pgcycO9qFOjcFHdaN3wX38MvB KDVReLeqtnd5Rl2IIg63JqmxXFZfOu6jSiIOee+GEaH5AdnzkJ/fgoamYSiU/RwKNsmy f/zg== 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=KO3a4tNMKEtYvVRcye+vTJ7oXt2YWhAD1vV1A23bt+I=; b=t7osd+iA+8aTy8+xtKvx6F/4Zjbjp8d3oCGY6frcU5H/mkMzefL+g+2ODAJ+mM4u+y PcJFbrW2KzqBVCOxODTIPZbiAQ5xGOQQWctMJi9THRL05Vxa6yeUrQ+aTFKnOrUDb072 Q92AtUJyOrsjqyvzHkNUcJxnFlEMDBFZ0R42dKqs378xWeke93ZS3vYfJ+SIJbBCGyso useTvtQQcqkcf8v8lPypv7k1JPxQS5xK0VDyiDh/Q9ZRlNa9gREfkAX6XL07HC9tI/2w 8avqzkQAxq6TFWeMH1phWRpwSiozdljtWkAGTG8vS+E8yQ4BZDFhcflXLaDx/7FYoeaQ D4Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b="F/mcCPY/"; 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 c10-v6si303837pgm.451.2018.07.11.04.34.16; Wed, 11 Jul 2018 04:34:30 -0700 (PDT) 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="F/mcCPY/"; 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 S1733222AbeGKLhC (ORCPT + 99 others); Wed, 11 Jul 2018 07:37:02 -0400 Received: from 8bytes.org ([81.169.241.247]:37770 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732852AbeGKLeD (ORCPT ); Wed, 11 Jul 2018 07:34:03 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 2CF598B1; Wed, 11 Jul 2018 13:30:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531308602; bh=edaOoRH1/0g7yT1fD0rMb0NSinyNKWJqXKJaWXIVrCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F/mcCPY/CySzCJ7WIUswZwu/0O5tDs4armRlmpgrlxoYqBQvJBA6atz+ljbSyVAYc 5oO0rydcbo0tgLeIOaouBYqCxdDfzFn7SQPjTe8I8h40FQraQsd1sq7k7Y0I1EDvir I68OKWwA5rjQfKbLXl28AHafoUWZMeEM/83rYr1LAk7Es2QGOPBuLuwoVBKbN+Oumr ZxK/eI8rbOaic0ZLP8x9W7iVOE50TsDJiP7fU9RNI4Yr1WrF+3Fc27QfH71KIrad0F iis91AhtY2uK7lVMGQeT272dFfXXj6WOpkLC9Jx4W0RFw7n/2x3D5hXdboRUn154/b CRnYAZS4KP+Jg== 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 , "David H . Gutteridge" , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 11/39] x86/entry/32: Simplify debug entry point Date: Wed, 11 Jul 2018 13:29:18 +0200 Message-Id: <1531308586-29340-12-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531308586-29340-1-git-send-email-joro@8bytes.org> References: <1531308586-29340-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 b3af76e..9e06431 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -1231,41 +1231,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