From patchwork Wed Jul 11 11:29:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10519449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 71651603D7 for ; Wed, 11 Jul 2018 11:30:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72C3D28837 for ; Wed, 11 Jul 2018 11:30:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6547B28B76; Wed, 11 Jul 2018 11:30:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F23C528B62 for ; Wed, 11 Jul 2018 11:30:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EB5A6B0278; Wed, 11 Jul 2018 07:30:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 848F16B027B; Wed, 11 Jul 2018 07:30:11 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69BDD6B027D; Wed, 11 Jul 2018 07:30:11 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id E4B786B027A for ; Wed, 11 Jul 2018 07:30:10 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id w10-v6so9792423eds.7 for ; Wed, 11 Jul 2018 04:30:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=KO3a4tNMKEtYvVRcye+vTJ7oXt2YWhAD1vV1A23bt+I=; b=fzMzQi13gsjQLt8PTQ+wzPBEIA3yOBPw/xNPOD4vj467C6WPlK2CGXILkjktA53780 EMm97qgpPGHgw6zgZA21oDXxr6fK8vH9rJdG+E5fCMstMxeX/ijog7rJArIozs/Eq4xr vp4/O/txI3cEJaJWlZT0we1gM3qmSeGgIKxBzCQS4X/bi/FLhjnutUSyBX3ZHtKYhEUe BZuA23zpKNBr+zutHVxgXKxFcwqTiorRvoNqprNYahFCPBAEV/mfN7a3tv4g641umZDG 9+/DaBto82NyJ7JOwXsMPSy4vB5Js4OCALAQl7oa8nEohKBj34h8t8O9rUp++i28TfcD dWcw== X-Gm-Message-State: APt69E0AbkHVvbvX+PVFNiUhQStT3kLF++prrbHBO3CTguf+pDm5aPiu 9FgcRHQpfm17VjVV2Q42uVsIjwKzsF3LTk4j6g/IENpDzFAl0JbTEoXrb4HVjwEk//TOcFixyei APudIy3EGnqyMykacobIQXIUg0OL+2Djtj7Y0zoCH0Ntyw+4XDbAD81dgrGePKIUN0A== X-Received: by 2002:a50:b266:: with SMTP id o93-v6mr26786462edd.173.1531308610504; Wed, 11 Jul 2018 04:30:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdvSFZANADW4rFjjaJWCKOF0n98xj1mxpAt0ZPNWrDcolz+Gs2RsJR5m2RNW6HJqI7kFB2m X-Received: by 2002:a50:b266:: with SMTP id o93-v6mr26786415edd.173.1531308609815; Wed, 11 Jul 2018 04:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531308609; cv=none; d=google.com; s=arc-20160816; b=RNfj9oFKFTc3hVvReasaVLeWnjHsIr1g2WnuqHN14ViNhVzSa20EWaOTxm+32fW85m bPoDt8GUyIYj0zFXhj+qw7Mp8fY6ZDferq6IR9jl+adLtbv50fmLp0w88S43ddpjvZ8b vw5bzHUrugLHPctFnrkbz9i3aCEF0MokCsJDZYAh4pP5CHfUPNst/KkslKH7DrWmNdlb YgW8FS989T576QoB0h2L4mO59vdAzUK/ythC7HSA1sX+sj6shlDGIGqzUTfJzfiUNtIf tkPUVtlrHjF/g7hnDvLpsONN9VWCegxIdc6agcEvIApKYbR9k+fYCppNEx/uW0FQRW/V hStA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=KO3a4tNMKEtYvVRcye+vTJ7oXt2YWhAD1vV1A23bt+I=; b=X/7eKDLx/i6KfsvKFNSi7QexVHnOavui725exg26XM6/+g6ESCg35c1CCKZvbusWq3 eAB7KuyqnTAtdIrv081mxFRORUTzYa56Iay8e6MGht1c9GqQss/zmlZAyL3y9zL5Q3uz lSNVeMPh7QAL+VGnR6EPh6Zm+EyvszRGg7cBg4ahwwSCH+vw6SaFxgWwf4WPEa4SlInM ODtpjMSo/gtSCLaLH/JRhn4TyeJDe+TfLipUoVx2/uF7kU6omRxt8a/Ba4PDDVMCzrC6 fDvy2Z9hbMNGaM8cDNr4bNZ/4FPjdryBRaiidgS8wyRNc+LaJ/R8Z0f9SqI0YJTkH7FM bspA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b="F/mcCPY/"; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: from theia.8bytes.org (8bytes.org. [2a01:238:4383:600:38bc:a715:4b6d:a889]) by mx.google.com with ESMTPS id x39-v6si9829153ede.200.2018.07.11.04.30.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 04:30:09 -0700 (PDT) Received-SPF: pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) client-ip=2a01:238:4383:600:38bc:a715:4b6d:a889; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b="F/mcCPY/"; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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) /*