From patchwork Wed Jul 18 09:40:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10531797 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 6FE94600F4 for ; Wed, 18 Jul 2018 09:41:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61EB328FD5 for ; Wed, 18 Jul 2018 09:41:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55EC328FF3; Wed, 18 Jul 2018 09:41:33 +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=unavailable 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 07F0928FD5 for ; Wed, 18 Jul 2018 09:41:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 448966B026E; Wed, 18 Jul 2018 05:41:26 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3F66A6B0270; Wed, 18 Jul 2018 05:41:26 -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 29A2C6B0271; Wed, 18 Jul 2018 05:41:26 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id B248F6B026E for ; Wed, 18 Jul 2018 05:41:25 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id y17-v6so1681018eds.22 for ; Wed, 18 Jul 2018 02:41:25 -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=59kgpSZCp9XjsleM3vfbMGOeIR/pli/7ooP/sZn4aWc=; b=MRF5dtNvP28ViQHC0/9SZc/RO9eCr9wbmbqWtMfg+YLBmZw6yc+TPXxThDRbY7y7zQ Sl5UJAcXcSAZgkTuZb/Mf0kex/6Wtnn/Pxwjc8r4I/ZsOkbZ6dLySzafarUBsOom85se V57uI+yW9b/oPqCcjHpAlIP3kyHWJwUpyz2yhWcpPwjmxg8xp7SJcqP7NpKeZ74nfnQj UWhpT5TOAtoL8j26EUq9Xvs0Dsd5TJHgvvoA8Zl6Hl6nKINuCewe0W+zzLBMPEaL4wbI PiX5muNKGoyvxOu2kHFTOeqSXACAKOwxANNBx60AqqflHjPSDJlbSZganBQ95iBF8y/R 8VOQ== X-Gm-Message-State: AOUpUlFKCixf0bvE0ItuQNqFwPUpIp3pb4gqmptham6dBOW+LloaINDx cgK9Ww2CK8bF0lPd8STAF6swcWYWhSvz0XyKsImKWTpF0xCOaw8cbmBOFguSFw5tdwkxmtE1xZy dHczyDkI3urj27Pn9OjcJCzx8hjbcz/+r6P3/X2L+Z9F0B0xJoJpUTdNTvhP1Z/M+UA== X-Received: by 2002:a50:a347:: with SMTP id 65-v6mr6281077edn.299.1531906885309; Wed, 18 Jul 2018 02:41:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcukrV0u2249GBP9uHdHEO4QsCkRVXNrO3edLF7yKVBaMyq935SttER3qJJvxd0ARnV9ejS X-Received: by 2002:a50:a347:: with SMTP id 65-v6mr6281030edn.299.1531906884582; Wed, 18 Jul 2018 02:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531906884; cv=none; d=google.com; s=arc-20160816; b=mpb+hUVV77/F9mLivO49ixgxv2jDAEwxfd4qko/sYEA6Gj4NQ7vndZ3VJUPaUWnVoo v1+uG4re9m3WXw7VQ6GVtoW81hj67t0PN25aw/myDjDfJC++TWmj3scLXarbwEfxTro4 nYxmuZxhlHv2YKT5kvNaOfIJkdZaKiEd0V5bPSkncFM5NsvkgL0jUTlfeVoLCnddSrtv YHrv0s4IeLJEKYs0eh5FX6G43HtbjoEu0pegPpl2mQ6hvK8CsQwzvx93lT+uaWIUzNiL vHOwT05dQoDgc8W7IUcDewb4zegaMWUPGWytaAUUG0SYlTDQ7FxQ737PoZixoIPvRRfx vxZw== 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=59kgpSZCp9XjsleM3vfbMGOeIR/pli/7ooP/sZn4aWc=; b=Aweh+5nPi0JUf41ac5SXVuU19b4XQFyOMaN9jdJhUZWvSU8KNO82kQoLmLvTuQrd8M ER2rGWkcNbY30BXSjzpAFHf9r+g78N8V5MdMxPv6FyconnH4HYirWcFl12dKj69ketPk ItUPsz1HDr0ojWOipH5i3FzqpTdVduy8jYxUUQ+Puzzph55axjrQKOkJHcjdkxIykUBc ckYEFk2g/TnjhkoY00kRu6qBnFarhx7M32vcWnPsGn6hG9fLbK3v55R2oNCzLZkLUmJs RTfnDbjAhO/l6+fuNirm3tMzdGS0BMT3uDOos3AhMalJuwuBMLfZRvzOR8GIYDSrPAOS ssFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=OWPCGoxk; 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 z22-v6si3650099edi.394.2018.07.18.02.41.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 02:41:24 -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=OWPCGoxk; 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 3417B1D3; Wed, 18 Jul 2018 11:41:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531906879; bh=A4ZQi0DSL1gF1Xdjf/O6RlUKBa98rFH/5ngDgFaQgf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OWPCGoxkyV63Cz1JYkqeO9epA90FYq0ck8LqSJqk6xwZqLN2GwgBFiziNRoOtlOny Zvkx8q/hc4nXJuVQyp+CYLQurH1IfgTfLbqBUbRHSG+PVyQDvQNS+JcvN8UQtir1Nf cflNSbuZ1SWgusK/nApkWDe8V/mWlWcNFCDblt6ciqXKPltEtx5bCnJMzpLsPFJvrn 6qlcKW5AyY7Tnyc8x/zIXlUXdYcFdoivfu6H9HvatKMES1knZ0S36aIPVioZvvDw8d QyLOKVbATUtbtcDeEJtjf80V2xgb0yHFKp59wdjk/sQlrHpNmL8b5HYKnIRQm02Al+ IZl6qTSMhmgpg== 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, 18 Jul 2018 11:40:42 +0200 Message-Id: <1531906876-13451-6-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 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 ef7d653..4364131 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: