Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp157785rwb; Thu, 18 Aug 2022 01:09:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR5fQftiaeatn1N5MGEOY0pLzHcenYCNFjLlVqcyuVtA+wNaR6UGIkVyWt+WjFs8uhr8zYUj X-Received: by 2002:a05:6a00:114f:b0:528:2c7a:634c with SMTP id b15-20020a056a00114f00b005282c7a634cmr1891539pfm.41.1660810185743; Thu, 18 Aug 2022 01:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660810185; cv=none; d=google.com; s=arc-20160816; b=G+aLJ2MYAKfdC8/cRUR133U/EvKVtcKaUdISw5IVOLz6wrZJWFxCyNQeIocSLGd5MI ooscyJbLHsjVEVF7FIQCDElp6079/bHeaVvJlsP6OlkoQfXgl5Q7/Ffi7DEzMvnp5ibA vZ6tHyDY+tMRhdw/g/dOqvMIxR/h0QZIaf94U7RuYl0pxxIAOTQhlS+kwyu93iAYs85c 6wnq3f/BEdWw3Uzt/2j4Fc0iZM2xhX1VXkaAVBCQIhG5CccB65lCakX/rYUHyyEr4I0k 5O8htR0Dvix1WksLE9LaGErOuLk1sjcpytLj210qBGKI3fm1+Qm4hx0DGS0QtdkzlZ6U K39A== 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=0WDxrfmpMQZzXx9CVRCybqD/x6pT8kyfE3mZ4TXsYpg=; b=ff366wbVUVCEa1KZcthgDymKacEEVkQI2AmqoRPT4Ab4Uk20kSq3swtB2K1I7Aq9rk cucCLhiDrdjjss8hSoQLAJBf/hmsNupy2ddsg7oXdy/dgm5VOXycd5JN2OhIYaMiBSsR Sc27W0b1OU0NMrHoYeb41xL5h9G7+MJ5g10OKPfwwIPWEYyiR824gsSuYs0nY8HO/Fhm GF0Akaxqty/Sy+ZmRKYJ+7EHX11CWA5UtMmhN5mggkT6Z4XwG7eE9wfIlHnDNwW9Mzxt nCHPiEjudAn01ruoUKNTTK8BLyCSGz3TQ9E5nCH9yZ+GRQw4RXihWph+1a2bBtorL+c7 BSXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=PzsrIjQq; 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 a2-20020a636602000000b0041ad92b64c4si945320pgc.55.2022.08.18.01.09.33; Thu, 18 Aug 2022 01:09:45 -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=casper.20170209 header.b=PzsrIjQq; 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 S243999AbiHRIBP (ORCPT + 99 others); Thu, 18 Aug 2022 04:01:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243928AbiHRIBN (ORCPT ); Thu, 18 Aug 2022 04:01:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76BDBAF0E3 for ; Thu, 18 Aug 2022 01:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=0WDxrfmpMQZzXx9CVRCybqD/x6pT8kyfE3mZ4TXsYpg=; b=PzsrIjQqIrXWU/HCnE5RvcgMEv jSDsHlj/qNilblrmnmM4l0NorDTJkm6ZUS649TPpvEHnsZIwJtQesH8n1PrFnJTvwIzBxmRcOmq7m 0WK0XyEBmp8dwK60Nj12OUsygPerCTOCKxhJYIFoPTAbUSSX3l06wXl3xRnJDXdd7sgYsBX0Nwm/y F57w7Px3An5LW91jqSFpmUk6ns1z9JMX9En3WOC3SAzm7Y2qCjJ/gJR7qg6LYJ4JMqImqSFWEHitM h9b6PxD95ZPr3rsFOpDEnR2I8StyQXpUhzf/a0edNT9e4QtKwcW8labUHDywKX9DykGXCD7l/Qkms rNipSmbg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOaSa-009Us4-AL; Thu, 18 Aug 2022 08:01:00 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 604BA9801D4; Thu, 18 Aug 2022 10:00:59 +0200 (CEST) Date: Thu, 18 Aug 2022 10:00:59 +0200 From: Peter Zijlstra To: Nick Desaulniers Cc: Nathan Chancellor , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] x86/build: Move '-mindirect-branch-cs-prefix' out of GCC-only block Message-ID: References: <20220817185410.1174782-1-nathan@kernel.org> 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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, Aug 18, 2022 at 09:45:39AM +0200, Peter Zijlstra wrote: > The thing to do is boot with (warning, *very* verbose): > > "spectre_v2=retpoline,lfence debug-alternative" > > and observe that the retpoline sites all replace: > > "cs call __x86_indirect_thunk_r11" (6 bytes) > > with: > > "lfence; jmp *%r11" (6 bytes) ^^ call, ofc, unless the original was jmp then jmp... /me goes get more morning juice in an attempt to wake up. > > > This being clang, you'll ofcourse still have a few weird: > > "Jcc.d32 __x86_indirect_thunk_r11" > > sites that will not be able to be replaced, but there's nothing I can do > about that other than to continue to encourage y'all to stop emitting > them ;-)