Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964884AbeAKP20 (ORCPT + 1 other); Thu, 11 Jan 2018 10:28:26 -0500 Received: from mail-it0-f43.google.com ([209.85.214.43]:40507 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932197AbeAKP2Y (ORCPT ); Thu, 11 Jan 2018 10:28:24 -0500 X-Google-Smtp-Source: ACJfBovuQAxg3/YvTHg0cDEAp+HedLdz1idgtm8tEaIZ320TqwEhDIHOq457DYwXO/DkHUvpCiQA3HbEb5dD3bMx4W4= MIME-Version: 1.0 In-Reply-To: <1515684226.22302.357.camel@infradead.org> References: <1515670638-8552-1-git-send-email-dwmw@amazon.co.uk> <20180111142038.sqhflhikcailqnwi@treble> <1515680912.22302.351.camel@infradead.org> <20180111143206.GA6176@hirez.programming.kicks-ass.net> <1515684226.22302.357.camel@infradead.org> From: Brian Gerst Date: Thu, 11 Jan 2018 10:28:23 -0500 Message-ID: Subject: Re: [PATCH v2.1] x86/retpoline: Fill return stack buffer on vmexit To: David Woodhouse Cc: Peter Zijlstra , Josh Poimboeuf , Andi Kleen , Paul Turner , LKML , Linus Torvalds , Greg Kroah-Hartman , Tim Chen , Dave Hansen , Thomas Gleixner , Kees Cook , Rik van Riel , Andy Lutomirski , Jiri Kosina , gnomes@lxorguk.ukuu.org.uk, "the arch/x86 maintainers" , Borislav Petkov , rga@amazon.de, Tom Lendacky Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 10:23 AM, David Woodhouse wrote: > On Thu, 2018-01-11 at 10:22 -0500, Brian Gerst wrote: >> On Thu, Jan 11, 2018 at 9:32 AM, Peter Zijlstra wrote: >> > On Thu, Jan 11, 2018 at 02:28:32PM +0000, David Woodhouse wrote: >> >> On Thu, 2018-01-11 at 08:20 -0600, Josh Poimboeuf wrote: >> >> > >> >> > This seems weird. I liked v1 a lot better. What's the problem with >> >> > patching in the whole thing? >> >> > >> >> > Also, if you go back to v1, it should be an easy objtool fix, just add >> >> > ANNOTATE_NOSPEC_ALTERNATIVE in front of it. >> >> >> >> The objection was that I was patching in a fairly long set of >> >> instructions. I confess I don't actually know why that's a problem, >> > >> > You get a giant string of NOPs, a single jmp should be faster. >> >> That could be handled in add_nops(), where if over a certain threshold >> it changes to a JMP. > > Currently that only processes the *altinstr* doesn't it? Not the > oldinstr? It does both. -- Brian Gerst