Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp205789lqb; Tue, 4 Jun 2024 09:01:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVB6r5jXgqzLVoQZIEEl68ulcD+6NsHQWff4/yZBfxljfyQ8j8tmvUqhtROXZdtab5Abs7znCCgyGAkQhTFgwj31iuEgqjT4Gxidkd22g== X-Google-Smtp-Source: AGHT+IGN2czXB+OGKdwhPiJPTHyJgR3iyhiNhc0en7jI16+u8vhaO5QQPJFUZ2fV6EJy5o3trKrs X-Received: by 2002:a05:6358:18e:b0:18f:81e1:e557 with SMTP id e5c5f4694b2df-19b48d4dcdcmr1666807255d.1.1717516906737; Tue, 04 Jun 2024 09:01:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717516906; cv=pass; d=google.com; s=arc-20160816; b=iUH4aVt/d9bKSF9NSNwKC6HaLZfXuaBiY34tqzdR9zwdYPsEYdCSviB4ISxTaf2JUc r2vEShGBnIeMj5URIMnD8hKm4pWY91VMisoKfJdQhr/nMebbpbFzXAoSCaU1rojtL4kA BE40gt+3uTFxctcgZ+SXer40pK2oquXGETDNYoiUP+8FOCB1Xq/mm0fNljhA6fhM4TzR Vl9r+6W2MyGQ2hAh/9Fmj1PNT0xnGhjVHjJYCZ+1GWDlWrcpUHgE8s7ZA+EoXjkaWSgo K2hamd7lY/BpCeOTuy0HmTtIt56HGITzS21mg92VQLV9oQJRPkzKRY8ZLbyOE7AOGMP0 +/xA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=pNsnOa++O+0eDE9vpgAMseVhUUO3vd8dYBFBV67Sl58=; fh=0RTuV1jNVjRxkkmxEv2PQ7Y6L6stP7tze7tYd0M58Qk=; b=D08w0a5nlI8iwM4RIY27W+se/wxFzc1SsVH1GndIbnZ7c+p6qxDzXuMhfhQ5gRoR4U jGo//l0arAHswPzUoiLBSqeTsiUTmfa4Bn3O6E25pxF4Wr3m4yirnU7LdSsSvPLQaxKi 13WCA5SwvXhBoYMQBo4pb2kHJh2pFLbE43rDvAzaZbH5YF57n53n55wieB49ZcgTFRRO NRzuxCYUEGvIbYIH9wNpLBVGa9cuxJwrPS0SWgROIGXj/iayUV0aRTLtbTP7UiDDG3yv ADfKltzjBZ5HHJ9xelJrdPmWFK6d7Z2VELhl5/JVoZb+MXOEXE2OGQIBlGS/UaMxf41L 0kyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KnSJePGC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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-6c8c6774353si5941507a12.189.2024.06.04.09.01.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 09:01:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201016-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KnSJePGC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 56332286F9C for ; Tue, 4 Jun 2024 15:56:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA20B145FF8; Tue, 4 Jun 2024 15:55:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KnSJePGC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D018D12B17A for ; Tue, 4 Jun 2024 15:55:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717516542; cv=none; b=u8P1IZSc7e24AnVvOL2WxbsxOWnQCkBzZSDwPpNWHxfj8BdL1ZHsG3Rhj8M1iKgyBccNcYxveAmXUDT/CSQJ0lpkn2KZrubWQ6m2JzAS0YCg44nAUG/ioC/Q5LP2wSJ8nTUtJs6mHd1sn4fgz8qIv31EMqOXO7e7dMu1cIUeQoY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717516542; c=relaxed/simple; bh=d9xupwVDLSm6tV2FshRNHXaiUYZUrqvz6XXtUmlyJn4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oF1oaNQkr07DXaKC17aaL9qLgcWOLFdNggwmlPFMLGtJao3ZhUCYDcUZ4zqIw6KwKbmpFY+tSslcFPNAL8yDl+mvOXmkPsUC2VPxq6HEgqf/s7oD1R6OMz+C3SZtpksGC7DjJCE1FegJbd8lxCFKbT4F+IbG6jLbPWJh6ZohjnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KnSJePGC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D6DEC2BBFC; Tue, 4 Jun 2024 15:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717516542; bh=d9xupwVDLSm6tV2FshRNHXaiUYZUrqvz6XXtUmlyJn4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KnSJePGCdkPtmadAOeftoHNsZRFheJvrrtSuAFR6wZ9VvWbK9e9E6fv42x8BEE8f6 xSwG2F5Lvla5s+EWlagUjwMJJlsungUVG50fA3+Kp8odzf3mRKvhtGj+2rglELWRfD BeOwuKPlEwiEfZ1EhBuTSQ34QEVvUIuzPTC+AODN5n1Io8Chh7Q+IbD0z+pREb2nvJ mz33KDJSBESl6nppAUQTQWk7kfIgif7X98FMWcswcjwmjs5FuWOHM3paBzk6We7Bb9 nJqzyGy8sSkv4Ik6cumR7uVV1RS9zTPg/t8B1J+7JHnHZ5h9ne8JW4CigUslM0D3Sd vDff2HgZ/j8rg== Date: Tue, 4 Jun 2024 16:55:37 +0100 From: Will Deacon To: Arnd Bergmann Cc: Catalin Marinas , Jason Gunthorpe , Arnd Bergmann , Baoquan He , Kefeng Wang , Peter Zijlstra , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v2] arm64/io: add constant-argument check Message-ID: <20240604155536.GA20674@willie-the-truck> References: <20240528153717.2439910-1-arnd@kernel.org> 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-Disposition: inline In-Reply-To: <20240528153717.2439910-1-arnd@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) On Tue, May 28, 2024 at 05:37:11PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > In some configurations __const_iowrite32_copy() does not get inlined > and gcc runs into the BUILD_BUG(): > > In file included from : > In function '__const_memcpy_toio_aligned32', > inlined from '__const_iowrite32_copy' at arch/arm64/include/asm/io.h:203:3, > inlined from '__const_iowrite32_copy' at arch/arm64/include/asm/io.h:199:20: > include/linux/compiler_types.h:487:45: error: call to '__compiletime_assert_538' declared with attribute error: BUILD_BUG failed > 487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^ > include/linux/compiler_types.h:468:25: note: in definition of macro '__compiletime_assert' > 468 | prefix ## suffix(); \ > | ^~~~~~ > include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert' > 487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > | ^~~~~~~~~~~~~~~~~~~ > include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' > 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > | ^~~~~~~~~~~~~~~~~~ > include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG' > 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") > | ^~~~~~~~~~~~~~~~ > arch/arm64/include/asm/io.h:193:17: note: in expansion of macro 'BUILD_BUG' > 193 | BUILD_BUG(); > | ^~~~~~~~~ > > Move the check for constant arguments into the inline function to ensure > it is still constant if the compiler decides against inlining it. > > Fixes: ead79118dae6 ("arm64/io: Provide a WC friendly __iowriteXX_copy()") > Signed-off-by: Arnd Bergmann > --- > v2: > - fix both 32-bit and 64-bit copies > - remove now-redundant macros > --- > arch/arm64/include/asm/io.h | 24 +++++++++--------------- > 1 file changed, 9 insertions(+), 15 deletions(-) I think this is superseded by Mark's diff in reply to v1, right? https://lore.kernel.org/r/ZlcODqVXTDh6n0h-@J2N7QTR9R3 If so, Mark, please can you post that as a proper patch so that we can get this fixed? Cheers, Will