Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp321573imm; Wed, 18 Jul 2018 02:45:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf86jZ6gcaVYgW/zcTqAgQVytzAXcdbcJp3Qh6v4SDRGhH3yIVGmvkNEHLc1YSMwfGPZRBe X-Received: by 2002:a62:d98f:: with SMTP id b15-v6mr4480795pfl.1.1531907143255; Wed, 18 Jul 2018 02:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531907143; cv=none; d=google.com; s=arc-20160816; b=QGE+3RmDc00Cg+LPyvxBjKNcCwv4m8p7cG0k5yTfSC6e9oU7bDeaNTr3wgB9tiagcA kMEHmtZZLdVLRINgehC86KCWsOyBN1eDB7RB0h06l6SqQBVtTv+Q6dNpZa0krVslh4PX Qr3gzOC/Pc/N6jFIpO2kETxvlZ0SghVOlH3YEAklem+5H0ymwuD6Znafhd9U5iLC5T1W LDE0IU6+k3VBwF6gbDn0u3dtszun6xn1VOYoy6gWRLFGZsfALwbUgre4RJ3o73rsHWfD tWyVt5dCLXd3B7f4hDlkm0na5+Y00FbwLB2qboLt4hGGc3gxoNwAhI+8rA/Rlv7Zvi5Z K2vw== 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=nC9WIdxDqOIQYoTQucDycLphuEcYTDVR+9B3C3v3RKU=; b=Vo+0ZZz/tYCDhvKp4QrxXRN4pp367BqlcphCn3Rbps5yfFrxZqv88onSoKRSKODmoN 9k191esR3JmLJEQqQS0AyIgmmwkoZc6hiDXfXV9cCbMfHcUDRDzaj2Icj/J1js77ppRm iCi9TY4ItwiSv+9o5fat3aJx/4OaiapotPoKWCuLH/ByKQChOYZooOrpMYy5rUMH2IHI q31XKj6qPjUupZu7Mp3mMBGsUG+iiXLJlPjJyV/63CUlxKIGbOfoe5a6ioJt88PBQo5J lSd63PEFWfPyxYbJTSrYRypjvx3o4eIOROj6B4obfDQP4byU9RxbosMJAODOuafZxFh7 EMxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=G91khPKc; 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 o16-v6si2690961pgv.402.2018.07.18.02.45.20; Wed, 18 Jul 2018 02:45:43 -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=G91khPKc; 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 S1731988AbeGRKUo (ORCPT + 99 others); Wed, 18 Jul 2018 06:20:44 -0400 Received: from 8bytes.org ([81.169.241.247]:54196 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731581AbeGRKSf (ORCPT ); Wed, 18 Jul 2018 06:18:35 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 868AA561; Wed, 18 Jul 2018 11:41:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531906881; bh=vCQiJBAHo9odqKL67p3tHtdnNwklCpEkJ6suW4Lg8AA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G91khPKcwY8cPO4eb2bwCs0BW484UQFn3DEAKLsbwXfhuk1q2vbbry+exMa9aiyTM +76f2ebu0x2o+i1Q8AQ2knFKyUTK/VrmSkq21ocMjSVzpqRT/IyHUYxqV94QpEpq7R xKD7DZ4nwCX3hGbEqg7K9dm9TFlyUKsy6U7gH195ePVHEFdYKhK6bS8w1CACjr4Ch3 CVEIAeY0vWDElRl+QyCpt1kD22LbBkSopif5HjFTpujp2zPMPQeO3xtgGN/8e5jjSR F1fKn+5B78ZUvgPM4pgszxn2hqaAgwBKOi7W8P0WMIHBdI9TgMnCr5FD2CkRDmuj1L PDywMxIf7u8cA== 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, 18 Jul 2018 11:40:48 +0200 Message-Id: <1531906876-13451-12-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531906876-13451-1-git-send-email-joro@8bytes.org> References: <1531906876-13451-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 9d6eceb..dbf7d61 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -1226,41 +1226,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