Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4282299rwn; Sun, 11 Sep 2022 08:41:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR7knpmilMi0RVl8wpaMVslYn3yYEKbVqwkD97+aLofknggtChEfRrIC12vDFz73EbQu6NcR X-Received: by 2002:a05:6402:5209:b0:451:2b4e:6e30 with SMTP id s9-20020a056402520900b004512b4e6e30mr8591642edd.380.1662910903093; Sun, 11 Sep 2022 08:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662910903; cv=none; d=google.com; s=arc-20160816; b=kvsLqO56Zz9j79hCUvio6s2ZldFhOwf2F4W13DxMLBkMPgts8yNqu34eCKvE93ogqs SqzfGR/Vmp+x0zDXM3pI+q7ZzZ7Uvy96I0WMwjINe1EacNa7TDkpAHryomH153FDjjna 9eoxNtEk4aY5FuEVqOdMMgx+yGEPKOu4HpOyvVVdwpgQubIpqtjs2trK6eBiHEqnGX8u 6wYlBSrutMEZR/oI45zbo+LUgTpmvVXfkNjfdfOUmAG762kZ+PF61/j+snGS0PWk1QQK HqGqBy/aacygbvqNrGvD0A41Tti1JegGSMHOCwELWnHHNXe86ZhDyeF5oXZwXOt0ad5T NNCw== 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=gUjgkgqQUfPWz+NslSISjd1M2mXkp5vFzEkXcy4Wohc=; b=BB4ny+lkFvv9LsAm6OANoQxx/O/5fVHcnSeOsGQiPCzD/AinjVyY3ktW1B1HuqF8/m SRm5pCHIBjFpClYlmPYN+5yKPV/uHSwbsJW+n/IZrOnEVZ+TLC3TlWwlqmx/0KaP/y9+ iE4Ynsi/w4XKShXdQxoCq2N93UYr28yteMQlJj5KDDeDykzgqxBN/Q0t67zURv0ie1yN QIOPROHzBXInxtsk2MPG5WtcKPNVgxYf99QhHJO6altkFTV0LV2sGoGZBsz/Xb+2ipVM UxN9v8nDBNNyvcxuiubsP0Ga8iDPxK1PMyn+b1xSwbcuU+50gh6+YBVwXxQrbN67MCzg e30A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YVmYPaTB; 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 dp15-20020a170906c14f00b0073d60665f53si4113001ejc.493.2022.09.11.08.41.17; Sun, 11 Sep 2022 08:41:43 -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=YVmYPaTB; 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 S229740AbiIKPOU (ORCPT + 99 others); Sun, 11 Sep 2022 11:14:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbiIKPOT (ORCPT ); Sun, 11 Sep 2022 11:14:19 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 671B211822; Sun, 11 Sep 2022 08:14:18 -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=gUjgkgqQUfPWz+NslSISjd1M2mXkp5vFzEkXcy4Wohc=; b=YVmYPaTBUOFkae+zv5N1DpZmAe C67K+lZVgxYE4ykj8wQ/yBeVqgpTauN4pMcjK4bQ+oyx0x/ubuPEhkdPGDJxRmd2qYZUi2oRGMbzw 4zo1lX2yctp5ie3Ofa5u4OXmJAUaTjKNWmJ2CZcEnUeGRYvavsq/mNipQq4Cl54I1ECxaADZOBqBz z4UESMIlHgHu4EMIHgBCRFOzZB3r2EKjNOMB9B3fTCtOBkKe7V1FF/IS5byuYVDtXARLywx+fP/Oa DkB68SOZt8yz0yUOgwmRkjRLG8O844Z/GEBRKGjFw2mbQc8LXR1vN2orcBBfvlmXXb2+Oq+rcOv6M FlMaTxLQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oXOez-00F95E-09; Sun, 11 Sep 2022 15:14:13 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 59289300074; Sun, 11 Sep 2022 17:14:10 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 40C362B165753; Sun, 11 Sep 2022 17:14:10 +0200 (CEST) Date: Sun, 11 Sep 2022 17:14:10 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Alexei Starovoitov , "Masami Hiramatsu (Google)" , Steven Rostedt , Ingo Molnar , Suleiman Souhlal , bpf , LKML , Borislav Petkov , X86 ML Subject: Re: [PATCH] x86,retpoline: Be sure to emit INT3 after JMP *%\reg Message-ID: References: <166260087224.759381.4170102827490658262.stgit@devnote2> <166260088298.759381.11727280480035568118.stgit@devnote2> <20220908050855.w77mimzznrlp6pwe@treble> <20220909164809.k5vkeujwpvywkpmt@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909164809.k5vkeujwpvywkpmt@treble> 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 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 Fri, Sep 09, 2022 at 09:48:09AM -0700, Josh Poimboeuf wrote: > On Fri, Sep 09, 2022 at 10:16:13AM +0200, Peter Zijlstra wrote: > > +++ b/arch/x86/net/bpf_jit_comp.c > > @@ -419,7 +419,9 @@ static void emit_indirect_jump(u8 **ppro > > OPTIMIZER_HIDE_VAR(reg); > > emit_jump(&prog, &__x86_indirect_thunk_array[reg], ip); > > } else { > > - EMIT2(0xFF, 0xE0 + reg); > > + EMIT2(0xFF, 0xE0 + reg); /* jmp *%\reg */ > > + if (IS_ENABLED(CONFIG_RETPOLINE) || IS_ENABLED(CONFIG_SLS)) > > + EMIT1(0xCC); /* int3 */ > > } > > Hm, if you have retpolines disabled at runtime, why would you want this. Because I don't think eIBRS guarantees it will not SLS.