Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp48261lqb; Tue, 28 May 2024 08:30:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3QhM1rMXRLqApIrqo9LTNsW1ZC+Aqj16Ydq7QkfZJjMF2O1Y+hanzGrpPABVTaYFGRfk8TA5gQpdpoNQOPRapJJkr5Meski5qkG86SA== X-Google-Smtp-Source: AGHT+IGihz/Spem895kd9x3Nf3oH8pO7T/2vqwdw3WmdeSLUGdVF8OItD2abhXsvipyqQGM/cNak X-Received: by 2002:a17:903:8cc:b0:1f4:64d6:919d with SMTP id d9443c01a7336-1f464d69460mr115981305ad.66.1716910247398; Tue, 28 May 2024 08:30:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716910247; cv=pass; d=google.com; s=arc-20160816; b=Xw1UYNDzrOvqjej5q4k/u/Q5NiOAkrHI9bIqhKQoJ2yfNrekQTG/edLTjJcrRUY+Fc 3qhafGcjzjY2Lzc4SXOp1iV+cWYSSS7hRLFp7azpQdgRlgsdTh/MBv554JaJ3XvuiA2b nyv9VHsVJrcCkFf1AuN73XA2OT7m06eYnw1U47RZ3rVY/X+sm8xdIbRrafD6zAMBlsX2 4+SHAgqH8zY1/jBhdKhe+wGux206GAhPDaeRDo47vYDYfpTSp/YLt2umVs1hgLHoL9Bt ZumGtTrs1F9yHRQ5zFigZ5HYKLW7rFAvGbri6Q9uReevGw6J4x+o0lgTDzvOYpRx5Dte rifQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=ZL76YP1Fqm/erlLogzqdx2qkHztyB9mHLwRpngkHDC0=; fh=etkLbIhbz4YMMdxSy8sT7oJQM9HU1nA+ACVV5cRcZDA=; b=T9CemIWU3G8J0O2ozJwS6kkEqGpIwyec185loViB4BotT9piImTsirKkafttRhiV7X vHQ0igH6T/I8wKBnG0nHfaBY8QgrPysot2nHp2nEgEGevEMuss1SZz7IB8+UnN1vLkmN zb8h43LCUHukReoE3T6OE3eA4r5naiWhBNNqVGTzR9ML7+yl5H17mpX6EcuHR6H/vTUh npQKROH9VzPaL7ogliBiQX6IFWqO9siFDw5ejK04anO5jQ73HQeAnWa1vKlTjkxDjUAT 2Y43wsllqXC6A2y3SL+lKgSoMTj5ntMbAu52sqZk2lP0ouC2wGBFfgwihakRPw9qLOzL MSGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=q1vvbeAq; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=lvrcWN1N; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-192666-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192666-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c9e6803si81784335ad.566.2024.05.28.08.30.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 08:30:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192666-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=q1vvbeAq; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=lvrcWN1N; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-192666-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192666-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de 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 05D33280F68 for ; Tue, 28 May 2024 15:30:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D59617083A; Tue, 28 May 2024 15:30:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="q1vvbeAq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="lvrcWN1N" Received: from wfout6-smtp.messagingengine.com (wfout6-smtp.messagingengine.com [64.147.123.149]) (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 140971E867 for ; Tue, 28 May 2024 15:30:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716910239; cv=none; b=t0dG/HzkerpJd18bnaBh/b1K1/uggsqMTT8ZGizYrnrqZoWlW9yvp6XuqH6hT5h2xUGEs5foiKDLXQA2PyMrdEmLYUJPTRgNJ/woBR9ySMk8Nuab2m5OxuwjknyCpsH1USoaLUT7RG4xDpAyJF2U61lSLkNsQpShc2aXMSxZghk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716910239; c=relaxed/simple; bh=vNumeZh5q4NeM50VYxpxDIpureeBqrFisTwmf1VYd9E=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=qiE/C3tZwbozZDnl56uVc7EBuirNdWejwD0kF5pkeWRZb1nIn0h8cnq+Hgs3XuiaVnVv9ehJnuG6L+KSAISyDYuswfVQBzqrX1Wfb8E1S6KBHwB2oKU32+xt8YqUgvw4hdrGe9cyciMDkKB7PV6B4eqmP7JJ7/Hp4XLfcRkGFg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=q1vvbeAq; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=lvrcWN1N; arc=none smtp.client-ip=64.147.123.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id 98FCF1C00102; Tue, 28 May 2024 11:30:35 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Tue, 28 May 2024 11:30:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1716910235; x=1716996635; bh=ZL76YP1Fqm /erlLogzqdx2qkHztyB9mHLwRpngkHDC0=; b=q1vvbeAqeSTGv/Yrb9ltqjTins oTQlNCeqvY2Vxg2Vl9mcW8WvaP/WtK6Ey0PEqAgclozXw3eQUMdpxXUH5gdaKTni 0jQ6smLl8aupdW5K2lSfI0ZOXyEYHPFnj9u3POIShzDOsQHCqECeDY31vOQpcfdo 6zE2lOI+Uvb68pN3oyptZUeESihG8+HC2AmXKcM+mGhKwrpmbE8oIJchq2qNvX9Y KViVO/7W0Ht+jXLp93827KjYS/7gATnWy36tYgqAWlHWf+gOiewP/dPUwns2Wr7Q HWJdUyER3X9mUSze2bx7vX947K+GBFH4onn/BWxd+5p5Laxu7uEpuBxMN77A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1716910235; x=1716996635; bh=ZL76YP1Fqm/erlLogzqdx2qkHzty B9mHLwRpngkHDC0=; b=lvrcWN1Nb7PVePz/yF0C+au2qiOIwXeA3OMtNXkPnxio tEHRGkA85TkeDIdDD2D33SlthkSND+BtM7RG1ocqQi1degW4+j76uHrWOOBwk3F6 edI/GsOVcvbfcA4DmjK6CzPsFliX1S5HbBU92xGccRJdlw1wRP3d802WA/cl8kvq mrrwuwG2DtZmlcZJa5hK7FTf8e020PTmBKUIL5rA+AKiUZXkDHuh590wiZvQ0U0c 7heYKCEu86VUfkuCL7BKatq+nNKx6cC+V9zNTo6t2OgYd7FHvg2gc7VhU2RHeKrD qOEilUuplOtWUVSewZRndWe7Hc6+Vm/wdJdATOtZhA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejkedgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 850A3B60092; Tue, 28 May 2024 11:30:34 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-491-g033e30d24-fm-20240520.001-g033e30d2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: <20240528120844.3523915-1-arnd@kernel.org> References: <20240528120844.3523915-1-arnd@kernel.org> Date: Tue, 28 May 2024 17:30:13 +0200 From: "Arnd Bergmann" To: "Arnd Bergmann" , "Catalin Marinas" , "Will Deacon" , "Jason Gunthorpe" Cc: "Valentin Schneider" , "Mark Rutland" , "Baoquan He" , "Peter Zijlstra" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/io: add constant-argument check Content-Type: text/plain On Tue, May 28, 2024, at 14:08, Arnd Bergmann wrote: > diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h > index 4ff0ae3f6d66..44913f227060 100644 > --- a/arch/arm64/include/asm/io.h > +++ b/arch/arm64/include/asm/io.h > @@ -199,7 +199,8 @@ void __iowrite32_copy_full(void __iomem *to, const > void *from, size_t count); > static inline void __const_iowrite32_copy(void __iomem *to, const void > *from, > size_t count) > { > - if (count == 8 || count == 4 || count == 2 || count == 1) { > + if (__builtin_constant_p(count) && > + (count == 8 || count == 4 || count == 2 || count == 1)) { > __const_memcpy_toio_aligned32(to, from, count); > dgh(); > } else { I ran into the same issue on __const_iowrite64_copy() now, will send an updated patch. I also noticed that the __iowrite32_copy() and __iowrite64_copy() look redundant after my change, so I wonder if we should just remove those and rename __const_iowrite32_copy() and __const_iowrite64_copy() accordingly. Arnd