Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753076AbbDBQIp (ORCPT ); Thu, 2 Apr 2015 12:08:45 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:36058 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751360AbbDBQIk (ORCPT ); Thu, 2 Apr 2015 12:08:40 -0400 Date: Thu, 2 Apr 2015 18:08:35 +0200 From: Ingo Molnar To: Denys Vlasenko Cc: Brian Gerst , Andy Lutomirski , the arch/x86 maintainers , Linux Kernel Mailing List , Borislav Petkov , Linus Torvalds , Borislav Petkov Subject: Re: [PATCH urgent v2] x86, asm: Disable opportunistic SYSRET if regs->flags has TF set Message-ID: <20150402160835.GC8045@gmail.com> References: <9472f1ca4c19a38ecda45bba9c91b7168135fcfa.1427923514.git.luto@kernel.org> <20150402090744.GA26846@gmail.com> <551D14D3.1070907@redhat.com> <20150402103735.GA21105@gmail.com> <551D3503.6000508@redhat.com> <20150402123159.GA25151@gmail.com> <551D3D2A.2040802@redhat.com> <551D64F0.4090208@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <551D64F0.4090208@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1330 Lines: 45 * Denys Vlasenko wrote: > On 04/02/2015 02:59 PM, Denys Vlasenko wrote: > > On 04/02/2015 02:31 PM, Ingo Molnar wrote: > >> - we can optimize in a more directed fashion - like here > >> > >> ... while the downsides are: > >> > >> - more code > >> - a (small) chance of a fix going to one path while not the other. > >> > >> How much extra code would it be? > > > > A screenful or two. > > I took a stab at it: > > text data bss dec hex filename > 12530 0 0 12530 30f2 entry_64.o2 > 12562 0 0 12562 3112 entry_64.o > > The patch does two steps: > > (1) copy-pastes "retint_swapgs:" code into syscall handling code, > the copy is under "syscall_return:" label. > > (2) remove "opportunistic sysret" code from "retint_swapgs" code block, > since now it won't be reached by syscall return. This in fact removes > most of the code in question. > > Lightly run-tested so far. > > Ingo, do you want this in a proper patch form? Yeah, that looks good to me (only lightly reviewed). Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/