Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964859AbeAKPWq (ORCPT + 1 other); Thu, 11 Jan 2018 10:22:46 -0500 Received: from mail-it0-f50.google.com ([209.85.214.50]:42279 "EHLO mail-it0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933129AbeAKPWp (ORCPT ); Thu, 11 Jan 2018 10:22:45 -0500 X-Google-Smtp-Source: ACJfBotxoDMYMr/hGyViYS7K0EoeL2a0uffXPnOPxeS77JmDVDVjQ+iq19SB/CYoE58gSFW7R5L5mPK2UuHz8DjEyLg= MIME-Version: 1.0 In-Reply-To: <20180111143206.GA6176@hirez.programming.kicks-ass.net> 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> From: Brian Gerst Date: Thu, 11 Jan 2018 10:22:43 -0500 Message-ID: Subject: Re: [PATCH v2.1] x86/retpoline: Fill return stack buffer on vmexit To: Peter Zijlstra Cc: David Woodhouse , 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 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. -- Brian Gerst