Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754051AbeAJBXH (ORCPT + 1 other); Tue, 9 Jan 2018 20:23:07 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:34558 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753852AbeAJBXF (ORCPT ); Tue, 9 Jan 2018 20:23:05 -0500 X-Google-Smtp-Source: ACJfBovDn9x26/Xf5S2NEgIPpyIXwEdNWxmOsz/znQue1xV1YfnuzE3Z2vOzZeXpEhbBIERbFfXUiA== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v1 5/8] x86/entry/clearregs: Clear registers for 64bit exceptions/interrupts From: Andy Lutomirski X-Mailer: iPhone Mail (15C153) In-Reply-To: <20180110010328.22163-6-andi@firstfloor.org> Date: Tue, 9 Jan 2018 17:23:02 -0800 Cc: tglx@linutronix.de, 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 Content-Transfer-Encoding: 8BIT Message-Id: <2F24076F-4679-4F0A-B314-FC695E9D2211@amacapital.net> References: <20180110010328.22163-1-andi@firstfloor.org> <20180110010328.22163-6-andi@firstfloor.org> To: Andi Kleen Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: > On Jan 9, 2018, at 5:03 PM, Andi Kleen wrote: > > 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 If CLEAR_ALL_REGS does what it sounds like, then its overkill here. I could get behind this patch in general, though. Interrupts are so slow the the overhead probably doesn't matter.