From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751828AbdK2SIb (ORCPT ); Wed, 29 Nov 2017 13:08:31 -0500 Received: from merlin.infradead.org ([205.233.59.134]:49676 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760AbdK2SI2 (ORCPT ); Wed, 29 Nov 2017 13:08:28 -0500 Date: Wed, 29 Nov 2017 19:08:17 +0100 From: Peter Zijlstra To: Andy Lutomirski Cc: Ingo Molnar , Jarkko Nikula , linux-kernel , Thomas Gleixner , Linus Torvalds , Borislav Petkov Subject: Re: [PATCH] x86/entry/64: Fix native_load_gs_index() SWAPGS handling with IRQ state tracing enabled Message-ID: <20171129180817.w7xjlvg5azdbvtbg@hirez.programming.kicks-ass.net> References: <0fede9f9-88b0-a6e7-1027-dfb2019b8ef2@linux.intel.com> <20171129070951.hjjjpbyilzaak4ig@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2017 at 09:57:43AM -0800, Andy Lutomirski wrote: > On Tue, Nov 28, 2017 at 11:09 PM, Ingo Molnar wrote: > > On a related note, we should definitely extend the 'intended GS state' annotation > > comments I did in this patch to all SWAPGS instances - this way code review has a > > much higher chance of finding discrepancies between intent and actual code. > > Agreed. I'll send a patch. Alternatively we could do something like: SWITCH_TO_KERNEL_GS SWITCH_TO_USER_GS and have them do the SWAPGS with an (optional) assertion of the actual GS.