From patchwork Wed Jul 11 11:29:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10519421 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 63EB2603D7 for ; Wed, 11 Jul 2018 11:30:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67CDC28D2C for ; Wed, 11 Jul 2018 11:30:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65CBC28D2E; Wed, 11 Jul 2018 11:30:18 +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 077E228D36 for ; Wed, 11 Jul 2018 11:30:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 231416B0270; Wed, 11 Jul 2018 07:30:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 193D06B0271; Wed, 11 Jul 2018 07:30:08 -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 E65226B0272; Wed, 11 Jul 2018 07:30:07 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 7FC1E6B0270 for ; Wed, 11 Jul 2018 07:30:07 -0400 (EDT) Received: by mail-ed1-f71.google.com with SMTP id b25-v6so6429056eds.17 for ; Wed, 11 Jul 2018 04:30:07 -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=qR2aXv88isIdJrKcC3PxsMfVhCoZRpQAzxjCbHAoc2o=; b=HnAg23TQaFgZ/xLQktyzaSHoc08uOdRUccjFGKdcStBRfX9rQ9MxtpaPIZ6cMuSKVp hSAiYBP39HLRv3yXtz7GAHEJHOOcSzkO37JNnHCCIv8XX8LjVanAptb5JuCbCMfTeWTS qpyEmRwzXZ4WQkDRihf18mLzs3mFN3H7nf6p3EhzqQSn7tOTMQeanYowolV1OBE3whbm mHEA69DmdtmislnOl7cSeA/h4iQh2t1owq370/hQ9swnaXXOW1+VkOhfoTzWCAkgoll5 IWbYkM2NVXkQyi8oObRlXJkkOz8PzV82hjGMYIdOxnid7hpGrQct+/VS6WRqrxzqKXnw 1YpQ== X-Gm-Message-State: APt69E2oWrsaiT08LorxNIJKuM6HgB2kSvVgTYMY3JxJU3w+OfpabUIP bG15W6eAuOjj/yMlG8k8+AhGu+zBqnkN/eZcv6JzBdXS+iTzCmlk2i6oBPaH/rqbh4VNBnR1lpw rqr2EaGuQnjdc3WsoGMT+WVkEjkxKINX6JB4D06FP8pHH8aGjOlV0WM6NiFTAM8D9nA== X-Received: by 2002:a50:f5ad:: with SMTP id u42-v6mr31431403edm.93.1531308607077; Wed, 11 Jul 2018 04:30:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfUeqA3vRQXfURIBvxinnQ4ye9xYiDq7M18iqojJIihmcClW19Vw/Ct1ie6fNcN6ZMiXbUe X-Received: by 2002:a50:f5ad:: with SMTP id u42-v6mr31431368edm.93.1531308606503; Wed, 11 Jul 2018 04:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531308606; cv=none; d=google.com; s=arc-20160816; b=Z3FfcUteP/y7Bt4buVbDIPb5/YtwCauDBCPPyF9pwJQfJpm+6ApA+lZr4vq4abDL2T BmPrFVQk7WrTfjx8uCl6K5c7DV3BYPmlHHR73fY66KivU/n2zA4ikSs33IIu/Az6qdsH GkwiDObJiqEk238Ca614sv0IHHK4r3ffMw6SGfMyiQNL/Wtq904WvZRh7ryjl2EVstxt KpcEkWZvDUO1xUQaRFHf3VWD/GN7nXRDCEcAq2kLn4odTfPwPyl9lPJYsxYMXLn7MkRk pvg9KjIFXpGH5IG30wDV/GJ4mrkcVnVemIafdb+ZrNAY4x6VhrMbdB25fftnR+wNluzy SYzA== 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=qR2aXv88isIdJrKcC3PxsMfVhCoZRpQAzxjCbHAoc2o=; b=ToFHchXWWQJS6cjknYsv8x7YN500VzCBSYWUcQJdgVp7h8k/wEZCBOkRfzwbrLDD2f cSzk46VZzNkW+maCSEgXJOSrvkip2YY3292bxqhaW9kcFUEgU/DnbCE0ZUPo93ywhuFR VoHS6mkIWHsUly9Wy3wLXvYGlmaE6+da1E+OLlUjPv+Kennbt8w09MM+5z1/SLOnvReP 6e1Cnde4a924ECPpF2PhxQJGpt4zNtMlVIAvuSyj08X1qdVhCsoI6RYqMpLjIjDJlF/z N2qbARUHbdtuI1s70/T//AZcAdfkl1eoBkXKEmFTjWt493+bHeVb46jhOaXTaZ6vrixi 9ELg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=NbKlaUsS; 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 g10-v6si3011338eda.401.2018.07.11.04.30.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 04:30:06 -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=NbKlaUsS; 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 3B759709; Wed, 11 Jul 2018 13:29:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531308600; bh=njQZX63V8jS0zJ0D8ojNVJhoV+y1mqOjk+joS4saPAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NbKlaUsS5y1q/J4BBAcwxuO/NYpasVb/8ZaCTl9O7T1e2TBpxOY7Bguh/pwl7nk4l yETZ9OFX+551L7wB2OtYVLAxnvxM1XoZjbEK+4L4lY4E7PqOeopRTSizqlKs8Rbozh 3PG1mw0v9ikGOs0LLa2zwQ8sIcT8/xTM3A8DWgAu0tKUM1+NQ3I0nyETL7T5927BXO J+pIABN1tfr1lR2Krv/rMSDYc849I9pv646DYnfsm7llBQt2ud2Ae8NhqsfZE4+Tq2 ZSuI25n8o7jhfSyHGpnkW2q3Yi4SiRzZfxH1ZaonD9HiKsSiJihEJjd+r20NoiHTB4 O+zINMJAX4kUg== 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 05/39] x86/entry/32: Unshare NMI return path Date: Wed, 11 Jul 2018 13:29:12 +0200 Message-Id: <1531308586-29340-6-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 NMI will no longer use most of the shared return path, because NMI needs special handling when the CR3 switches for PTI are added. This patch prepares for that. Signed-off-by: Joerg Roedel --- arch/x86/entry/entry_32.S | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index d35a69a..571209e 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -1017,7 +1017,7 @@ ENTRY(nmi) /* Not on SYSENTER stack. */ call do_nmi - jmp .Lrestore_all_notrace + jmp .Lnmi_return .Lnmi_from_sysenter_stack: /* @@ -1028,7 +1028,11 @@ ENTRY(nmi) movl PER_CPU_VAR(cpu_current_top_of_stack), %esp call do_nmi movl %ebx, %esp - jmp .Lrestore_all_notrace + +.Lnmi_return: + CHECK_AND_APPLY_ESPFIX + RESTORE_REGS 4 + jmp .Lirq_return #ifdef CONFIG_X86_ESPFIX32 .Lnmi_espfix_stack: