From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 641EFC43334 for ; Fri, 22 Jul 2022 11:04:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235422AbiGVLEY (ORCPT ); Fri, 22 Jul 2022 07:04:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235202AbiGVLD7 (ORCPT ); Fri, 22 Jul 2022 07:03:59 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76C50BDA03 for ; Fri, 22 Jul 2022 04:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=s+t+9Vi0tpfxV3Q74dVVAy3AQF79iNwAMp4hPA+2T1A=; b=ksMVr3GZZdqiAN8bDPfkOkJvTY yIjVKpnsS8eOb1LfWH3noPuu6p8r1c34KD1crfHTX2hHyp2RofJTrfgycHEoS/0/ttHyn2jCQxBvZ sVYjfo00V9WEBguox4ilxq5qb0haRUZhMuBiDl+DH18FADl7U17AncEXGKS0LLGW3WYC+5J49688G quQEEb/l0YOHCZqJI5M6KIWDf1/khMY3JXunr9Xv9/YCVpzWNo2Yx+UbU+EStwNHGHrM5/kW3Cqhl 8SD8Am76MwlYDbyCaPsACHUqPmuMC62RNq2/FRINqZiFSttgjEkSY5jZmkkGLiQc8lzlPbEP3qtGs 5UOfhwDw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEqRF-005q8w-Hr; Fri, 22 Jul 2022 11:03:21 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 1290298029B; Fri, 22 Jul 2022 13:03:20 +0200 (CEST) Date: Fri, 22 Jul 2022 13:03:19 +0200 From: Peter Zijlstra To: David Laight Cc: 'Linus Torvalds' , Sami Tolvanen , Thomas Gleixner , Joao Moreira , LKML , the arch/x86 maintainers , Tim Chen , Josh Poimboeuf , "Cooper, Andrew" , Pawan Gupta , Johannes Wikner , Alyssa Milburn , Jann Horn , "H.J. Lu" , "Moreira, Joao" , "Nuzman, Joseph" , Steven Rostedt , "Gross, Jurgen" , Masami Hiramatsu , Alexei Starovoitov , Daniel Borkmann , Peter Collingbourne , Kees Cook Subject: Re: [patch 00/38] x86/retbleed: Call depth tracking mitigation Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 21, 2022 at 10:01:12PM +0000, David Laight wrote: > Since: "If the callee is a variadic function, then the number of floating > point arguments passed to the function in vector registers must be provided > by the caller in the AL register." > > And that that never happens in the kernel you can use %eax instead > of %r10d. Except there's the AMD BTC thing and we should (compiler patch seems MIA) have an unconditional: 'xor %eax,%eax' in front of every function call. (The official mitigation strategy was CALL; LFENCE IIRC, but that's so horrible nobody is actually considering that) Yes, the suggested sequence ends with rax being zero, but since we start the speculation before that result is computed that's not good enough I suspect.