Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1123759pxb; Thu, 21 Oct 2021 16:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsk6OGIB0pDIg3sZjZpuXRLmv/i9ASKiHxNsa6nVZwUYFpd4zM9M7ZVgXtJK09x9sVD4vo X-Received: by 2002:a17:90a:af93:: with SMTP id w19mr10550156pjq.10.1634858750006; Thu, 21 Oct 2021 16:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634858750; cv=none; d=google.com; s=arc-20160816; b=tQdbfpC1HjvoG8yp/KZ9X+kkP8u8BVMaH1XQIgG+ayM/Du1e+MfK9AMzGSjpz9SHuU 8H8QD65lrrb6Ty8YfmFBxI1uNmy7RcsxL7M2x/DOJ1man2za1fEFfyAC5D3+5TmnWYH3 nVazI46e4Ff+AjQuexIpwlYzv9ufx/46GftddLD1C0hmfISYS6L8iT///MFiztmdH6Az j67DFylmPh/9GkJfSykl6dsmeeNBGL42xSxQgHuhwy/ZynmqDTAfHPPpGc2GxF+kJhhp gO1XjiKDOwTBz+dO4tZV36g5lO6KHdbe0WJq8mZ8gT8CWjH/LtHlDtBqrkVO3REGo0X5 ayXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9fY2hV8XRVOO2z6eSx2Sa3uH+I+pPPBEbHLcYZ/x3/M=; b=MMkBYn381pT41wgug7VlGVaPrJ0AXh9wgEGi9TM9uuCK7hjdZnn1M5xkLDUj9joJJ+ UWXGrUQYl3IOcYBhFGfu44skg9+mJ5H7skd4fw6/YxbYdEun1y/cFc2zt49sqbmWA6dg Dn7C9mwhx4W9A9mM2J5NXD55Y/0mKkzuK44Wby8LBOOiAzUobcvFrg13DttOnKeeiI6i 36aawnees7wXwcp/cQCo/NfR36berD8e5CyLlUawD6uTz8G7wTcYz/x6zSZMEqcmhwFh tzKIym+hDy2dF/JzMwu5DpPOZ02XF/XThWysFFxgutvNxtHLycKGg02jCyMaRwabMRrM YlDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="KC+C/tSl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si7124963pll.372.2021.10.21.16.25.38; Thu, 21 Oct 2021 16:25:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="KC+C/tSl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231542AbhJUX1C (ORCPT + 99 others); Thu, 21 Oct 2021 19:27:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhJUX1B (ORCPT ); Thu, 21 Oct 2021 19:27:01 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD9F0C061764; Thu, 21 Oct 2021 16:24:44 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id e5-20020a17090a804500b001a116ad95caso1714641pjw.2; Thu, 21 Oct 2021 16:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9fY2hV8XRVOO2z6eSx2Sa3uH+I+pPPBEbHLcYZ/x3/M=; b=KC+C/tSlTIUK8G8bDPyCVtQPfsEG2oni8sQ+e9CPl8yiAk1NQd/dtP8yibo2BygPd9 4WbDgVPBIaG5s9KSFacVVxTLUb31PHRGSde1XHUyr0EFvMpcEKXiN8daXLOGXO0qm6Se A09LELqTjoKB2JsQnY/tjIJlsLItY75/jmLU73JCZy+a5E8aiLLoXeB8737xT8riyOhu ga5STNGShJZpHZ0IsBVhUwJ1PzgupV9ZWtZLXqL8vMX0Nk8k7zJPIVPL23GM2tAp2S3Q DAvwooFkWhE+czkzwKAxur3Vu5EaX6dDLVptTdkl0HrbUXxaMK5HD1bmcETTyvRfRRS/ 5teg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9fY2hV8XRVOO2z6eSx2Sa3uH+I+pPPBEbHLcYZ/x3/M=; b=iIKoa4O4snGw/dfLFDiyFmuD24J2PbWDsCIHSJSLnZ89wQLM2OLXtrsvq84nPIZnj9 EM7xlQh0oLlNjtUbvoIZ6n4cHbcX6CQ9jImK20yKb3AfXP0yy6gp2FsSir/aV96zfEgt hm7d+EBpzNihFPnXKFhi9Nf05PnbW9qKtqoNq98aqRcf5lQlGurgPryRGhQFbwT7y4ES HKRnXMofpohDe6KG262gVJXiVeiZTkfVwYCFSekuKY+9top/Fln/v/s0eJKih5agVDEJ +36SRRLA+DyAjCa/kq2zubQ15y/LcpVuuef/2ax9V+TrKTlhHIP5msh3DhIgEagw7SEw gBdw== X-Gm-Message-State: AOAM533SmDfqasYrX12nbYBZ06gMnBaddjC/tuA3THdon3laSsbtZU4e 9AyQzbyShDJBXfNQ2FF2XznPlyCiVKDzRRpKSy4= X-Received: by 2002:a17:90a:6b0d:: with SMTP id v13mr10054997pjj.138.1634858684224; Thu, 21 Oct 2021 16:24:44 -0700 (PDT) MIME-Version: 1.0 References: <20211020104442.021802560@infradead.org> <20211020105843.345016338@infradead.org> <20211021000502.ltn5o6ji6offwzeg@ast-mbp.dhcp.thefacebook.com> <20211021223719.GY174703@worktop.programming.kicks-ass.net> In-Reply-To: <20211021223719.GY174703@worktop.programming.kicks-ass.net> From: Alexei Starovoitov Date: Thu, 21 Oct 2021 16:24:33 -0700 Message-ID: Subject: Re: [PATCH v2 14/14] bpf,x86: Respect X86_FEATURE_RETPOLINE* To: Peter Zijlstra Cc: X86 ML , Josh Poimboeuf , Andrew Cooper , LKML , Nick Desaulniers , Daniel Borkmann , bpf , Andrii Nakryiko Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 3:40 PM Peter Zijlstra wrote: > > On Thu, Oct 21, 2021 at 11:03:33AM -0700, Alexei Starovoitov wrote: > > > > I nicked it from emit_bpf_tail_call() in the 32bit jit :-) It seemed a > > > lot more robust than the 64bit one and I couldn't figure out why the > > > difference. > > > > Interesting. Daniel will recognize that trick then :) > > > > Is there concurrency on the jit? > > > > The JIT of different progs can happen in parallel. > > In that case I don't think the patch is safe. I'll see if I can find a > variant that doesn't use static storage. The variable can only change from one fixed value to another fixed value. Different threads will compute the same value. So I think it's safe as-is. READ_ONCE/WRITE_ONCE won't hurt though.