Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp751654imw; Thu, 14 Jul 2022 10:07:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ujZzPkaMZO37S10JMLVxTU/krtA8P/qbyp44S6/9IzuOOuRZe6mWVR0JQ1V6HuGWqAGlHv X-Received: by 2002:a17:907:2705:b0:72b:4ef4:2d91 with SMTP id w5-20020a170907270500b0072b4ef42d91mr9550126ejk.95.1657818420980; Thu, 14 Jul 2022 10:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657818420; cv=none; d=google.com; s=arc-20160816; b=ETmVBLpsPVdMtbxLr6Go6P+jNGkVzputcCJhjESFZi0dqP40vPmTZy5WrTKacyS5m3 J7ndlz9vwpFabby13d4rp6V2T7gmBsps+rHUdHuIGnVHv9Yyzd7mh2sggZlnJRrGHr8q Itfp7eP81o3PqhyuFpTZpoizSJKs5pHeOH4c/IXPvhYkO0f8lyI+TkKAq2evk+fN5GzY DdKLmo7FdVCJIotNah/mTa+lq5ojLNTFNnjM8++Z66p4Rg8Yln2pLkbmFfoCcamqVzKP q3WsqD/Vpo/hejPwTiJXkcdBzpmR9+HdKQgFfh03Zzuj1REQtms41Db9rreT36UrcsXF ttxQ== 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=Pm+iphli5RRfa4JmHeh81lVBkwRMzWQKLMKTsw18lMo=; b=HE7HZcIlkuDjJeAq8QvpmiXSXjDYBrUzzdkhg0P4nSsEfCy2UbvoXpLME/awl88If/ Fk+gOtNKsFu/8MY1OO30GmMpOCSwEwl5PEFPEOrdxHa5BS66fC+DL23B4TgqKX4p7TX0 +9spViClkzGfAT+u5z/rXJstt1+4PslGZhxN4WMcl8kNEgilFmlwylgIeGjZCuvz1Es8 0evPSgTKvZU4wmUzpTmNrte5JmzSrVur9xXUGQwbLm6o0TT56WEzWr3CrKsa+BCXz3mJ Gz0VIGAaQ/MzzvUde5uY7X+Hljf5nRYKVtxh/Yja0y1udOwYLg9DYkCTAv5owj9UiN09 kRFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Z6ZquADL; 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 sg43-20020a170907a42b00b0072b86efad16si1010813ejc.643.2022.07.14.10.06.34; Thu, 14 Jul 2022 10:07:00 -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=Z6ZquADL; 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 S233854AbiGNRDT (ORCPT + 99 others); Thu, 14 Jul 2022 13:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239659AbiGNRDT (ORCPT ); Thu, 14 Jul 2022 13:03:19 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17BC15724C for ; Thu, 14 Jul 2022 10:03:18 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id dn9so4511038ejc.7 for ; Thu, 14 Jul 2022 10:03:18 -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=Pm+iphli5RRfa4JmHeh81lVBkwRMzWQKLMKTsw18lMo=; b=Z6ZquADLYu4uMwnTfB77Llp499vJAhe+VRkqcHP7yOsgzWOu9zDeuVv569iCGwq/TN n14hSaPCbUQ38LjnNOasq8gCvSbs/42WYABjzHa4Zob3/Bzo6643Bg7S4R0uqisbfoYa ihvN3aq2+yGj/oCPRE7nev9NxH4BVy6V92VdA= 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=Pm+iphli5RRfa4JmHeh81lVBkwRMzWQKLMKTsw18lMo=; b=Th1lKxdcOGY1eWqJY/DO23EPIFYFgu+mBDQrA87hpkyHXh4SLg6/224nT+KgeyeHpc sEuBhg1Wsc0emW5xfzYjet23MU90fTkuQimoyTPgLmjSUn/tHb2anuhFootnRYS+/R1N siYwesZZvWJv6TuZzqlkeJ3SkzlTHtvs5ILfG6kWdau/ZPi31E4rgpp2hGsTmHCKO+F+ rdpVHlBNNNhWfCSLryKuYdwJb/AtNEqHjbHHNud1XPEaMk9nLmqyZYENnGMGj1bzU/2n rKz3ymhI3dV6AGG8EOrDG2czy0UaMbndaWe9xJ+EbghNMLEsyJcf1TTb0PLnZm7ZwRFr U8uQ== X-Gm-Message-State: AJIora93IbxmIPAEZUl5u/7sD7HNYsQZYm2DVygZVNohhEMVU8olXfgF YOPiQsppfqCWVQymhVrweZH9WmxmRXysBBgN5a0= X-Received: by 2002:a17:906:4fc4:b0:6da:b4c6:fadb with SMTP id i4-20020a1709064fc400b006dab4c6fadbmr9689337ejw.282.1657818196406; Thu, 14 Jul 2022 10:03:16 -0700 (PDT) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com. [209.85.221.47]) by smtp.gmail.com with ESMTPSA id b6-20020aa7cd06000000b004355998ec1asm1322133edw.14.2022.07.14.10.03.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Jul 2022 10:03:14 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id r14so3418359wrg.1 for ; Thu, 14 Jul 2022 10:03:13 -0700 (PDT) X-Received: by 2002:a5d:544b:0:b0:21d:70cb:b4a2 with SMTP id w11-20020a5d544b000000b0021d70cbb4a2mr8990916wrv.281.1657818193135; Thu, 14 Jul 2022 10:03:13 -0700 (PDT) MIME-Version: 1.0 References: <20220712183238.844813653@linuxfoundation.org> <6b4337f4-d1de-7ba3-14e8-3ad0f9b18788@redhat.com> <8BEC3365-FC09-46C5-8211-518657C0308E@alien8.de> In-Reply-To: <8BEC3365-FC09-46C5-8211-518657C0308E@alien8.de> From: Linus Torvalds Date: Thu, 14 Jul 2022 10:02:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 5.15 00/78] 5.15.55-rc1 review To: Boris Petkov Cc: Paolo Bonzini , Guenter Roeck , Peter Zijlstra , Thadeu Lima de Souza Cascardo , Greg Kroah-Hartman , Naresh Kamboju , Florian Fainelli , kvm list , Andrew Morton , Dave Hansen , stable , Linux Kernel Mailing List , Pavel Machek , Jon Hunter , Sudip Mukherjee , Slade Watkins , patches@kernelci.org, Sean Christopherson , Shuah Khan , Ingo Molnar , Thomas Gleixner , X86 ML , lkft-triage@lists.linaro.org, =?UTF-8?B?QWxleCBCZW5uw6ll?= , "H. Peter Anvin" , Anders Roxell 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,T_SCC_BODY_TEXT_LINE 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 14, 2022 at 7:46 AM Boris Petkov wrote: > > On July 14, 2022 1:46:53 PM UTC, Paolo Bonzini wrote: > >Please leave that one out as Peter suggested a better fix and I have that queued for Linus. > > Already zapped. I like Peter's more obvious use of FASTYOP_LENGTH, but this is just disgusting: #define FASTOP_SIZE (8 << ((FASTOP_LENGTH > 8) & 1) << ((FASTOP_LENGTH > 16) & 1)) I mean, I understand what it's doing, but just two lines above it the code has a "ilog2()" use that already depends on the fact that you can use ilog2() as a constant compile-time expression. And guess what? The code could just use roundup_pow_of_two(), which is designed exactly like ilog2() to be used for compile-time constant values. So the code should just use #define FASTOP_SIZE roundup_pow_of_two(FASTOP_LENGTH) and be a lot more legible, wouldn't it? Because I don't think there is anything magical about the length "8/16/32". It's purely "aligned and big enough to contain FASTOP_LENGTH". And then the point of that static_assert(FASTOP_LENGTH <= FASTOP_SIZE); just goes away, because there are no subtle math issues there any more. In fact, the remaining question is just "where did the 7 come from" in #define FASTOP_LENGTH (7 + ENDBR_INSN_SIZE + RET_LENGTH) because other than that it all looks fairly straightforward. Linus