Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4089861pxb; Mon, 4 Oct 2021 17:16:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo9tVwq0Hv5wWfC+rWdfkhTDtgXH3oIzhf6GJgO4hHFf6n8xeRXaAAPTfBmfy82J1iGblJ X-Received: by 2002:a62:2f81:0:b0:44b:b390:956b with SMTP id v123-20020a622f81000000b0044bb390956bmr27200483pfv.30.1633392977572; Mon, 04 Oct 2021 17:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633392977; cv=none; d=google.com; s=arc-20160816; b=dAwTR8aQd1ul3iHm+QZRo1oCZD52vnLjEcsbZHmScDslZHXJsOJzuoCHL5lGh6Zj+r Z+L6UK5dOkxpm++OETMxdcEvd4AlH9SFBH9P7lB+CF25IXRKBZ4gUqetwhLXlf12JjcY l5bf5AAeGVEO+wV0WVNssmS9magt7KfXXxSjZQ8FV85SnRlBOR7HJnW78UXCasVMG/lC BexBPxYmz0rrI/WRVwgzTeKmHV4mutT8r5O3IX3d+INGrcI/yD6M6zB7zdJQ9458rVY3 5MQGSGT70ySgnJhzs5CiF8+VX1Rk/70hB6GOKM/RWXA4G9Hnk4DUIsBR2+yFJJyC97WV z4lQ== 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=a+ErGJ+VGql1p2hYj8IB8VzyrOn66LWzrHaFsKIvDKc=; b=C60tWKhTRmBsu8BMzOItubs401xLKcH+SC5VKlA/XN2k98FNepxACgfxxuCFL2ZMax 6mrFbdFGhmLBdSgLYeUU/irX3zSsVHnk5vTU+hXR/atVe18GlDhBhoCJA5z5dOUvmtzE E4TF0sfbBDyKf8IAcgWEgTa+9vtdIRZPT4vA4uBlvri6dAk4yanEwScid256x9Z8cYhe 47UwYahVjJuOe+zGWV4uryYzXUvAPijadOyLeF+bXt1Wzws/kglI3iZFtmqa6GScG02U Z3n97iE5NSczQyOovt7sA3QoaC1oclfwz5uEY3owiVHmUWp5eEfgNDreR1ReSVk7O68A iVmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=h3oETci+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t24si21123391pfl.116.2021.10.04.17.15.51; Mon, 04 Oct 2021 17:16:17 -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=@google.com header.s=20210112 header.b=h3oETci+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235345AbhJDROg (ORCPT + 99 others); Mon, 4 Oct 2021 13:14:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbhJDROf (ORCPT ); Mon, 4 Oct 2021 13:14:35 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7536AC061745 for ; Mon, 4 Oct 2021 10:12:45 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id s24so22517095oij.8 for ; Mon, 04 Oct 2021 10:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a+ErGJ+VGql1p2hYj8IB8VzyrOn66LWzrHaFsKIvDKc=; b=h3oETci+oft1UmX7a75PmczGicHfNM5s7F1GFBCDQAi2EkNVdjUq790hKUp30ANFFB VyrGByJzeZyminQFTMyMDLeLWiLWn0YYTgy/Eu9n88lHJh1Fi/M1vBf4/4eVqSgZKDRy ju5U30zZfx3TzeOig6VKJQYkuqmr6D2kRvJrrJ4wDzbUT/kgQ3q7E9lBVhpmjTwHuhF+ /xHIwFAh0IyB9k4+YRnCvq7uLa54RD6q1ZEZb9fBuRnaeorCLkgAi91kVZPSVVH1mj2q Q7OyirHgV0SPFP3Nloc2CC8YfmIDiov3hLTpL77SAUKONdca4EAZznblaoem1xstXZxn H8AA== 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=a+ErGJ+VGql1p2hYj8IB8VzyrOn66LWzrHaFsKIvDKc=; b=Z+4BAsrV9zjpSJggZKOdp3vjR2hnNDt1RvBBnNoUW8cnA2XC2LGbCYkbo7OSHKlGwL i5MRWRabV7HsPXpacfHreFD2c3HNgARra08crznfRNMGLKFTf3fSLxae75bSXAKUqk8L WAMOpIp67PtkeC4fvS8msBLkeErTQxRRVGLZuLRPDhtFBKfJV1mNtBEPGIs+ZoZML2yw CAcxbHs6j/Tgj8o91QHtIRmQSJot9IZN6anlcsjFpLJLU7uEX7bP5yCjHB6ggxSAD/hF V3t802knQobnuj0jjEp8WF2TOkLZ8CWpFz40j41M31y0AOMOjh+1o0D0BJ6UjQI0WcVH CBGw== X-Gm-Message-State: AOAM532MIClt02riF4kNG3dLy2TLxXBoGohU8hH/9fsDITKlv9LKUowl ctJ1bNDAv6h63oHg3sdbNrtUdbp+TRAXOu4qp30lvw== X-Received: by 2002:a05:6808:180a:: with SMTP id bh10mr14867864oib.6.1633367564474; Mon, 04 Oct 2021 10:12:44 -0700 (PDT) MIME-Version: 1.0 References: <1446878298.170497.1633338512925@office.mailbox.org> <936688112.157288.1633339838738@office.mailbox.org> In-Reply-To: From: Jim Mattson Date: Mon, 4 Oct 2021 10:12:33 -0700 Message-ID: Subject: Re: [BUG] [5.15] Compilation error in arch/x86/kvm/mmu/spte.h with clang-14 To: Nick Desaulniers Cc: Paolo Bonzini , torvic9@mailbox.org, "seanjc@google.com" , "vkuznets@redhat.com" , "kvm@vger.kernel.org" , "nathan@kernel.org" , "linux-kernel@vger.kernel.org" , "tglx@linutronix.de" , "bp@alien8.de" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 4, 2021 at 9:13 AM Nick Desaulniers wrote: > > On Mon, Oct 4, 2021 at 2:49 AM Paolo Bonzini wrote: > > > > On 04/10/21 11:30, torvic9@mailbox.org wrote: > > > > > >> Paolo Bonzini hat am 04.10.2021 11:26 geschrieben: > > >> > > >> > > >> On 04/10/21 11:08, torvic9@mailbox.org wrote: > > >>> I encounter the following issue when compiling 5.15-rc4 with clang-14: > > >>> > > >>> In file included from arch/x86/kvm/mmu/mmu.c:27: > > >>> arch/x86/kvm/mmu/spte.h:318:9: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] > > >>> return __is_bad_mt_xwr(rsvd_check, spte) | > > >>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > >>> || > > >>> arch/x86/kvm/mmu/spte.h:318:9: note: cast one or both operands to int to silence this warning > > >> > > >> The warning is wrong, as mentioned in the line right above: Casting the bool to an int doesn't seem that onerous. > > > So it's an issue with clang-14 then? > > > (I add Nick and Nathan) > > > > My clang here doesn't have the option, so I'm going to ask---are you > > using W=1? I can see why clang is warning for KVM's code, but in my > > opinion such a check should only be in -Wextra. > > This is a newly added warning in top of tree clang. > > > > > Paolo > > > > >> > > >> /* > > >> * Use a bitwise-OR instead of a logical-OR to aggregate the reserved > > >> * bits and EPT's invalid memtype/XWR checks to avoid an extra Jcc > > >> * (this is extremely unlikely to be short-circuited as true). > > >> */ > > >> > > >> Paolo > > > > > > > > -- > Thanks, > ~Nick Desaulniers