Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2250864imm; Thu, 19 Jul 2018 16:27:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpek353SMAT2KaF7qqIN910Uu9Trs6tU2SjyCqhTFwwhF4BlhnsOKeyztDtmDoup9v0+81x8 X-Received: by 2002:a62:c0a:: with SMTP id u10-v6mr11370298pfi.43.1532042828047; Thu, 19 Jul 2018 16:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532042828; cv=none; d=google.com; s=arc-20160816; b=E9BqMCXf95PJLcxmDnxQiR4tjfuesLIBOzIaAveCnH8qZAV/Z8Rwp8xWbPLn82p2ds HdDYUXNJJOVlSb+kJLMyFVVtiqrpNy1T8Rt+5fT92kVHhTrR9D1E8F0c/t/o4RO8BHSa MNKZ0hWGZAhRoNJxp0pA1SBvwefpSiB7DGtBtbH2cYHY+Tg5U9YBRSWUXyW8F7vo+dNx twBxu8pVK7tkb0KIcoAoEYsoARsXbiYWKmEehaNSkNhNVw5cEAIW6jj2ZOIi1bAZ+Ru7 r4zyKi8+eltIV2nN2b/Llk0SCNxD0q07oi3na9bZJ/YrDGKMbAuTrFTgkvm1B6wJZTLH e9xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=cVFo8RxOepEEdCtfiEz9gczM8A2QZ9RHryJ5TbDOJDc=; b=S3WURX7NqUe6UIcNZpDrdxsemjQqBa+TVyc7zKOgPmfClZx4QX8NCwt+RaBPL/Mrr+ OfjNiFMUBr5t0HMjVy8Z714J21HrLrW43jvN4ZM+PZKcVPbQ4lw5f68+d/AorZSlvBeQ zkmWbONdLoPRKYIet1xZLT73NHG7dWZWJe17wkYDJnyv+wNvPxnCBLISR8TD7PkDByMl L/QhAu0EqfwFA+dX5CHvz+tJU9jgZeGU3tUn4eg1b9vmrXyJZl9hBA9952dHulbgzgcE gyTDi/mDT+0JWRXLJO3H1u4HZ9nji8jsg3O5RpkWx9aHB+wniStLTo7j+lEgBSJDWbZr V6/A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j61-v6si373125plb.68.2018.07.19.16.26.53; Thu, 19 Jul 2018 16:27:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731201AbeGTAKc (ORCPT + 99 others); Thu, 19 Jul 2018 20:10:32 -0400 Received: from terminus.zytor.com ([198.137.202.136]:53007 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727771AbeGTAKc (ORCPT ); Thu, 19 Jul 2018 20:10:32 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6JNO8RR2453017 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Jul 2018 16:24:08 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6JNO7MI2453014; Thu, 19 Jul 2018 16:24:07 -0700 Date: Thu, 19 Jul 2018 16:24:07 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Joerg Roedel Message-ID: Cc: David.Laight@aculab.com, jroedel@suse.de, jpoimboe@redhat.com, jkosina@suse.cz, luto@kernel.org, pavel@ucw.cz, mingo@kernel.org, bp@alien8.de, linux-kernel@vger.kernel.org, hpa@zytor.com, boris.ostrovsky@oracle.com, brgerst@gmail.com, dvlasenk@redhat.com, tglx@linutronix.de, aarcange@redhat.com, eduval@amazon.com, peterz@infradead.org, dhgutteridge@sympatico.ca, gregkh@linuxfoundation.org, will.deacon@arm.com, llong@redhat.com, dave.hansen@intel.com, jgross@suse.com, torvalds@linux-foundation.org Reply-To: eduval@amazon.com, peterz@infradead.org, aarcange@redhat.com, gregkh@linuxfoundation.org, will.deacon@arm.com, llong@redhat.com, dave.hansen@intel.com, jgross@suse.com, torvalds@linux-foundation.org, dhgutteridge@sympatico.ca, jpoimboe@redhat.com, jkosina@suse.cz, luto@kernel.org, David.Laight@aculab.com, jroedel@suse.de, hpa@zytor.com, linux-kernel@vger.kernel.org, boris.ostrovsky@oracle.com, dvlasenk@redhat.com, brgerst@gmail.com, tglx@linutronix.de, mingo@kernel.org, pavel@ucw.cz, bp@alien8.de In-Reply-To: <1531906876-13451-12-git-send-email-joro@8bytes.org> References: <1531906876-13451-12-git-send-email-joro@8bytes.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/entry/32: Simplify debug entry point Git-Commit-ID: 929b44eb5739bf11d4a9bce85d7346bd955fc24d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 929b44eb5739bf11d4a9bce85d7346bd955fc24d Gitweb: https://git.kernel.org/tip/929b44eb5739bf11d4a9bce85d7346bd955fc24d Author: Joerg Roedel AuthorDate: Wed, 18 Jul 2018 11:40:48 +0200 Committer: Thomas Gleixner CommitDate: Fri, 20 Jul 2018 01:11:39 +0200 x86/entry/32: Simplify debug entry point 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 Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-12-git-send-email-joro@8bytes.org --- 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 9d6eceba0461..dbf7d619dcd6 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) /*