Received: by 10.223.185.116 with SMTP id b49csp2427904wrg; Mon, 5 Mar 2018 02:42:02 -0800 (PST) X-Google-Smtp-Source: AG47ELthtBE4xpeZRA6ZW2M3M6UaUCDyzQT3oDgZu5TsiktWKgDWhYaAnAdC7vypV9U9krxBdS0S X-Received: by 10.99.188.2 with SMTP id q2mr12108355pge.101.1520246522668; Mon, 05 Mar 2018 02:42:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520246522; cv=none; d=google.com; s=arc-20160816; b=mYX/UU4nLmXL9WxvPblJxGNsZ7By1mMImauljvxm5fEpMDrSbmjlupokT41f9tMRJy 2lEvfBGzhFefgp2ltNb/pIqSDe8edeGWwM808V/UeeH1OJoul30XnGQQZ2kwJRow0GAO qF2mOawDD3b2LqjH775onqFZHGQeY9h7y8SymKtBkfNmGg7o9ZlSty7KPF8WuJARLCLB kpcQSaFzRrOD3IoWyJfCgmEUAoMHe1KRhs95neafdqKM2RUr4K40CbTM3NeMq9fW+BXz YuACagG58EalY3M0fQ72qdsiQC74GYXfm0behz2LZKmveNdH2VYrutv9D1q0ROyQqqCa WIPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=qxWeLBWPXfhZcdORXt/N8vBDLLsrpvteBpcTwZSO2Cc=; b=NLPF/8xIM9NWFHXvu3g9RPw061g1Dj1MlAfFzNzwsd2rMlUAPnud79wTZdxNuAKAEI C2FxM6dwkcztL22fWcQOB/QHLDSYRr1S5xz0NfSY3gjs6LYZ0jb/PpNCvSWhWbsoAEjl LeychpmFi5P83hv0j7wDXMM46QBFazqYl74wGo8yM3DHBe1R5XHfN2y278E6eeeWm4eL 3GLmco4wX0llv/VidAyuhqpsL7O9LHL/81L9hLC0eMVC75xgYtjl4DkaoUcB/gGsNWZa k/uP0BO/8neYq94iEf5CGB9XciugyHEPPD6Ai0xoHQzHle0c4QceSxzRSOQk45J//No7 NpKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=dh4LVBXL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15-v6si1675593plk.518.2018.03.05.02.41.48; Mon, 05 Mar 2018 02:42:02 -0800 (PST) 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; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=dh4LVBXL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934351AbeCEKeM (ORCPT + 99 others); Mon, 5 Mar 2018 05:34:12 -0500 Received: from 8bytes.org ([81.169.241.247]:54324 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933351AbeCEK0L (ORCPT ); Mon, 5 Mar 2018 05:26:11 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id E8E6D844; Mon, 5 Mar 2018 11:26:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1520245565; bh=g4TGj6ZhBCG7UdO6cOVsWSNI7o+/WUM5q23OGH4nNck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dh4LVBXLMvWXS+c4GwqY2uhwEubBRmxMsL5msnEyCjPtOelaEMp8cQkonYs0GJnIK SE6cy03jE1898Wj+nmBafxFR+Dwn3tFJlWAxie3vZ1CzEdrF1tixGsHJWMqac6WRbP x81tdaUBz5eVqe8E2tWIDBGWjE/PwPmgCVKLbJumCM7Tl1JcEGl/lu/yeqS3IjgwBK 5GMi7e4EEu/MHF86/qeBPFSQP3af9u+OfVjcMpyyo0ZeNIFiJmQgHGvBsVXC6XICkZ ClfMTR+/6Qs3OhfQE+8uQD5IHGdzfGcPqMiHilRL/CYU2Nk6gufeVH2GIowrX4iDR5 XZU0QLtVqCfZQ== 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 , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 05/34] x86/entry/32: Unshare NMI return path Date: Mon, 5 Mar 2018 11:25:34 +0100 Message-Id: <1520245563-8444-6-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520245563-8444-1-git-send-email-joro@8bytes.org> References: <1520245563-8444-1-git-send-email-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 0289bde..00ae759 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -1007,7 +1007,7 @@ ENTRY(nmi) /* Not on SYSENTER stack. */ call do_nmi - jmp .Lrestore_all_notrace + jmp .Lnmi_return .Lnmi_from_sysenter_stack: /* @@ -1018,7 +1018,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: -- 2.7.4