From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B66F1A304A for ; Sat, 18 Jan 2025 21:18:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737235108; cv=none; b=lNvS/Ya01P4aFnOtGdl/yv32EAvnYYivTvekYEtDbgdZPiy196bGCh7eLXrVm282FBn7thRk31YWZsGCzdidxNnGTkuuv/7Ovdu69/T+M7yU7EMa+nL+XEKWMa5Gtqj9va70GCglg6ZqKoVx4+d4SL+NmzNOFrakuuJuaNPk9QY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737235108; c=relaxed/simple; bh=2QypFOyBLocyVmtS9wSQ8Mg721Fos6KRUWcaAc30eiI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=O6fvYDdNJ6Iaa+X0bdmdnHeuSuoEJI/jWvS+fFDFCyG0F8zbdSlFddbWSxtff0S2qgmUQADWMLYATLMCmM/GkSXYZ1sW80YLsOiEESpDKH4e+rpx5tTpYqV41dnk8bMMMzAux4GbM4xaZ9P68dNIiM0W6AwlcmdMAOeCC3lH8I8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SKA1cGLH; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SKA1cGLH" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-385de59c1a0so1802131f8f.2 for ; Sat, 18 Jan 2025 13:18:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737235104; x=1737839904; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=mpf4SfqnD25J/YTWoixYifvlss+fNguqHz/eTGg6pfY=; b=SKA1cGLHh5ou3wWSQw8Tn23mjsTk+Q8ZkUaY9kMB538J1NzuqPCk1/ZxlcC8Uuxnqw O+MCmpXzBOSF6cNMl+F+KuOOwO+9WTP8XVZg29DC072y6AAO/iOL75Awccf70AiytCLz BNFWU3bQjLcTk/JLWyUnrxqSZx4pBsBKilxHej/xa8hvMqGouZsA7kMWAZyQ4hxPZNVn 7n+XtSoK2F564DCzwlnfB+2oyvZ26DxPYq84UVsMLXqpJ783UL2J3/Yfkcvyk3SQvKlC 2LsL7HtmqQ+JMe7Yyq0Vq8mxMyftSb/OnsdpNWZ9IzkqLb+KnHrUaqaOv4+qh4iXf9zt 6TsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737235104; x=1737839904; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mpf4SfqnD25J/YTWoixYifvlss+fNguqHz/eTGg6pfY=; b=S9MEJdVGIHS1x3TX9CGX+cUJ8wQG9jbMzh9+gI4lj2Y5Plr+pWy8cEE8UyBDMaeoAh 2kk5pF4M7smdXuScjgGi1gJ2yj8VzB68HvEwe27JFv0xWLx7bSHAsFmBhRuFttGjCK5i N057OQNPFFr9I8Sm1xXGqyVjve2ZtFlK3I+P/hxFuct5KzaAEcN9L5+HhYE1Ik8ys9+4 dQcJ5eajG6S2UWLmH5mngyzm2DG7qSUCqWWv3mly2nXZCls/xRR9iBgn5CXRuVJtjsFu jgsx8YsQrzXM63q/Yd3irpytudVUKyO4eemdZslY2YwhpQClI9T3mPa/7lsmrWoWZGHa fypA== X-Forwarded-Encrypted: i=1; AJvYcCVI4Ov5CrbhgFgRBSDwO09uE8N4bjKGQL91GXmHxQ0cgom4b6D7+cqpyUXwGoe9u/J+n1AMduxO4Zmg9wA=@vger.kernel.org X-Gm-Message-State: AOJu0YxDtL3SYf6RKCHDXAl4Km4CyPB26J21CVYe+z4s8y6JQ02B7tSH QEuBLbM0Y8m1ZzNbs7ZNj+4p+e3dsr63hgFU3IAgrX+nDBsg0A5t X-Gm-Gg: ASbGnctHk5HyUwg2VImKpZyIkzOw2BpCXWtZMzBwMYJzdWEeYKXzS8S7bPcqepnZtJG k2kbmtKqbxqmB4oG5SGcIiDBi1ZmVTClYNd2nUcyB9IEPno/4Pp1MGf3XA2F5QjLKpp7GFMrgQt hOe3j/vhdH691XvdjzlqFuIuXZDY6NGjp6e5K5Z10WS+LPiAOoacLlcWRTufRkECZDfTZa5BT2s aSiJVIztfiz+TogG3RdKCg59XxybLMzCzR7LglNyG1WaGHy1P3VtDDFM1Ms6SM5MMORQ+4F23iC VfID278q4qfdt0mtqEz1OCDjljNYv2aJ X-Google-Smtp-Source: AGHT+IHzC49qJigI15jYyMO47UhxKy6QnmDwTiLc/s5hoO6z29BxgyRIOihRyPzxw9V9nFo/UtDyAg== X-Received: by 2002:adf:e84a:0:b0:385:f0c9:4b66 with SMTP id ffacd0b85a97d-38bf5686090mr5730089f8f.33.1737235104085; Sat, 18 Jan 2025 13:18:24 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf32754dcsm6106637f8f.77.2025.01.18.13.18.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jan 2025 13:18:23 -0800 (PST) Date: Sat, 18 Jan 2025 21:18:21 +0000 From: David Laight To: Guenter Roeck Cc: David Laight , Linus Torvalds , 'Arnd Bergmann' , "'linux-kernel@vger.kernel.org'" , 'Jens Axboe' , 'Matthew Wilcox' , 'Christoph Hellwig' , 'Andrew Morton' , 'Andy Shevchenko' , 'Dan Carpenter' , "'Jason A . Donenfeld'" , "'pedro.falcato@gmail.com'" , 'Mateusz Guzik' , "'linux-mm@kvack.org'" , 'Lorenzo Stoakes' , intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, David Airlie , Simona Vetter , Jani Nikula , Rodrigo Vivi Subject: Re: Buiild error in i915/xe Message-ID: <20250118211821.7cb5140f@pumpkin> In-Reply-To: References: <34d53778977747f19cce2abb287bb3e6@AcuMS.aculab.com> <20250118170959.3aa56f4d@pumpkin> <29ef57a1-e4dd-4d5d-8726-f1f79c698b66@roeck-us.net> <20250118180916.433bb73c@pumpkin> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 18 Jan 2025 10:36:11 -0800 Guenter Roeck wrote: > On 1/18/25 10:09, David Laight wrote: > > On Sat, 18 Jan 2025 09:49:21 -0800 > > Guenter Roeck wrote: > > > >> On Sat, Jan 18, 2025 at 05:09:59PM +0000, David Laight wrote: > >>> On Sat, 18 Jan 2025 08:13:06 -0800 > >>> Guenter Roeck wrote: > >>> > >>>> Hi, > >>>> > >>>> On Mon, Nov 18, 2024 at 07:13:31PM +0000, David Laight wrote: > >>>>> Use BUILD_BUG_ON_MSG(statically_true(ulo > uhi), ...) for the sanity > >>>>> check of the bounds in clamp(). > >>>>> Gives better error coverage and one less expansion of the arguments. > >>>>> > >>>>> Signed-off-by: David Laight > >>>> > >>>> This patch triggers a build error when trying to build parisc:allmodconfig. > >>>> See error message and bisect log below. > >>>> > >>>> I don't think there is anything wrong with the patch. The underlying > >>>> problem seems to be that parisc:allmodconfig enables CONFIG_DRM_XE which > >>>> tries to build the affected file even though CONFIG_DRM_I915 is not > >>>> enabled/supported on parisc. > >>> > >>> This has appeared before. > >>> Any idea which inlined copy of scale() is causing the problem. > >>> On the face of it they all look ok. > >>> > >>> If you can reproduce it maybe try commenting out some of the calls. > >>> > >> > >> See diff below. All three changes are needed. > >> No idea why the compiler would know that the values are invalid. > > > > Maybe it isn't even an inlining issue. > > Perhaps that compiler just doesn't like the function ? > > What happens without the 'static' (and an extra prototype)? > > > > > You mean like that ? > > -static u32 scale(u32 source_val, > + > +u32 scale(u32 source_val, > + u32 source_min, u32 source_max, > + u32 target_min, u32 target_max); > + > +u32 scale(u32 source_val, > u32 source_min, u32 source_max, > u32 target_min, u32 target_max) > > It doesn't help. Worse, after that change the error is still reported > even with the #if 0 elsewhere. Yes - that means the compiler is 'objecting' to the scale() function itself. (Without any regard for its callers.) Which should make it easy to reproduce outside the kernel build. I think Mat had a successful build with a different (older?) version of gcc for parisc. There must be something odd causing the problem - there will be other clamp() calls in the build that don't generate the error. Remember that lack of the error messages requires the compiler optimise away some code - so if the optimisation is skipped the call could be generated and the warning output (even if the call is optimised away later). Perhaps there is some obscure interaction with the WARN() statements? I don't have the required compiler (neither does godbolt). David > > Guenter >