Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4083649pxb; Mon, 4 Oct 2021 17:07:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/mXE0hMf0mXKi8YS1gO0DintG6NPeCifntrQN5HivzWLqj+rLZug0PvCK3Xy7Lse/OIHd X-Received: by 2002:a17:906:7007:: with SMTP id n7mr20182956ejj.275.1633392441364; Mon, 04 Oct 2021 17:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633392441; cv=none; d=google.com; s=arc-20160816; b=Za65PogFuAPkYllo4A6Jve2LOm8kTlQC7LzDiimSkZmyusMmG/a+ZR3HiIhKfxbRiu lrAZ/JqGxVUap+Sz8GbbzwM5LuNmup32EQC5mroGiVrY/AGn4lO3yw0X/QDBNqC8c7bu UpN8xW2wTs7nD61tZzaxyo2jH9BML6umNaUHr+EjB3dDjl1wGxAQkq1wLRQHTobvkXYX BsDOBpM191brTOwQMpVegG9peAoOfwB9Yp1mlY4Tb/VXaSbjDGb2/lsGyHnvozrucUOy 6dyF7+6DnQ+NHvO5vOu/fGvaDBpCGjfQTVvuUi6LVFZZ4XgL5F8Krlmbg2e688n09cd5 GvjA== 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=wu2Sbxcf5EVRYolmaoh2RSe+DqpVoS+BAjX+Kaizi48=; b=EnEKjDCY3ApggB/ofn0ZfE5BIq36WHeS91DbcNcQDR23RhM3lWjS9lKVl4P0I0Utq0 Wir7yuNpZ5PnRfn1oliHga2nu8ohxsInYyzDg0nxIUopqE6XObpcV0x1nI7Rnsq3Ilsb +RonyMzSDzwS1y/grAhReOJbUBNuKz5pkcyyVOwd7KSmQyOjIwgwMXhk0w215vShA/jv wwzIgC83yl67MLgHFB2aBe6vhN/BQ6TwihV+j26IoNfZ5sjR3r6QNuuIegp5cVLUtLLd HTkbjyj0slwgih7hlDYxxJuJFvZUVt4QS419HLUG6Xv0EPpJX8IfKMVFL9eEKVBHNq2u xAKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="f/uWlCZP"; 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 m16si2543385edv.312.2021.10.04.17.06.57; Mon, 04 Oct 2021 17:07:21 -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="f/uWlCZP"; 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 S236531AbhJDQPj (ORCPT + 99 others); Mon, 4 Oct 2021 12:15:39 -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-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