Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756196AbeAJBFK (ORCPT + 1 other); Tue, 9 Jan 2018 20:05:10 -0500 Received: from mga01.intel.com ([192.55.52.88]:27787 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755373AbeAJBDt (ORCPT ); Tue, 9 Jan 2018 20:03:49 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,337,1511856000"; d="scan'208";a="193703884" From: Andi Kleen To: tglx@linutronix.de Cc: x86@kernel.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, dwmw@amazon.co.uk, pjt@google.com, luto@kernel.org, peterz@infradead.org, thomas.lendacky@amd.com, tim.c.chen@linux.intel.com, gregkh@linux-foundation.org, dave.hansen@intel.com, jikos@kernel.org, Andi Kleen Subject: [PATCH v1 5/8] x86/entry/clearregs: Clear registers for 64bit exceptions/interrupts Date: Tue, 9 Jan 2018 17:03:25 -0800 Message-Id: <20180110010328.22163-6-andi@firstfloor.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180110010328.22163-1-andi@firstfloor.org> References: <20180110010328.22163-1-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Andi Kleen Clear all registers on entering the 64bit kernel for exceptions and interrupts. Since there are no arguments this is fairly simple. Signed-off-by: Andi Kleen --- arch/x86/entry/entry_64.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 632081fd7086..6ab4c2aaeabb 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -636,6 +636,7 @@ END(irq_entries_start) ALLOC_PT_GPREGS_ON_STACK SAVE_C_REGS SAVE_EXTRA_REGS + CLEAR_ALL_REGS ENCODE_FRAME_POINTER testb $3, CS(%rsp) @@ -1192,6 +1193,7 @@ ENTRY(xen_failsafe_callback) ALLOC_PT_GPREGS_ON_STACK SAVE_C_REGS SAVE_EXTRA_REGS + CLEAR_ALL_REGS ENCODE_FRAME_POINTER jmp error_exit END(xen_failsafe_callback) @@ -1237,6 +1239,7 @@ ENTRY(paranoid_entry) cld SAVE_C_REGS 8 SAVE_EXTRA_REGS 8 + CLEAR_ALL_REGS ENCODE_FRAME_POINTER 8 movl $1, %ebx movl $MSR_GS_BASE, %ecx @@ -1289,6 +1292,7 @@ ENTRY(error_entry) cld SAVE_C_REGS 8 SAVE_EXTRA_REGS 8 + CLEAR_ALL_REGS ENCODE_FRAME_POINTER 8 xorl %ebx, %ebx testb $3, CS+8(%rsp) @@ -1487,6 +1491,7 @@ ENTRY(nmi) pushq %r14 /* pt_regs->r14 */ pushq %r15 /* pt_regs->r15 */ UNWIND_HINT_REGS + CLEAR_ALL_REGS ENCODE_FRAME_POINTER /* -- 2.14.3