From nobody Thu Apr 16 05:20:42 2026 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 6758036C5A2; Mon, 2 Mar 2026 13:35:09 +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=1772458510; cv=none; b=F+HiRVOqT9nDt9ov/JWhmuvbwlWgdAuGXyux7Imm8J44vhqBDuaBSuZ2ktpJKcr2i4c0yxq3lCr0J8YMGwmUqGmajfqEozV9g/J+Agsj8D0bOuTj48NjayiiL2Rp5PLoanbMfSflA2iY9f/s/FW8TTZW2ibCfZDajKlcklBM7L4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772458510; c=relaxed/simple; bh=jeWt8/qWbAHXBZzMcvFsUQgA7HkulneeSnnjQRn0xVs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uS8urDswcaWlwX3UiN6ekS9bY9jTNHDwblerK1nhS4dNyjJafQPgKVoJTtDdoO3x5nGr0OOfM4irdGXN81bjSYdwfusYRNhviv0rMG+OrM4tHie4tjeoS9f210zy5T7TFQsAGNz5mJ4kqEHI1C0TZPFG+MTowiHXlMHY9UNLZQo= 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=lVYxrk2J; 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="lVYxrk2J" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 622C8YNs1479574; Mon, 2 Mar 2026 13:35:05 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=hQGiFMvGP92KVOth8 /151J7vjaoi0/ag7kKFFBJnHvA=; b=lVYxrk2JoFMqDx58KE5H/iaGy06rhJaMc 5MUtHV9MAbDbIkNHSbRL5j0HcCNKgIcCpKBMygYCeyQUTGhSxYaQqoXqjIi6rict yNd30DPO5SzOQe7YO5YvwNQ4/1KTD3HDpS92QiSJoQSpNT3kFItG1KpFRn7CTcn+ idjuk7PpeWHcIll8Ib4sxHIo46KBI3o/8qZ1XRaKY5nmu8V9plhVAJu77sjPixar tw7ZuxGO774ZNaErAEqGbyO+vdj+ugB2GB7kIWUDgYpC5TJh6lHAFlj5fdO4SFgA Pb8MzEG3cxy0O4Nu/RW7aLTIbAhkKpaTOEsv8l+Mm2nPET8wuB2SA== 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 4cksk3pmeg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Mar 2026 13:35:05 +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 622Cl2UI016756; Mon, 2 Mar 2026 13:35:04 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4cmbpmxahd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Mar 2026 13:35:04 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 622DZ0n643123032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 2 Mar 2026 13:35:00 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B63B220043; Mon, 2 Mar 2026 13:35:00 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B69E2004B; Mon, 2 Mar 2026 13:35:00 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 2 Mar 2026 13:35:00 +0000 (GMT) From: Heiko Carstens To: Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger , Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 1/3] s390/xor: Fix xor_xc_2() inline assembly constraints Date: Mon, 2 Mar 2026 14:34:58 +0100 Message-ID: <20260302133500.1560531-2-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260302133500.1560531-1-hca@linux.ibm.com> References: <20260302133500.1560531-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: NBD98cE0vI31DgngZOz9aKQfOSSaMgx4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzAyMDExMSBTYWx0ZWRfX+iG6z0ZPJWGG i761kHddp0ag/z+r73dfyB1px+atb0oILz7Lm0HzJO7uw5WalxnMieNAnnYoPZodY95xVZKaS5Z wMYalv7k+gF2qh6PU2+ne0I+UXu+Tyo/Xp1siURtNjOkXxF2bGl0iH0cq9UmkViVWPE1TaU3c5d cZFNXPeonXwjWv6RM8BF7Q2cWCpiktjfgSjKwEc+K5UiqOS1Kl48pCBAVCeQ1d2JG9ZcxETbF5R fJr12INw0GnTk1Xz9qI2xY5wE07py/o6K+gHzQsdnvxs5BIpmhMnraycGVgBAhPD7cKqdg9DTFF bwUvXQtRsPFaFaWiQpJ2ctEAgT4ews+/kEbkNFKSyHnyjYFe4x+USzelv/tIhpuSbw6j2dOSFvC 46/4ZUaQSKG/3pyW98PirNUPVkfcHUkZ9gE/4Ij0qatj9jMi5suB6NZEQp5q/rOMhXoM3iNzXii EC7YofmDHkTe1ixefHA== X-Authority-Analysis: v=2.4 cv=csCWUl4i c=1 sm=1 tr=0 ts=69a59209 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=aKZOg4wb7pFh2cTURR0A:9 X-Proofpoint-GUID: NBD98cE0vI31DgngZOz9aKQfOSSaMgx4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-02_03,2026-02-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 adultscore=0 clxscore=1015 bulkscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603020111 Content-Type: text/plain; charset="utf-8" The inline assembly constraints for xor_xc_2() are incorrect. "bytes", "p1", and "p2" are input operands, while all three of them are modified within the inline assembly. Given that the function consists only of this inline assembly it seems unlikely that this may cause any problems, however fix this in any case. Fixes: 2cfc5f9ce7f5 ("s390/xor: optimized xor routing using the XC instruct= ion") Cc: stable@vger.kernel.org Signed-off-by: Heiko Carstens Reviewed-by: Vasily Gorbik --- arch/s390/lib/xor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/lib/xor.c b/arch/s390/lib/xor.c index 1721b73b7803..d703c44d5fd6 100644 --- a/arch/s390/lib/xor.c +++ b/arch/s390/lib/xor.c @@ -28,8 +28,8 @@ static void xor_xc_2(unsigned long bytes, unsigned long *= __restrict p1, " j 3f\n" "2: xc 0(1,%1),0(%2)\n" "3:" - : : "d" (bytes), "a" (p1), "a" (p2) - : "0", "cc", "memory"); + : "+d" (bytes), "+a" (p1), "+a" (p2) + : : "0", "cc", "memory"); } =20 static void xor_xc_3(unsigned long bytes, unsigned long * __restrict p1, --=20 2.51.0 From nobody Thu Apr 16 05:20:42 2026 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 2D0F7317161; Mon, 2 Mar 2026 13:35:09 +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=1772458510; cv=none; b=LC85PAUVhrkY1BWkyp0sE8wii9r/0cquq8lRGsleb62/B7ZSKfD4eOhf9ToUnEj8FIFE6TqzoDyoJg12DzowWxlGhSiIiZ5F/GqBpd1dOLlGvE1z1c7dgTPxNspN/XHHPuFgADARPADtcFR9VLZzZPhKXE4p7qd1jtFw8s5uFqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772458510; c=relaxed/simple; bh=SOGIauOk88mrfn8yXklOZF3aznXRw4n6r4MTmW5K3DA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J5pNX7BUjlaEHAOL9YjakQGMsosYM2bLQls8YKT+RkKvEIxV1eVwa34jy1ylWYhlWC/ayLbLQjIwaCO9ORPKSHJ2hNcjp54ajJdo1G2oWD8EovrUvVXH3/wI72D++bNOqhIeYqQ5TtGu7OwdfsPIlXNgcNK3UgZxX6WImrEta4E= 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=LIljlwSB; 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="LIljlwSB" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 621NmYZR2167523; Mon, 2 Mar 2026 13:35:05 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=3v6c1/bfj0dpDL8gx Wv3j4PgfmzXN++VKv+INi0F+B8=; b=LIljlwSB1jyOHXNWskfFZazmQKXrPFp2p cfjdlI/NXvvQ5DHNVirH/73jc4e7cBo/IgblcKBy0I6BuTWvRGohLCyX27MOnIQr mJCZODMlUJ0h9DMCtEfGYWAifHBlZ5Gf6OJ0D2khNfJWT76cRRjg1YLAss4VNVVy DCdMlKi0Ax5tKOfjDWZ6WPmBV8VwkXRuW83EsWle819BF+v3aA8xqzg4sZsSJNGh LmjGLnkPvFniZN2rEVR+3vcYj4cP+hUMfW304RKyah1kKxNmmCWjGkTC/c25Z5SJ kX0GCdQZz/V3KUTuj1nTESIjE32zoN8+V4e9mbV26vKuTfqNdSpIA== 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 4ckskbpkfk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Mar 2026 13:35:05 +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 622Awd4Q008779; Mon, 2 Mar 2026 13:35:04 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4cmdd160q8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Mar 2026 13:35:04 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 622DZ04W41878004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 2 Mar 2026 13:35:01 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB83C20043; Mon, 2 Mar 2026 13:35:00 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAAFC2004D; Mon, 2 Mar 2026 13:35:00 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 2 Mar 2026 13:35:00 +0000 (GMT) From: Heiko Carstens To: Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger , Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 2/3] s390/xor: Improve inline assembly constraints Date: Mon, 2 Mar 2026 14:34:59 +0100 Message-ID: <20260302133500.1560531-3-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260302133500.1560531-1-hca@linux.ibm.com> References: <20260302133500.1560531-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: Upj0Fze_RZ6dYiwcviQJGrm3XaKe1N6I X-Authority-Analysis: v=2.4 cv=b66/I9Gx c=1 sm=1 tr=0 ts=69a59209 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=1N6LMg1rhyF-opLkvXMA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzAyMDExMSBTYWx0ZWRfXyrFClpTyK9Ha oQAuSnpkkEi/dWdvM74wJ15Q3qPQcqsdycJraOOwEUBCEydSPBYPkxrb6rOIgOmrqkIgXFjL/xc bl8oy8pyAcSL4nwBtSYxSuSIRzeP+VP7lgHleYPDv04E8f5HdEK0EWZrmppaw4tU20yDMvMrKw9 eRVJJmLJCMFCZb0dXeUgEpVgceJplYwghV3TF9RugSmKTG8Ob/xvxRB3x6SjPmBdog/wbF6ht4p 3U5hfhDbodZEujIOn79GKKAgj9ZbtVT1G1BA1j4tYzsZMtwl7eZk/Jq8ekNY4MUuVCoosTktuKD 01JPIQHlnfUhOyH1ZJTiaQLnXWw63e/MTQxw5Ax7E0MpvuM1UFEQVBcoaBie2DJji09EE+nmQhf kaDLnAJ5i5GZ8mTmn6J74e35wD0tLwBBxI0Y6umdb1qgWYEeq8Kq6FFTsEKMSYSwFt84QUA1o/3 oV6wFeoIV//w8KUuk5g== X-Proofpoint-GUID: Upj0Fze_RZ6dYiwcviQJGrm3XaKe1N6I X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-02_03,2026-02-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 adultscore=0 bulkscore=0 impostorscore=0 malwarescore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603020111 Content-Type: text/plain; charset="utf-8" The inline assembly constraint for the "bytes" operand is "d" for all xor() inline assemblies. "d" means that any register from 0 to 15 can be used. If the compiler would use register 0 then the exrl instruction would not or the value of "bytes" into the executed instruction - resulting in an incorrect result. However all the xor() inline assemblies make hard-coded use of register 0, and it is correctly listed in the clobber list, so that this cannot happen. Given that this is quite subtle use the better "a" constraint, which excludes register 0 from register allocation in any case. Signed-off-by: Heiko Carstens Reviewed-by: Vasily Gorbik --- arch/s390/lib/xor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/s390/lib/xor.c b/arch/s390/lib/xor.c index d703c44d5fd6..da134c7d89a6 100644 --- a/arch/s390/lib/xor.c +++ b/arch/s390/lib/xor.c @@ -28,7 +28,7 @@ static void xor_xc_2(unsigned long bytes, unsigned long *= __restrict p1, " j 3f\n" "2: xc 0(1,%1),0(%2)\n" "3:" - : "+d" (bytes), "+a" (p1), "+a" (p2) + : "+a" (bytes), "+a" (p1), "+a" (p2) : : "0", "cc", "memory"); } =20 @@ -54,7 +54,7 @@ static void xor_xc_3(unsigned long bytes, unsigned long *= __restrict p1, "2: xc 0(1,%1),0(%2)\n" "3: xc 0(1,%1),0(%3)\n" "4:" - : "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3) + : "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3) : : "0", "cc", "memory"); } =20 @@ -85,7 +85,7 @@ static void xor_xc_4(unsigned long bytes, unsigned long *= __restrict p1, "3: xc 0(1,%1),0(%3)\n" "4: xc 0(1,%1),0(%4)\n" "5:" - : "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4) + : "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4) : : "0", "cc", "memory"); } =20 @@ -122,7 +122,7 @@ static void xor_xc_5(unsigned long bytes, unsigned long= * __restrict p1, "4: xc 0(1,%1),0(%4)\n" "5: xc 0(1,%1),0(%5)\n" "6:" - : "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4), + : "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4), "+a" (p5) : : "0", "cc", "memory"); } --=20 2.51.0 From nobody Thu Apr 16 05:20:42 2026 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 69D57375ACB; Mon, 2 Mar 2026 13:36:09 +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=1772458570; cv=none; b=n1/7k1KIJUiSdZVI+ksvmT/AiTNnXCM5p7qqq+i6obbhXlcmLfME+87+JsOR/ZnRhqL1mx58k6oHr5XwcuV4u7TD/3DCk/sBbXnMJ130tzSgMsB0OPkPOzrgyTRz1vseBOFQ49heJDarXzjGsMHiO26zlQfbyDkVD7lCFV7p1Ew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772458570; c=relaxed/simple; bh=eWEsqa+Hqbl2BLfYt47lMIeJThxi1ZNA8Kr4PWBpVAo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JAIZf52yASCHY9wsWKLM0YDM5V2Q/exYIdqSOPa8oNf5U+MM/UY52SHHbRQGBRTFQAfHPA8SbhufAWgDIzREkyZTz6iPSAAlyyLqQS8sdfeIg2RMMZTencyKxPsMzXrjGVifgtoSzWRCPuHbj5PDUgl2mgCJe6dGRg5GdFmCKvg= 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=bP643gxw; 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="bP643gxw" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 622ApVSg1171368; Mon, 2 Mar 2026 13:35:06 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=+KtYzLWSMqWWMhL/E tsTIxA/huTGyFpsfcBG3GoiINk=; b=bP643gxw7GxXRf2q/dAWmjhCsDd88KoBy 7NErygqre/7nBgHYGyMyPzaegVyR9TTTTNCMUeigvWI1kaGuFn3xu5Oclm1o423/ xW/ZSK1nnPflRyiEDVSKROEIfmGQrhpp+YHP2o3OGFb9SbiDs9uuEEc6I0UNtPi+ G1f/+NJZBs290/Nh+zyfTIqrsIHrOPC7VDiP3K4kS5ZIUqtOk5KKW6SwRJO7y4Xd t9rq+rx7IaieCT2HB7l+1VooEk8RPvxloHOx8pK8BmvZUrX4Cgb7g+dh8x8YoPvE PBIU5I0irPTeVPlNFfX9j2EiCoyKzZwOnakcz7Suk8QfMsAueXQNw== 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 4cksk3pmek-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Mar 2026 13:35:05 +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 622CtBcP016409; Mon, 2 Mar 2026 13:35:05 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4cmbpmxahe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Mar 2026 13:35:05 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 622DZ1Bl25821568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 2 Mar 2026 13:35:01 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B7B620040; Mon, 2 Mar 2026 13:35:01 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DF9702004F; Mon, 2 Mar 2026 13:35:00 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 2 Mar 2026 13:35:00 +0000 (GMT) From: Heiko Carstens To: Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger , Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 3/3] s390/stackleak: Fix __stackleak_poison() inline assembly constraint Date: Mon, 2 Mar 2026 14:35:00 +0100 Message-ID: <20260302133500.1560531-4-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260302133500.1560531-1-hca@linux.ibm.com> References: <20260302133500.1560531-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: e0afCxtGkLlKBiVfpNhCd2jWnrF7dWf1 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzAyMDExMSBTYWx0ZWRfX0pkOu5X2yY/A Tj4EaK1N7qaMQeLGda8pShoWuZN7+F2M3Den3qP9dzifCwuv4i83dToIpGWLNrvQm3+wRP498JJ zNYlRUnmgUtArhb93xyY9gwTlL6CuqUZ7/fiL0GP72GR8uaxStqma+59YcA2J6LHIEY3UlHaYFI eMKo+Iqum1MTH1byVA/Ok6G6AKUwXP4/SEhAZVT41KUejP84U+Z8gB2EoyMDtftI5LtKzzRDU6A 1GFncDv7GtWfmM8mgn9zRX1X5tMdwiqNDJ/MVSanFf3Kfj1E9lKVScvfO9PBi+EVciTt3gV5DBV +S+YWax3vg+PHQqR8lJEuQvOZVzxckRjYuVm4a2lNKemrSaoN+iOm9Kl8RME903N17Sjj4nmZRQ G3G4J8WEAZeI8lO9zqvr+5gKqKQ4JCqE9EhYcQ3oWrfh79BuhEloM6cTzGxyd2Qaj/rrwDoh6xG TXXtCYFajvnrH2bXfJg== X-Authority-Analysis: v=2.4 cv=csCWUl4i c=1 sm=1 tr=0 ts=69a59209 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=dh6oAghXbX3gNeQxLKgA:9 X-Proofpoint-GUID: e0afCxtGkLlKBiVfpNhCd2jWnrF7dWf1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-02_03,2026-02-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 adultscore=0 clxscore=1015 bulkscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603020111 Content-Type: text/plain; charset="utf-8" The __stackleak_poison() inline assembly comes with a "count" operand where the "d" constraint is used. "count" is used with the exrl instruction and "d" means that the compiler may allocate any register from 0 to 15. If the compiler would allocate register 0 then the exrl instruction would not or the value of "count" into the executed instruction - resulting in a stackframe which is only partially poisoned. Use the correct "a" constraint, which excludes register 0 from register allocation. Fixes: 2a405f6bb3a5 ("s390/stackleak: provide fast __stackleak_poison() imp= lementation") Cc: stable@vger.kernel.org Signed-off-by: Heiko Carstens Reviewed-by: Vasily Gorbik --- arch/s390/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/proc= essor.h index cc187afa07b3..78195ee5e99f 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h @@ -159,7 +159,7 @@ static __always_inline void __stackleak_poison(unsigned= long erase_low, " j 4f\n" "3: mvc 8(1,%[addr]),0(%[addr])\n" "4:" - : [addr] "+&a" (erase_low), [count] "+&d" (count), [tmp] "=3D&a" (tmp) + : [addr] "+&a" (erase_low), [count] "+&a" (count), [tmp] "=3D&a" (tmp) : [poison] "d" (poison) : "memory", "cc" ); --=20 2.51.0