From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8916606A338 for ; Thu, 5 Nov 2026 14:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=l9RSbETa Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DAD46112491; Thu, 5 Nov 2026 14:06:20 +0000 (UTC) X-Greylist: delayed 363 seconds by postgrey-1.36 at gabe; Wed, 04 Nov 2026 16:13:45 UTC Received: from mta1.migadu.com (out-119.mta1.migadu.com [95.215.58.119]) by gabe.freedesktop.org (Postfix) with ESMTPS id E6D6710FD00 for ; Wed, 4 Nov 2026 16:13:45 +0000 (UTC) X-Envelope-To: intel-gfx@lists.freedesktop.org DKIM-Signature: a=rsa-sha256; bh=8h6G/EKHbetMFLZ3FoTwPAwj6jQwPZCmaugSiKT4/5M=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793808824; v=1; x=1794413624; b=l9RSbETaBpaa66ARvl/1EF1+GPT7ZSk2472DACu957EjIGMGw+yfpg4KpgliabVFTCcpsHMm OChwmzsTi5htLqhvkdtP461PCWd3ifCbXudTF4hthX8QhoRKqD9jVgldOEN9nKcQRe3jH8g/L7c bkik75JhtRKUHz9s20r2hOv4= X-Envelope-To: intel-gfx@lists.freedesktop.org Received: by smtp.migadu.com with ESMTPS id 64b2df2fbae2508c; Wed, 04 Nov 2026 16:07:38 +0000 X-Mizu-Trace-ID: 64b2df2fbae2508c X-Migadu-Flow: FLOW_OUT From: Vineet Gupta To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Peter Zijlstra , Juri Lelli , Vincent Guittot , "Joerg Roedel (AMD)" , Will Deacon , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , Matthew Brost , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Cc: Vineet Gupta , "H. Peter Anvin" , "Xin Li (Intel)" , Brian Gerst , Nikolay Borisov , linux-kernel@vger.kernel.org, Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Robin Murphy , iommu@lists.linux.dev, Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org, llvm@lists.linux.dev Subject: [PATCH 0/4] Fix the x86 defconfig build with GCC 17 Date: Wed, 4 Nov 2026 08:07:17 -0800 Message-ID: <20261104160722.1637541-1-vineet.gupta@linux.dev> X-Mailer: git-send-email 2.56.0 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 05 Nov 2026 14:06:18 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-gfx" X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Fix build warnings and failures (CONFIG_WERROR=y) with a GCC 17 build. GCC 17 adds -Wconstant-logical-operand which is strict about operands of && or || that fold to a constant other than 0 or 1. In the past similar fixes have been done for clang, e.g. 93f56de25937 2017-04-06 mac80211: Fix clang warning about constant operand in logical operation [v4.12-rc1] ... dd7fe5d9fd6a 2024-01-17 rtc: max31335: Fix comparison in max31335_volatile_reg() [v6.8-rc1] The reason this trips only with gcc is that clang's toggle is more permissive: - it checks RHS only, not constant LHS. - Macros are not checked. Fix is to effectively make a macro or condition return 0 or 1. The patches are split up per subsystem and can go independently via respective trees: 1/4 x86/cpufeatures: the awk-generated *_MASK_BIT_SET() returns 0 or 1. 2/4 wait: ___wait_is_interruptible() with a constant state. 3/4 iommupt: PT_SUPPORTED_FEATURE() in the fvalog2_*() helpers. 4/4 drm/i915: IS_POWER_OF_2() in reg_bits.h, and two Kconfig timeouts. Tested on x86 defconfig with CONFIG_WERROR=y, at each patch: - GCC 17 trunk (20261103): each patch removes only its own errors. The build has no warnings after 4/4. - GCC 16.1: the build has no warnings. The .text of each object file does not change. The only differences come from the build timestamp and the release string. Vineet Gupta (4): x86/cpufeatures: Make {REQUIRED,DISABLED}_MASK_BIT_SET() return 0 or 1 wait: Make ___wait_is_interruptible() return 0 or 1 iommupt: Make PT_SUPPORTED_FEATURE() return 0 or 1 drm/i915: Avoid -Wconstant-logical-operand with GCC 17 arch/x86/tools/cpufeaturemasks.awk | 4 ++-- drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +- drivers/gpu/drm/i915/i915_config.c | 2 +- drivers/iommu/generic_pt/pt_defs.h | 2 +- include/drm/intel/reg_bits.h | 2 +- include/linux/wait.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) -- 2.53.0-Meta