Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754909AbeAKJsO (ORCPT + 1 other); Thu, 11 Jan 2018 04:48:14 -0500 Received: from mail.skyhub.de ([5.9.137.197]:35102 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753568AbeAKJsN (ORCPT ); Thu, 11 Jan 2018 04:48:13 -0500 Date: Thu, 11 Jan 2018 10:47:59 +0100 From: Borislav Petkov To: Peter Zijlstra Cc: "Woodhouse, David" , "Thomas.Lendacky@amd.com" , "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: <20180111094759.aohvm5tqztza72es@pd.tnic> 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> <20180111093231.GX6176@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180111093231.GX6176@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170609 (1.8.3) 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:32:31AM +0100, Peter Zijlstra wrote: > can't you do lovely things like: > > volatile asm ("call __fill_rsb_thunk_%1" : : "r" (dummy)) > > which would still let gcc select the register ? Calling a function from asm is nasty because you need to pay attention to clobbered registers as gcc doesn't see the function. What one can do, I *think*, is do a non-inlined wrapping function and do all the alternative_call() fun inside. There you can do all the fun and have callee-clobbered regs which you can use. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.