Received: by 10.192.165.148 with SMTP id m20csp3586240imm; Mon, 23 Apr 2018 08:58:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx49k+7OsMp4lROGc72+xionOOFkMcIPTHE+asrmbKvk6BmFf88v3JxY/CF0hyV+BDOnrarqf X-Received: by 10.98.108.69 with SMTP id h66mr20496470pfc.43.1524499083045; Mon, 23 Apr 2018 08:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524499083; cv=none; d=google.com; s=arc-20160816; b=jQtNPYhrrzhAArwwJ0B4uP/9z2p2gpzAaRYlWzVszxtwormjUQMKlMOx0PXC+5/fpJ PpciU/KKf8BPI36g1fL5pMtvVSwFUZwNxnLDb3XXQwx142UsKf4u6YhQvwNBScl+Ugdx +Z1SgSo3UpwNPEsHoV7pi2LlLGTtImU2L4zH2lMzQw1tRNjeumpEpgJtzD43edPjnoCp 8PAet8IULbWSAd1YKImgC7bAKKiTAD02+owgd7R5Z0KRicJ7CeKMi4xdM3H1ZlcaviLW pXYlM3HCBlD5PF+B7d3bB4ixBz/7CMbPlgeebhPUUNiUbcGMVoYyYRcpeZ6wBQ64POAm g67A== 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=rTwp+7cyC+ifomD+bjEqgAZMZ9DruB4hIDWDUgoZRqs=; b=qLi5Tlc6FynBz5isFsi8tYyKQuqJ/SgoLpLA569QyMDAZdlFkS6pi0fXGaz/mm+EHz 9cqG5lPTVuiiGRkpq0LUFHEb3Dbyg4v5+6GI+fY96YALA5HHNTQfiZt93t6kH0QMbiLy UbqdWjS4xm7nvhuS7V86rPHM90MAD7GZvaW4uzwvsAlSTd2ENBij/2v2VdmgPXVQEhco dS9iR+8mkSXCEQg8nv0LDsLqxVTMveCIgEg5bGgRLcGG9y7CPfRJ6hp4J2hOPSk42Nad VGJ/TpfhyNFNLN8jPlsbiqwvifDj1YZt9GgKRSykHlec30Ne8SW0s2SU/jriM72t2zVi p1JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=pIfyFSb6; 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 q2-v6si11672500plh.259.2018.04.23.08.57.48; Mon, 23 Apr 2018 08:58:03 -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=pIfyFSb6; 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 S932272AbeDWPy4 (ORCPT + 99 others); Mon, 23 Apr 2018 11:54:56 -0400 Received: from 8bytes.org ([81.169.241.247]:60748 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755663AbeDWPrz (ORCPT ); Mon, 23 Apr 2018 11:47:55 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 796BD7B5; Mon, 23 Apr 2018 17:47:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1524498465; bh=JPXY5Mdkj2uEhvyp38oHEf74B22kdftqLK+rsl8y0M8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pIfyFSb6EzvlgSrGhPHKFe2BEDsBECH2z26dwAoQrZmM/GiJbRxPbMUhq6FoynzJP Tw2gmBZnKIxoparEMFGIT/yMheBOfHM9Wns5y4w0t1k5zl3gUdQGma5LTsmfoQeZl1 Kh3luqaCFe1s0h9W5svJs/kUmbZ6lyttIxYxdsfu4eCHwDVPGDIPUBYLWvqhaoba/f 19VK2NfvxrPbND1zON+rya6FMa4VJlDVvtMfFtVB/Uk8WdajIHxy4U7U1cgZRxY4fz eCqR1FX8kZJQENt6wBo671T7XC/Z3zARUkjvLIgRvuCsVzApqEGaNqylm1M9QDSByC RtxKNn7Izyoyg== 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/37] x86/entry/32: Simplify debug entry point Date: Mon, 23 Apr 2018 17:47:14 +0200 Message-Id: <1524498460-25530-12-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524498460-25530-1-git-send-email-joro@8bytes.org> References: <1524498460-25530-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 b3477ff..71e1cb3 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