From nobody Wed Sep 10 23:45:07 2025 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 6F8DC321F4C; Wed, 10 Sep 2025 15:12:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757517151; cv=none; b=mh7dL0Rr6j5iFvf0DNYXb1Ul2HY2ZkrAJ/SCiACxiQdSSs16oDTBwklwSL81vY8eCBWzwN/ldZJaaAWVkcm4hJIowA77X8eu0ibZ5S9X834T3TTrT/MDj5cOebXjTFOPen0Vqp9C8EngH/u2gaUkx7mQzfEC85p6LCntzdO1JqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757517151; c=relaxed/simple; bh=fJv13jBpoC8uKmCgvZhfybDn3QE4ZT0YE98S3y/4/v0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZUpN/86MmWBpnH3CeTmX4ddDiT7QhSeY0C3aKc10mkH0WKMrVvWlKtQmpBtle4PI6nyzCxpeKS4ECfitGmGHrjrr4nL9a9Pue0iLFvHtMzv82IP+LGcqwjX13J83p7SBEw/WsKOrk+jW3An2LUWE3LKqEB2aVc27Z8+yFP+gf2s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=hA+rmZaM; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="hA+rmZaM" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58ADIVL5012534; Wed, 10 Sep 2025 15:12:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=ykBuZzk8rSfXiOVKU UmpAYZmcQahu3m28c92splTc58=; b=hA+rmZaMLOlzHRazxMySiwtc4k1a3AE8o ATwsdk7IN0iZ183LftCRBkqttGlcIVHrR1wzEZhSGyROD6VaWfhlHGEjXANmRPLu FJ5SKEvezZQY6Twcx4DD5qH4E+SCC8ZShF7B2pdq88MMD0+3+br9zYY9+oFPPtMf /sUYiS3yfqdavPTg0SlzMzLtxQ6QbDYZvbuBtFZCLUwnlr5gv0aK8TzWKRX4Ipvz z4FvwuFa7nOeBrGsM7IbjY+6C+3BCIeNafsYkFucHpoVUkbZV1dl9rUdrSVsAHhB QPDLXYWFrmShrmwtNElkS0lED4DeUnn3QhOexDjLfUKzfKMnKdUsw== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 490cfff3ft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Sep 2025 15:12:21 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 58AF24ZL001163; Wed, 10 Sep 2025 15:12:20 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 491203gthe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Sep 2025 15:12:20 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 58AFCHE950528706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Sep 2025 15:12:17 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 35A2820040; Wed, 10 Sep 2025 15:12:17 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 112092004B; Wed, 10 Sep 2025 15:12:17 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 10 Sep 2025 15:12:17 +0000 (GMT) From: Heiko Carstens To: Nathan Chancellor , Miguel Ojeda , Vasily Gorbik , Alexander Gordeev , Juergen Christ Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Sven Schnelle , Christian Borntraeger Subject: [PATCH 1/3] Compiler Attributes: Add __assume macro Date: Wed, 10 Sep 2025 17:12:14 +0200 Message-ID: <20250910151216.646600-2-hca@linux.ibm.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250910151216.646600-1-hca@linux.ibm.com> References: <20250910151216.646600-1-hca@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: YIAUAYhLb2lyyG6XlyZXSycdmUv7NWLp X-Proofpoint-GUID: YIAUAYhLb2lyyG6XlyZXSycdmUv7NWLp X-Authority-Analysis: v=2.4 cv=EYDIQOmC c=1 sm=1 tr=0 ts=68c19555 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=yJojWOMRYYMA:10 a=mDV3o1hIAAAA:8 a=Twlkf-z8AAAA:8 a=VnNF1IyMAAAA:8 a=sjXywTY0MiY73472-yoA:9 a=ppDDjHLidN0A:10 a=yTjAz9eSMYQA:10 a=-74SuR6ZdpOK_LpdRCUo:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA2MDAyMCBTYWx0ZWRfX08iMdLWYzSuj FUV0tTVPegVAFqiWUXxrMbN97CcW3DT0gCd6c5XgmqpRue7dnU3xgAn0LylbH06/O3lh91JeQaG 0+OIf3uP+Ilp93rCi0k1t2qk375Ra8YzJuJLFdHwPV+oUD/DeDRfoVQXV2jILa0rfvrgt19G1Fp /BLtzhMORIMagMAFNFDmji6457+RvNxZ0H8VVWtY9OswFRsmGbf4vzBfMvMYg5dM9kVSl8X6fKI ncQcsIFOcMsa3HMMcwuPX2rCK7OUJjotJ/n9pqDMMwHBOFBkhs9+m1XJ9p+E7iRlpUyovPXqi52 /i+tQ2tcgGzGBrPpbDRQEafZ9llda91ul9lMo7o2++D/sM541/L3R4PH22GFB9H4MVa/CIbPjDF kbZgw819 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-10_02,2025-09-10_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 suspectscore=0 spamscore=0 impostorscore=0 priorityscore=1501 phishscore=0 clxscore=1015 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509060020 Content-Type: text/plain; charset="utf-8" Make the statement attribute "assume" with a new __assume macro available. This allows compilers to generate better code, however code which makes use of __assume must be written as if the compiler ignores the hint. Otherwise this may lead to subtle bugs if code is compiled with compilers which do not support the attribute. Signed-off-by: Heiko Carstens --- include/linux/compiler_attributes.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_a= ttributes.h index c16d4199bf92..16c3d4a865e2 100644 --- a/include/linux/compiler_attributes.h +++ b/include/linux/compiler_attributes.h @@ -54,6 +54,22 @@ */ #define __always_inline inline __attribute__((__always_inl= ine__)) =20 +/* + * Beware: Code which makes use of __assume must be written as if the comp= iler + * ignores the hint. Otherwise this may lead to subtle bugs if code is com= piled + * with compilers which do not support the attribute. + * + * Optional: only supported since GCC >=3D 13.1, clang >=3D 12.0 + * + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#ind= ex-assume-statement-attribute + * clang: https://clang.llvm.org/docs/AttributeReference.html#assume + */ +#if __has_attribute(assume) +# define __assume(expr) __attribute__((__assume__(expr))) +#else +# define __assume(expr) +#endif + /* * The second argument is optional (default 0), so we use a variadic macro * to make the shorthand. --=20 2.48.1 From nobody Wed Sep 10 23:45:07 2025 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 4019B2D948D; Wed, 10 Sep 2025 15:12:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757517146; cv=none; b=Gxr6bvEO9e13gfotNgvcK6QDNAOIub+gdyopWZfW4ZnuyNRw6X7btrUGLgFtA+MrO5/SVlFwb8WCIDYyqaXp5GJYWr1t+dm8rnof10FurZdsFCAx2OJeMujcdOL+kO+BCBoxGDDy2Lmv8JX9tAjvshCRfJEhCf6B0rT7H8V7HSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757517146; c=relaxed/simple; bh=kxir90F44KW2WQa+mndrKbn36XiiF9IhahTlDyP/GJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MmI3fIBeR3Hl3EXanRb1gFbN/JO9h3Dz2/3a11fD8M83qbaIf3oKLzK5yniXIPdDgTwuGMjdudB793AIct3ShMi4THq02GY9vcvXCD2uq4c2BaW5KqKTPe6CRYDSQL59p5L36PWVneyeZDs4znWgjIZP9o6NsMb+7ci4OHsLTkk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=n/D73eo1; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="n/D73eo1" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58AAHTwn021580; Wed, 10 Sep 2025 15:12:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=CQi6oVVC5XMtnrgfA 2tLpNm0t2lzm3Aj0aYsh0tBSVI=; b=n/D73eo1+RHv99T0hLLloJK48WObDQJCm cz00ejBKVHQUWnQsgVja2z2ZR5gGq3tUsUs+uJ6bb9JNwQA0l220CyG68Q8+uZx8 lVwR3I8ImVZGEsj8I+Cj2UcRkT6kL9jDDHzNxuPhW0KFDmAh2Zlz/rQXlp/bpGJ+ ZAqNVbC7SRhAWGwqGUAKNGUjDGHJEEy2QWDV1SwuAons3LRvuoQ2Q+PTT0E8aKoz upH+Px7ijZOGGtJWLBtUI/mxQZonVmnqR/3xp92IzklV4CjJGp7kVtev1kW14i7w BxNGVGGSpBXjYM4SvKBqeibDIzJd89AE0Zm1JW5bReae3jHptdvZw== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 490bcsxkad-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Sep 2025 15:12:22 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 58ADNFed007895; Wed, 10 Sep 2025 15:12:21 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 49109ps47u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Sep 2025 15:12:21 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 58AFCHcB50528708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Sep 2025 15:12:17 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E75820040; Wed, 10 Sep 2025 15:12:17 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A73920043; Wed, 10 Sep 2025 15:12:17 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 10 Sep 2025 15:12:17 +0000 (GMT) From: Heiko Carstens To: Nathan Chancellor , Miguel Ojeda , Vasily Gorbik , Alexander Gordeev , Juergen Christ Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Sven Schnelle , Christian Borntraeger Subject: [PATCH 2/3] s390/bitops: Limit return value range of __flogr() Date: Wed, 10 Sep 2025 17:12:15 +0200 Message-ID: <20250910151216.646600-3-hca@linux.ibm.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250910151216.646600-1-hca@linux.ibm.com> References: <20250910151216.646600-1-hca@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA2MDAxMCBTYWx0ZWRfX2jEc0WQkcs22 yjPhhZvHO3QKvD7YLnacAyfCYq1QYUHgvjUw28bJKSCPSlJbMmGxxSsKbewjCM8McX8KbgZzfza mFKpEzEkxb+Ebvc5RKJ0mZl6+geOoLpP8HPxjC0OMVMe3nFObGPVM7HyG70z0oaTBK5Kl036o4Q o9sSb+45ha7O673yYyp4KnrhYpqVDs4lL+xopYXetAaYD9knCbiJaAlJ0R74KQ7JTdOHuQ0lCDj vuV+bCyTHibfmijBAXROksxvXgYfBvZotwYhGi2l2q4Kn6frvjq+RLJMCl6g5rlrlA4Ep4qFIQr x/agAJxMIPYk53btKSC6NY5z0g0ZmuOm38wDjgenAP7lzvE2CAtQAnEfymWYPsDxINMPnK/QJ2B IDQhZCVh X-Authority-Analysis: v=2.4 cv=SKNCVPvH c=1 sm=1 tr=0 ts=68c19556 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=yJojWOMRYYMA:10 a=VwQbUJbxAAAA:8 a=QyXUC8HyAAAA:8 a=VnNF1IyMAAAA:8 a=jVWh3qmyqVVvmCHjMMEA:9 X-Proofpoint-GUID: kg3hIjSwwj5TS1qQVncmy_sNdagh5Ub1 X-Proofpoint-ORIG-GUID: kg3hIjSwwj5TS1qQVncmy_sNdagh5Ub1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-10_02,2025-09-10_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509060010 Content-Type: text/plain; charset="utf-8" With the recent ffs() and ffs64() optimization a logical and operation was removed, which allows the compiler to tell that the return value range of both functions. This may lead to compile warnings as reported by the kernel test robot. Instead of only adding the not needed mask again, also add an __assume() statement to tell newer compilers that they can assume a specific value range. This allows newer compilers to optimize the not-needed logical and operation away. Also change the return type of flogr() to unsigned long and add the const attribute to the function. With this the reported warning is away, and in addition the kernel image size is reduced by ~4kb. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202508211859.UoYsJbLN-lkp@int= el.com/ Fixes: de88e74889a3 ("s390/bitops: Slightly optimize ffs() and fls64()") Suggested-by: Juergen Christ Signed-off-by: Heiko Carstens --- arch/s390/include/asm/bitops.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index 9dfb687ba620..46b90b545986 100644 --- a/arch/s390/include/asm/bitops.h +++ b/arch/s390/include/asm/bitops.h @@ -130,11 +130,12 @@ static inline bool test_bit_inv(unsigned long nr, * where the most significant bit has bit number 0. * If no bit is set this function returns 64. */ -static __always_inline unsigned char __flogr(unsigned long word) +static __always_inline __attribute_const__ unsigned long __flogr(unsigned = long word) { - if (__builtin_constant_p(word)) { - unsigned long bit =3D 0; + unsigned long bit; =20 + if (__builtin_constant_p(word)) { + bit =3D 0; if (!word) return 64; if (!(word & 0xffffffff00000000UL)) { @@ -169,7 +170,9 @@ static __always_inline unsigned char __flogr(unsigned l= ong word) asm volatile( " flogr %[rp],%[rp]\n" : [rp] "+d" (rp.pair) : : "cc"); - return rp.even; + bit =3D rp.even; + __assume(bit <=3D 64); + return bit & 127; } } =20 --=20 2.48.1 From nobody Wed Sep 10 23:45:07 2025 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 7C536242D90; Wed, 10 Sep 2025 15:12:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757517147; cv=none; b=RHxuAKE83bKBEq6SJaxBJ5gGsw4RKq9SLFpA34zot2njQfJUwjgJ/q52Mcu3sCbFvu65oyIxk6ywkmfrQJmd6hY2twotpfAoS5lUPwiSJqA50JSuvjGvAlDIVCkFaC/quxAtRPNnLqHzI34MvL68MYlNq91ni2WN0ngoyfSRZRQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757517147; c=relaxed/simple; bh=Q2vC/XxEz8gl3mUeOl64e9la6IneBU/EUVHVpUwwGas=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jrXyClHR7MXFiNysBE6o5Oa9tkETqqmyvMxJM5SVahI7qm/Vw92B5+xtnFJIzBom1cUsfmEPI7q3cOBYaHJ513/7DqQubwgtvko06qKemDu158fc80IC7x2RtZOw085Uaaf+b9qVh9LRBN9GIoKbnpbZQdlcV3TucEvXu/xVrw4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=qgEm5576; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="qgEm5576" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58AF3YvE026614; Wed, 10 Sep 2025 15:12:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=iH5mjKTkEFLysNY0H Q/J7yJZHmeqEfvtSHSbtVxBK+0=; b=qgEm5576KXLToJobhvm5Pqhqnj49qFHNU mczui3vXvgZ/fN8D204tyCfX+hxIncD8quLHMlBt2cnxOFdlRHBzABGRsRZMKOAa yPidblVVB9JIwUnYsFOukagUD3m58GYPrqvBOJXehNkgK8+noJglsrnGa/ROrkP/ utaVuBlxhK9weI5QGrMDyKt6mOLfjJEoljE1rzDfR+sBZBYN0DseL92ZO8cbsSuu lPywbBn+O6f6AxMvImOnXSiVxV6VIzJw2nF47JG86exjfl9g11edEwzDb2hhvX2t G2mM/ixzZnVlkpfc4OPC7AwVXIQF/67JTo8uDXVqXhPv+94wjHBxA== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 490bcsxkac-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Sep 2025 15:12:22 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 58AEW3Gs017163; Wed, 10 Sep 2025 15:12:21 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4911gmgwbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Sep 2025 15:12:21 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 58AFCHSe50528710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Sep 2025 15:12:17 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 90BD120040; Wed, 10 Sep 2025 15:12:17 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 632892004B; Wed, 10 Sep 2025 15:12:17 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 10 Sep 2025 15:12:17 +0000 (GMT) From: Heiko Carstens To: Nathan Chancellor , Miguel Ojeda , Vasily Gorbik , Alexander Gordeev , Juergen Christ Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Sven Schnelle , Christian Borntraeger Subject: [PATCH 3/3] s390/bitops: Remove volatile qualifier from flogr() inline assembly Date: Wed, 10 Sep 2025 17:12:16 +0200 Message-ID: <20250910151216.646600-4-hca@linux.ibm.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250910151216.646600-1-hca@linux.ibm.com> References: <20250910151216.646600-1-hca@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTA2MDAxMCBTYWx0ZWRfX3pimfG3eK9lw 1OSU5LyWTJ3iYt5ZwDuCgu79K7McnZfAwv+o3/T6i9bcMjEAidq2RHqS85iqZhA6tUDSHGyDFcH dxNXPKzxdSo6VL5FbJlpcstBTk1RDsrfFTvbF5kefaumru43r229PbEhoYpjMIEtHtCEcRPuyz0 Qc+xyH3Fn5VzUQS/tQCD1804fv+0388A/87MfytlFdxlWWu07H3U9XvAPxK6p409qWNtGo07Mrl 5dWGVPcJlPtMPwZoQXovb44aGF7NA8LeKhU/SglIjzD6QKDY/EdyuIlNPV2z2fa5fEkLqPFdzd1 +fMMqmtOEL8QWe2j9rR08GoMYZ9kVpq+YBq7RkN49nBOzzJ9qWuVfILq/4AklRl/1mnbHbewwVO /CFnech6 X-Authority-Analysis: v=2.4 cv=SKNCVPvH c=1 sm=1 tr=0 ts=68c19556 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=yJojWOMRYYMA:10 a=VnNF1IyMAAAA:8 a=zaVKdjsgvaB1YBu5WxcA:9 X-Proofpoint-GUID: HQFA2pUHk5i-rNzxrknpqD8_CJKuoJ8c X-Proofpoint-ORIG-GUID: HQFA2pUHk5i-rNzxrknpqD8_CJKuoJ8c X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-10_02,2025-09-10_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509060010 Content-Type: text/plain; charset="utf-8" The flogr() inline assembly has no side effects and generates the same output if the input does not change. Therefore remove the volatile qualifier to allow the compiler to optimize the inline assembly away, if possible. This also removes the superfluous '\n' which makes the inline assembly appear larger than it is according to compiler heuristics (number of lines). Suggested-by: Juergen Christ Signed-off-by: Heiko Carstens --- arch/s390/include/asm/bitops.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index 46b90b545986..5e04836c9c8d 100644 --- a/arch/s390/include/asm/bitops.h +++ b/arch/s390/include/asm/bitops.h @@ -167,9 +167,8 @@ static __always_inline __attribute_const__ unsigned lon= g __flogr(unsigned long w union register_pair rp __uninitialized; =20 rp.even =3D word; - asm volatile( - " flogr %[rp],%[rp]\n" - : [rp] "+d" (rp.pair) : : "cc"); + asm("flogr %[rp],%[rp]" + : [rp] "+d" (rp.pair) : : "cc"); bit =3D rp.even; __assume(bit <=3D 64); return bit & 127; --=20 2.48.1