Received: by 2002:ab2:7853:0:b0:1fa:5c73:8e2d with SMTP id m19csp31652lqp; Thu, 30 May 2024 11:02:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZdskq8OKQNhaBTwMNeNHkjQ33iRowR1oVF79HdekIJJxxCyqj/r/fI0l1cNhsK2nyG4YHJnf3m1coAkKPIBDLIEYuTGYuyUMM3eJpDQ== X-Google-Smtp-Source: AGHT+IGfzbeV7+HHJdSqapVryutzmB2eB/C+Ouf4ux+gUqeadUE3iPyrq74flBRd5qreialZ8bu1 X-Received: by 2002:a05:6a00:32c4:b0:702:24b3:d022 with SMTP id d2e1a72fcca58-702313d9e3fmr3352592b3a.31.1717092155269; Thu, 30 May 2024 11:02:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717092155; cv=pass; d=google.com; s=arc-20160816; b=PwY3hHhCwr3RnnfAIHTYU1fMIpQ8exTWmUfnGiOzALgafQBk08mKmpBFiVMHCzy/DX qzzeWneficTlol9bkMXDX8m9g4L7JeGfCuxBmTd6F2eISCGLlfoGaUYvuVzpwlYLQ7qg 53/c3Hz4MzSO5hX8Yty6+TudDbnu0PFPOwiZtg+SNJLxfbOi2YbZbrkOUmXPzI2XnjK3 N1UoY55dtZDVXFAGyic+MpkOYerAj1xcZPKfk82N5o4z7cLUICBgYhEqnyOUKf1PpuMj iPBmaJisfuCfJSA6A0R7GFYoUAfXw/O5GS3Bcybj9AVSvz1qWrLVFxhzeLKqExyNQlhm tghg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=G9zvrFKKudL7vj4TTxEJqHlgYPgNcGxHpMrRef56wJs=; fh=n4tZHdN5ZO0wBaRHaxrTeaj4Xz7D6cy0OK4d99dTV6w=; b=HkAAWrIbHTgbzDSZQlhyBYDURwiDJ4oT3k8BQQ7M8tD85EfSSqitcjocQi2nZ6oM1A 3NgDPiYPWjr0ondVEMJpb48BNw4kAgbnLV3qVKJlzdmE1puDRazQ0VcMZ5oG2+MJNigL OfcA8RutIEd0eYQUbqXT5V7VH6U402JErBaMA12GVx7tCXFYAOd4DnDRl9AAb9qJiDAI ru+QG9Xqgs6VTwP4jpUliUmHPiGhP3GlangqMi2dUF+W5Azo3mb1oVB7w8ffU6CMfF7U eMhiAZSOOo6l7rxHv765Bc9MTfVV24J79gUQ515fRXmLqX9s3iQDwqIfg2fQwmQCmTJx 3iRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-195759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35c831d98si55399a12.765.2024.05.30.11.02.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 11:02:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-195759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0747E28356C for ; Thu, 30 May 2024 17:51:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3104E481B8; Thu, 30 May 2024 17:51:05 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3C65219FD; Thu, 30 May 2024 17:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717091464; cv=none; b=ia7qqTQnfAz6r3xaHB1pStYsiq0A+oEjYo+dT5/OOoqm4JGx8pokd4mnvAtXEphL1ZGZ/5NUW6AxGdoBDyBWhkSxk7rxU6Aor445RSvZNiDZHUvA1cl0lZBX3q39+wd/SYukJdfMy6vBJgjZAxIu0gINDhO8jF5S1QsKgkJoSx0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717091464; c=relaxed/simple; bh=EWIEk0SfL1qoQ87T87n2tHcu+axuW0rhQYyxUX24uEU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rsmi7XdxQrsGHPa2xbgCNNQzqun9L68/ls8d/UMeshgw9KRwpglh97pGNvIQBSLY5QwSrTx96zcSlLSDKUY5Qf75wnRJOKo8N7FeLlKcS8RIlgETQYrcQC/y8NF96HBbe/E5DhMnEy/FiMczw99p1eW8z/+nBfc8smwBRYIbMac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 546CB1424; Thu, 30 May 2024 10:51:26 -0700 (PDT) Received: from [10.1.196.40] (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B93ED3F641; Thu, 30 May 2024 10:51:00 -0700 (PDT) Message-ID: Date: Thu, 30 May 2024 18:50:59 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v6 13/21] bitmap: make bitmap_{get,set}_value8() use bitmap_{read,write}() To: Yury Norov Cc: Alexander Lobakin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexander Potapenko , nex.sw.ncis.osdt.itp.upstreaming@intel.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240327152358.2368467-1-aleksander.lobakin@intel.com> <20240327152358.2368467-14-aleksander.lobakin@intel.com> <5a18f5ac-4e9a-4baf-b720-98eac7b6792f@arm.com> From: Robin Murphy Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 30/05/2024 6:11 pm, Yury Norov wrote: > On Wed, May 29, 2024 at 04:12:25PM +0100, Robin Murphy wrote: >> Hi Alexander, >> >> On 27/03/2024 3:23 pm, Alexander Lobakin wrote: >>> Now that we have generic bitmap_read() and bitmap_write(), which are >>> inline and try to take care of non-bound-crossing and aligned cases >>> to keep them optimized, collapse bitmap_{get,set}_value8() into >>> simple wrappers around the former ones. >>> bloat-o-meter shows no difference in vmlinux and -2 bytes for >>> gpio-pca953x.ko, which says the optimization didn't suffer due to >>> that change. The converted helpers have the value width embedded >>> and always compile-time constant and that helps a lot. >> >> This change appears to have introduced a build failure for me on arm64 >> (with GCC 9.4.0 from Ubuntu 20.04.02) - reverting b44759705f7d makes >> these errors go away again: >> >> In file included from drivers/gpio/gpio-pca953x.c:12: >> drivers/gpio/gpio-pca953x.c: In function ‘pca953x_probe’: >> ./include/linux/bitmap.h:799:17: error: array subscript [1, 1024] is outside array bounds of ‘long unsigned int[1]’ [-Werror=array-bounds] >> 799 | map[index + 1] &= BITMAP_FIRST_WORD_MASK(start + nbits); >> | ^~ >> In file included from ./include/linux/atomic.h:5, >> from drivers/gpio/gpio-pca953x.c:11: >> drivers/gpio/gpio-pca953x.c:1015:17: note: while referencing ‘val’ >> 1015 | DECLARE_BITMAP(val, MAX_LINE); >> | ^~~ >> ./include/linux/types.h:11:16: note: in definition of macro ‘DECLARE_BITMAP’ >> 11 | unsigned long name[BITS_TO_LONGS(bits)] >> | ^~~~ >> In file included from drivers/gpio/gpio-pca953x.c:12: >> ./include/linux/bitmap.h:800:17: error: array subscript [1, 1024] is outside array bounds of ‘long unsigned int[1]’ [-Werror=array-bounds] >> 800 | map[index + 1] |= (value >> space); >> | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ >> In file included from ./include/linux/atomic.h:5, >> from drivers/gpio/gpio-pca953x.c:11: >> drivers/gpio/gpio-pca953x.c:1015:17: note: while referencing ‘val’ >> 1015 | DECLARE_BITMAP(val, MAX_LINE); >> | ^~~ >> ./include/linux/types.h:11:16: note: in definition of macro ‘DECLARE_BITMAP’ >> 11 | unsigned long name[BITS_TO_LONGS(bits)] >> | ^~~~ >> >> I've not dug further since I don't have any interest in the pca953x >> driver - it just happened to be enabled in my config, so for now I've >> turned it off. However I couldn't obviously see any other reports of >> this, so here it is. > > It's a compiler false-positive. The straightforward fix is to disable the warning > For gcc9+, and it's in Andrew Morton's tree alrady. but there's some discussion > ongoing on how it should be mitigated properlu: > > https://lore.kernel.org/all/0ab2702f-8245-4f02-beb7-dcc7d79d5416@app.fastmail.com/T/ Ah, great! Guess I really should have scrolled further down my lore search results - I assumed I was looking for any other reports of a recent regression in mainline, not ones from 6 months ago :) Cheers, Robin.