From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E662AC433FE for ; Mon, 4 Oct 2021 16:13:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7B8361206 for ; Mon, 4 Oct 2021 16:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236499AbhJDQPk (ORCPT ); Mon, 4 Oct 2021 12:15:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236525AbhJDQPV (ORCPT ); Mon, 4 Oct 2021 12:15:21 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB9EEC061753 for ; Mon, 4 Oct 2021 09:13:31 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id i24so24554538lfj.13 for ; Mon, 04 Oct 2021 09:13:31 -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=wu2Sbxcf5EVRYolmaoh2RSe+DqpVoS+BAjX+Kaizi48=; b=f/uWlCZP2+MFwzszq+m0m/TsYjyg7V/v86sUvQ8S9duOnhju8rZ8HKHGMe+gjCVmq6 MiqJhuiHfxe9QAe5wZdWtGxKDTh11YgDPeXlmzhK+a5wSamY1h0PYbEBfdpYVZLd+q3j 4x/8wPbPnNwgxUGbiBEs7D00SfKnxEctE0BaTwpOMbzOk9lLdevbvls9texMD57lb9lZ 0Cn6y61otXRZZLcbgaRO159+pbK5R6jivc/WCyZzttjJcb/DZdb+wGMHiTBr3wooaMxr NHGqJxGhoX413/DJuZ2rR7s8iWvmMDqu6q1T2R6/4GQIdtoXBlbBHZA4C85kS4k8GyiJ hbCQ== 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=wu2Sbxcf5EVRYolmaoh2RSe+DqpVoS+BAjX+Kaizi48=; b=aviCKe0JlO1VEatk7m837/npiXm1zHWJ1Tz3bgAMhSpIkFb7XFjDyapiWQH5RGp5l9 2CBLTaSbS7ZmiyoNK5YrBE5hY9+PMCYH4CKcEREqq1f3BCZx3nQANj+DQegXDqh5+gu+ t5Bvmg0WNZcBA4O0yewLsFS5XQ6pmGNMLDi/fVtAUE9ddkxeDIaEBHVuqqzdUfsITRHz tAl+j7ObwI1V5J5DYxtFVoBga5Kw5czQhhiLaffdtdW4i3OTwJS5rPvYurRTunvMc/we 5Y4/+bs532yLLpVu4JSDhTeat0YMdRohlSoGB+8XbXecu5UgAnXdri8Y1MHOYTw7bZKM mSMw== X-Gm-Message-State: AOAM532eEi71MJr5cxp+L30Sxv1V9ON1lW3p2oV7/pvNUuf5LCdawQKr SIjFW0pSxibAV/inV9xIWzJ4p3bYW0WJLo1Y3ImZXA== X-Google-Smtp-Source: ABdhPJxvCRV7JJ//o6iMYzW5L1q/SZH90XtOI+mjrFOlvB4QT+GKZmFWCCbthQOs7zyoP8qP/M79xBk9fx7vs6r7l34= X-Received: by 2002:a19:6a16:: with SMTP id u22mr15585258lfu.444.1633364006443; Mon, 04 Oct 2021 09:13:26 -0700 (PDT) MIME-Version: 1.0 References: <1446878298.170497.1633338512925@office.mailbox.org> <936688112.157288.1633339838738@office.mailbox.org> In-Reply-To: From: Nick Desaulniers Date: Mon, 4 Oct 2021 09:13:14 -0700 Message-ID: Subject: Re: [BUG] [5.15] Compilation error in arch/x86/kvm/mmu/spte.h with clang-14 To: Paolo Bonzini Cc: 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 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: > > > > 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