Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp517798imi; Fri, 22 Jul 2022 04:08:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s7/T7Ka4YKAfdrhkgopJITYbLIuD1av0Q2Cn7t2GAvLbF/3FUtRDasStldMerVLQ615uCM X-Received: by 2002:a17:902:d50a:b0:16c:3c08:3637 with SMTP id b10-20020a170902d50a00b0016c3c083637mr2973221plg.137.1658488134189; Fri, 22 Jul 2022 04:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658488134; cv=none; d=google.com; s=arc-20160816; b=xTJltFPfKCdq5pPzxQ3gyK4Dg7AenustLMJwDUgEuPnu1C3Qt/Hwi4S0nBzAU4TpVM zNp3YGrTXo9PpWdFTq8WWA2vlv/GBDDpRuuXd+Xb6VlMicJZegMQ1Jk19cAM5nAZh9f9 p2lm6pj5jf7uaLxOQd0YMj2zlpPKg9u1DJXiyG7RptmCebqOL9Uu4C6ov6aRBApm/P3Y 4EW6ZcXq6hJLPLLROv5nEYvyYa1JMcxx27h8OxtHjkElre+snYVDtMG4vLO8r6ouK+tU 6+CkUclaDPaqJboa8HaEhq8rS8zIVcI5ZReq8GLCHEZepJv0JivuzpsvbSc6qLJH/xX+ F+xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=s+t+9Vi0tpfxV3Q74dVVAy3AQF79iNwAMp4hPA+2T1A=; b=QwGi6Hlk//hWC94a1GJJsKlxlSiSB2o0dUnKpXpoqbH0ooHPmC2mbUAkvWIwaaE4LO 5DaxMdfLgFwfMTgZbCzJZ3JJqm8+fAIwOTAqyA+EdgZzVOyeOsGonPX1eo/5DenXP9e2 lYMb8fDgiTxYniss307uKYK3ZvthANB3+zlFt6bED0kRFbb+uG9yil4Ei1lN36XLRMW5 OEQ4AzW5i2fX18KItdU9UymcabwW0BHM4t7AGNtzKp+FowuZh8EqNDDVpy6I48YkMP3V 27WMIehY+WjKqMMiN/xkD1E5Y10+K91l+qUoC3BnRXKaMXTbCui5hlswARYFOIFdjG6o hJcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=ksMVr3GZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 184-20020a6216c1000000b0050cfb4ff72dsi5116290pfw.52.2022.07.22.04.08.38; Fri, 22 Jul 2022 04:08:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=ksMVr3GZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235414AbiGVLEX (ORCPT + 99 others); Fri, 22 Jul 2022 07:04:23 -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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.