Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp798996imi; Thu, 21 Jul 2022 11:09:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tG7cf8/BwQqAzebUArYoDX+gpbcy4t/r+KPT13L0WDkhC0c+h7jpIxhFLbxEGjQcgm1Px5 X-Received: by 2002:a05:6402:753:b0:43b:a416:3963 with SMTP id p19-20020a056402075300b0043ba4163963mr16292176edy.267.1658426992196; Thu, 21 Jul 2022 11:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658426992; cv=none; d=google.com; s=arc-20160816; b=R6djsIGmCNYNhI1enrtgC6lR9NvcxJW9etyJOEJ2nHl3JcUfF6F97aj9l7wYXL0/Q5 1oqOzkaRW9KzkFv45mOZexCbwYF2Alwv+CRG6nthgsgtMuP3uH9+rTSKvkHPQWgxrxyC GzCwz93FYAR28SrK8vlBqxNDme4u1QqLLy3mh78URLN1b/nV40jrEB7FYFziK/Tylw7l IT75xfraklxqOS3XJ6y/icyWUsCpIl/KH6yJ3MDvqvHkziZYhBFgBxVHBHP0rxzVswh+ oH/Rt3jk8kirLQN+OmOhfn5s/i3lax8f60xngXBp4YsBPZzSTXnWEVNH7CKsywpqX53L Oozw== 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=LNrx/cOdHdHv2fbOK2gcOOrw3W1FcQH2zXTJeiwcOp4=; b=sPjKfZhvANOLJCluUSClsvtBHJ8yxcdUkpl0glKsApZ029imedHGa7FjPbgNeiPzT3 ABRWol8fSk3jusT87/+vv/fOYCDKSg3fZZ0NH4aShmIcs+c6CekOWhi4h7ydCH9H7RhZ mqDTqpgyxZ06SgULTZCq7fuWhYQ9YJedlbRhPcRr2AxFlUD5CjWuk8ZVYGCllb7YfWnM IyKXXfMyqPHdzOyklZCWMwE2wnlVhBNj8K7WAW6H5E+VOh3vRVwPJ8GvLVd19NXe5q75 +2eEoi1LzlAqVYf4A+CL+nBCDVBtiJcsznP4ylVinKO5VKPbaJjLGd1scFTRPPZbs8pd wAhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Togte2G5; 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 f1-20020a056402150100b00437d7316b1dsi2602267edw.528.2022.07.21.11.09.27; Thu, 21 Jul 2022 11:09:52 -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=@linux-foundation.org header.s=google header.b=Togte2G5; 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 S232529AbiGUSHE (ORCPT + 99 others); Thu, 21 Jul 2022 14:07:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230310AbiGUSHD (ORCPT ); Thu, 21 Jul 2022 14:07:03 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6479B8AB02 for ; Thu, 21 Jul 2022 11:07:02 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id sz17so4499433ejc.9 for ; Thu, 21 Jul 2022 11:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LNrx/cOdHdHv2fbOK2gcOOrw3W1FcQH2zXTJeiwcOp4=; b=Togte2G5oCG/StzoNYsJZOWmfDBDfNTHPTQjvRoyOXrVl/DSN6cmsTN1v7xIzA89GT /5WBoDWWPF45JKj13vxqc4T1DXK9VMylucf0WlzfWB2orUhDxBOLomc08vTjmNxKma1S 1w9IbcTp7sc41hkwy4HN3fo1OinV/SYkQG7J0= 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=LNrx/cOdHdHv2fbOK2gcOOrw3W1FcQH2zXTJeiwcOp4=; b=c+40agFNZNzi9ndLFwTmeiqjBMKnXzEjmYTGCKgnE9OsGLLaxmDwXg5hCwbGOvD4fM E0VuFL6bjTaFJVpeufIZyyyh1zC50LkS9WXoj+6x1FB1Hbo3sNU/wgQa2b0mFOuODwGa xxAtu/UAz2M20qOEdZ4i2tKLEWhlrdr7FXhyPN4gKY0FTMIDr2O04yIBWmbNlFZ9xOVX CoqkL9vNrXTbS5Hp+AQvnSeAlDZ7xaw3cBBb1NqgU4xzynGcuQ644jdaXDI7B1d2Bdad hOilyZudy62bNHefD3SE2+jLSRC0pxpgVh0gNqn59FgLouAnlKqzdLGgfTlmbcp1u8xW ydtg== X-Gm-Message-State: AJIora/rHKlJA1rALqe83gLQxs6+Joz7rRWL6nGRVFctcfx/sLphVHMY JeYVbphUdJ7q8caBqV/7DLKWDS1xUag+pMMab9c= X-Received: by 2002:a17:907:6295:b0:703:92b8:e113 with SMTP id nd21-20020a170907629500b0070392b8e113mr42008561ejc.594.1658426820573; Thu, 21 Jul 2022 11:07:00 -0700 (PDT) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com. [209.85.221.52]) by smtp.gmail.com with ESMTPSA id y11-20020a170906518b00b0072b7d76211dsm1083763ejk.107.2022.07.21.11.06.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Jul 2022 11:06:59 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id k11so2923704wrx.5 for ; Thu, 21 Jul 2022 11:06:58 -0700 (PDT) X-Received: by 2002:a05:6000:1049:b0:21e:584f:3574 with SMTP id c9-20020a056000104900b0021e584f3574mr2409225wrx.274.1658426818652; Thu, 21 Jul 2022 11:06:58 -0700 (PDT) MIME-Version: 1.0 References: <87fsiyuhyz.ffs@tglx> In-Reply-To: From: Linus Torvalds Date: Thu, 21 Jul 2022 11:06:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 00/38] x86/retbleed: Call depth tracking mitigation To: Peter Zijlstra Cc: 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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:56 AM Peter Zijlstra wrote: > > this seems to work, let me go hack the kernel.. Am I missing something? Isn't this generating movl $~IMM,%r10d negl %r10d cmpl %r10d,-4(%calldest) for the sequence? That seems bogus for two reasons: (a) 'neg' is not the opposite of '~'. Did you mean 'notl' or did you mean '-'? Or am I missing something entirely? (b) since you have that r10 use anyway, why can't you just generate the simpler movl $-IMM,%r10d addl -4(%calldest),%r10d instead? You only need ZF anyway. Maybe you need to add some "r10 is clobbered" thing, I don't know. But again: I don't know llvm, so the above is basically me just doing the "pattern matching monkey" thing. Linus