From patchwork Wed Jul 18 09:40:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10531845 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 08268602CA for ; Wed, 18 Jul 2018 09:42:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC0231FF0B for ; Wed, 18 Jul 2018 09:42:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E02BB20856; Wed, 18 Jul 2018 09:42:12 +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 785741FF0B for ; Wed, 18 Jul 2018 09:42:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 029CC6B027A; Wed, 18 Jul 2018 05:41:33 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EA59A6B027F; Wed, 18 Jul 2018 05:41:32 -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 B99B96B027A; Wed, 18 Jul 2018 05:41:32 -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 517C36B027B for ; Wed, 18 Jul 2018 05:41:32 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id v26-v6so1698776eds.9 for ; Wed, 18 Jul 2018 02:41:32 -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=nC9WIdxDqOIQYoTQucDycLphuEcYTDVR+9B3C3v3RKU=; b=nNu2PJ1jJ9Kh2cOQSmfpE91IO2TMlfshQ9ICVRxcoQA9iW3Fp2frgDnkgdvaj52XYt I1Wk/dsHENTh5Efa4N+elUsBY0/OZoNb4AY9P7B9aHeVzZtyMGMRFBChJtJBoiw6wern zravKbyz5i+rdpT3Q2RKOrvc/jMrJodwkYT5cYQr1aOJQFEVix1VP8BKqhpwXrDO8/Pq QKqKVOm4b7gLnU7YbNoFGzxrYpxtMzFQnxK0BiIlkOBo+CsJK/NE4Nuam5fxMJtMJTqu cnAcKGIn6xwx7Xc+Ha8Decni2Opz757nM3k/1OeUvkAu85l0V7tCoJlrWUfsxH5NAGhh c2cg== X-Gm-Message-State: AOUpUlGxWWxDq+jV0yKCv+EcVXzulb+1zoD9dtLhISFhaF0l+kHbyqA9 ZMrXQhM1p/ttuHAxbJF/cPBuJ3hMMLFaTiavwLwlLbnGAwBCY/DciiejKk0jXXYmZBc2Za6ihq8 U7JlpThJ+9ezSEO6T15A+1zkhdc0uXn7bfmDCqOGR1ec+OiCWUiWrZIVHmMLEcNAALg== X-Received: by 2002:a50:f9cb:: with SMTP id a11-v6mr6334717edq.26.1531906891897; Wed, 18 Jul 2018 02:41:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfPHPn1z7mn3YBetEwRIQ43jfEsdEzxaNZqG/ddxWbbR/2Mz5VgGvFH6balirDkHFhwR5gC X-Received: by 2002:a50:f9cb:: with SMTP id a11-v6mr6334680edq.26.1531906891300; Wed, 18 Jul 2018 02:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531906891; cv=none; d=google.com; s=arc-20160816; b=zeWG5TUyuXB1IU+uzHMW5xbLZ+/A8LAXnvzQfstaq8A2pl34Q10diFuqCTJmLp+I+v r9wrOMRSWW4Odpn7qk7u2m4SaoNU2KC1eZgsznL9sdxDz0vbfGMsRPBkPj2gRhSSpxmn CouEjKVqUrmfjK4fxIf3W43MA6921ZEor4GdHMLhobdb/VPR0XDL4cNqtWty8Sphwgql 7P9Q9aNdqc3c4KaxcryfSxVH6rKi6dzmFmBW4xxmZLLPHMkDjzz8mwo4c8EnUE/G4Rv1 qX3Duu4Rxz31FcrDX4Nb0uIwi/F2ziNgId6ni3AmfIVpUypYROF+vcPcVjcP59pEPwMt kw5A== 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=nC9WIdxDqOIQYoTQucDycLphuEcYTDVR+9B3C3v3RKU=; b=aV4IXXp4vpnhi0zafQ12vUW6Y78vnnxaaQ9N4GImks5RJIeA5u5jpdshH9Kb8ahIJ3 15XlHvDLWoi0ndRB+V0Zt7IpxJfcpmoSSKzhQrahqdfXEygq0bVMhNA4YS0SjkC6/xP9 mTt2IH+MM/ik21R1bnMnCnMLacSR4CDPgd4Fqle3M6UozKueenKAuR5RugoPssDfo0iy D7Ozw5z9+iKUJ+h0HSmU+Ein6K1NTP0UOotHtDT2LbbhBUC/I03pzSUkbO9gQFUQhdJ4 ueZjVd19IUtNdt6IrTa2NikJefDd+VxqZu37piWaKejMicgMWOCnTEgeVlMfxQbRkMJA E5dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=G91khPKc; spf=pass (google.com: domain of joro@8bytes.org designates 81.169.241.247 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. [81.169.241.247]) by mx.google.com with ESMTPS id k42-v6si1011675eda.168.2018.07.18.02.41.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 02:41:31 -0700 (PDT) Received-SPF: pass (google.com: domain of joro@8bytes.org designates 81.169.241.247 as permitted sender) client-ip=81.169.241.247; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=G91khPKc; spf=pass (google.com: domain of joro@8bytes.org designates 81.169.241.247 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 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> 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 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) /*