From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755682AbdKBK4e (ORCPT ); Thu, 2 Nov 2017 06:56:34 -0400 Received: from terminus.zytor.com ([65.50.211.136]:36521 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755459AbdKBK4b (ORCPT ); Thu, 2 Nov 2017 06:56:31 -0400 Date: Thu, 2 Nov 2017 03:51:57 -0700 From: tip-bot for Andy Lutomirski Message-ID: Cc: peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, luto@kernel.org, brgerst@gmail.com, mingo@kernel.org, bpetkov@suse.de, dave.hansen@intel.com Reply-To: linux-kernel@vger.kernel.org, luto@kernel.org, torvalds@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org, hpa@zytor.com, dave.hansen@intel.com, mingo@kernel.org, bpetkov@suse.de, brgerst@gmail.com In-Reply-To: <652a260f17a160789bc6a41d997f98249b73e2ab.1509609304.git.luto@kernel.org> References: <652a260f17a160789bc6a41d997f98249b73e2ab.1509609304.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/entry/64: Use POP instead of MOV to restore regs on NMI return Git-Commit-ID: 471ee4832209e986029b9fabdaad57b1eecb856b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 471ee4832209e986029b9fabdaad57b1eecb856b Gitweb: https://git.kernel.org/tip/471ee4832209e986029b9fabdaad57b1eecb856b Author: Andy Lutomirski AuthorDate: Thu, 2 Nov 2017 00:59:05 -0700 Committer: Ingo Molnar CommitDate: Thu, 2 Nov 2017 11:04:40 +0100 x86/entry/64: Use POP instead of MOV to restore regs on NMI return This gets rid of the last user of the old RESTORE_..._REGS infrastructure. Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Dave Hansen Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/652a260f17a160789bc6a41d997f98249b73e2ab.1509609304.git.luto@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/entry/entry_64.S | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index b5a0ea6..5b2f0bc 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -1559,11 +1559,14 @@ end_repeat_nmi: nmi_swapgs: SWAPGS_UNSAFE_STACK nmi_restore: - RESTORE_EXTRA_REGS - RESTORE_C_REGS + POP_EXTRA_REGS + POP_C_REGS - /* Point RSP at the "iret" frame. */ - REMOVE_PT_GPREGS_FROM_STACK 6*8 + /* + * Skip orig_ax and the "outermost" frame to point RSP at the "iret" + * at the "iret" frame. + */ + addq $6*8, %rsp /* * Clear "NMI executing". Set DF first so that we can easily