From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932406AbdJ0SIc (ORCPT ); Fri, 27 Oct 2017 14:08:32 -0400 Received: from mga04.intel.com ([192.55.52.120]:19999 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932346AbdJ0SI3 (ORCPT ); Fri, 27 Oct 2017 14:08:29 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,304,1505804400"; d="scan'208";a="1236256427" Subject: Re: [PATCH 03/18] x86/asm/64: Move SWAPGS into the common iret-to-usermode path To: Andy Lutomirski , X86 ML References: Cc: Borislav Petkov , "linux-kernel@vger.kernel.org" , Brian Gerst , Linus Torvalds From: Dave Hansen Message-ID: <07bbde42-91da-5f7e-d185-d21f6abc9323@intel.com> Date: Fri, 27 Oct 2017 11:08:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/26/2017 01:26 AM, Andy Lutomirski wrote: > diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S > index 493e5e234d36..1909a4e42b81 100644 > --- a/arch/x86/entry/entry_64.S > +++ b/arch/x86/entry/entry_64.S > @@ -254,7 +254,7 @@ return_from_SYSCALL_64: > movq RCX(%rsp), %rcx > movq RIP(%rsp), %r11 > cmpq %rcx, %r11 /* RCX == RIP */ > - jne opportunistic_sysret_failed > + jne swapgs_restore_regs_and_return_to_usermode Could we just leave the "opportunistic_sysret_failed" label and put it at the same location as "swapgs_restore_regs_and_return_to_usermode". It's kinda nice to have the failure paths spelled out. Just reading this, I have no idea if "RCX == RIP" is good or bad and whether we're proceeding with the sysret or giving up on it.