Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754785AbeAKJcz (ORCPT + 1 other); Thu, 11 Jan 2018 04:32:55 -0500 Received: from merlin.infradead.org ([205.233.59.134]:37552 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754762AbeAKJcx (ORCPT ); Thu, 11 Jan 2018 04:32:53 -0500 Date: Thu, 11 Jan 2018 10:32:31 +0100 From: Peter Zijlstra To: "Woodhouse, David" Cc: "Thomas.Lendacky@amd.com" , "bp@alien8.de" , "linux-kernel@vger.kernel.org" , "tim.c.chen@linux.intel.com" , "Ghitulete, Razvan-alin" , "torvalds@linux-foundation.org" , "tglx@linutronix.de" , "ak@linux.intel.com" , "x86@kernel.org" , "riel@redhat.com" , "keescook@google.com" , "gnomes@lxorguk.ukuu.org.uk" , "pjt@google.com" , "dave.hansen@intel.com" , "luto@amacapital.net" , "jikos@kernel.org" , "gregkh@linux-foundation.org" Subject: Re: [PATCH] x86/retpoline: Fill return stack buffer on vmexit Message-ID: <20180111093231.GX6176@hirez.programming.kicks-ass.net> References: <1515624682-3556-1-git-send-email-dwmw@amazon.co.uk> <5371f9a0-f221-af1f-641f-05e4d0991847@linux.intel.com> <1515629074.22302.282.camel@amazon.co.uk> <20180111084238.GT6176@hirez.programming.kicks-ass.net> <1F5F831F-0C4B-4DA9-8A48-D0D1C1ADC0D7@alien8.de> <1515661628.22302.294.camel@amazon.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515661628.22302.294.camel@amazon.co.uk> User-Agent: Mutt/1.9.2 (2017-12-15) 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 09:07:09AM +0000, Woodhouse, David wrote: > On Thu, 2018-01-11 at 09:49 +0100, Boris Petkov wrote: > > On January 11, 2018 9:42:38 AM GMT+01:00, Peter Zijlstra wrote: > > >Or we teach the alternative thing to patch in a jmp to end instead of > > >NOP padding the entire thing as soon as the jmp (3 bytes) fits ? > > > > Or, even better: use alternative_call() to call functions instead of patching gazillion bytes. > > For this one I kind of wanted to keep it as a macro so we can select > which register it uses. can't you do lovely things like: volatile asm ("call __fill_rsb_thunk_%1" : : "r" (dummy)) which would still let gcc select the register ?