From nobody Wed May 13 11:31:01 2026 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 7F7E638E8A9; Tue, 12 May 2026 11:00:17 +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=1778583619; cv=none; b=hIcPBUBDLSXxt8+81L5thkRywjcOsqon6IxpySVgJ/hk4pDbVSUJCC9sEWyF1oZunweoVTLwQyr8lY06mUTf5MoZUuFugIXG87Sb7vF+3tjerq+Cc+qsV4QVOEqWz3/SZ244huherNNyiHkmCsjm6fwpJV9jjA5maSsZmEXd4v0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778583619; c=relaxed/simple; bh=U6/LcTiqruqor+FDjFsQzDGbTMZxpL+RX21QAg/TWWE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N/F3Hx6RBfeLPqbp6d0XxaOlgb5e6Hw8hxmgIFpP1FeIkQHcOaA4CxGh9C6FuPFaaUdUnF7nPP7fOyrHMnpZXmG2UKNHjQClS3EZZem50pAB4e+ZYU9PzHDXxLXQ6rDZv/J2dYc4PovCZr135N7w+OVTTR1TUWbOas7IobTzCuk= 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=mM43fB8r; 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="mM43fB8r" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64C1doub3868883; Tue, 12 May 2026 10:59:38 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=9QN4xzwD0rdAXfP9K EGOymcaOuZFhUrdoTCs7CLW064=; b=mM43fB8rFi/+qe37nI0fHe7k96hKzqByz /vqbWTkbRnHGO2N9nTHqEQ943FKo1o7HUNEPhdRPBAJtLqtRq0ewNZ8GW6XjEwN9 ApVjIbiCWk8Lj64phC7eapeBs5j+hbR9sjFc3DEFd3L1CXOrFifYYAnTJZCSl5eq ViQPzvXWVic9C5bxs2rkvrrCnGhi/OwkQFXWnXc7mscbX72lo4jsLA7nrqh/QfV0 mhS++ney571wMhsJarYPDmH9XUXSSIenmTHWdY24/NVfeEVlOCVuba4LTmpw+HtY xh+SNWgL/hLVqbMu41OVCFfj/KdMffhIqCAa9kYdcKc6hntg/ayIw== 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 4e3nv5ap4t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 May 2026 10:59:37 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64CAdZnq021833; Tue, 12 May 2026 10:59:36 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4e3nfgassk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 May 2026 10:59:36 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64CAxWZi40829286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 May 2026 10:59:32 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C197920043; Tue, 12 May 2026 10:59:32 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6FD4D2004B; Tue, 12 May 2026 10:59:32 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 12 May 2026 10:59:32 +0000 (GMT) From: Jan Polensky To: hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, ojeda@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, aliceryhl@google.com Cc: borntraeger@linux.ibm.com, svens@linux.ibm.com, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org, rostedt@goodmis.org, ardb@kernel.org, linux-s390@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] s390/bug: Provide ARCH_WARN_ASM for Rust WARN/BUG support Date: Tue, 12 May 2026 12:59:17 +0200 Message-ID: <20260512105920.2426293-2-japo@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260512105920.2426293-1-japo@linux.ibm.com> References: <20260512105920.2426293-1-japo@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-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=cPHQdFeN c=1 sm=1 tr=0 ts=6a030819 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=F81QZrn2fL8uw8yBg3oA:9 X-Proofpoint-ORIG-GUID: ClCL0DXOOzJuKIGWUxhG3T9zNgCWcUBS X-Proofpoint-GUID: OzDshFBJiaKr-kYi7QD8co5-LoJH9Bq5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTEyMDEwOSBTYWx0ZWRfX3SCVmdsc82Ow 3/ZZf+0YfxNzuMRNus8iGEQ/IvTlI905XYaJAJGhWWInI6KjXi4t4PYAus5NoFA0UoG4nJIM3Zb VuiTomc7FeL2sgxavbB/BjQpJt2i45lk0cYWyI0EgqzRsjhLTSVqCXrdemoBGcp8tPDHjXWMU+H a+WMBrDXdXHSXqUOmhKzWeBALycJLlVCS/m5q4cLw3Jkt6UwS03ml0G1tY7xSFxu6qZpv7/dv6Q +IJNf6b+ptS1ph9yFE4xPvbTAJNpOMmr1PAcRCkILtrWb7cL7kZXaXU2T7tq61Jr/2nZ2SCpnZt isTxPT+AojWnNj6DNfetXyFWQaLZT1d14yQpmh46JA4iHjFXkgoX53IjqfKI+UWhLq9jmS6zJnT ismhL1F6PE07XAe+BkudRNFcbaN5hdktpC/Gdsgihz0CSw5gUT+atpTM44jUAeJXuqPJC3eulgD hpeyzxtM6gKJCH2erJg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-11_05,2026-05-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 phishscore=0 clxscore=1011 spamscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605050000 definitions=main-2605120109 Content-Type: text/plain; charset="utf-8" Rust WARN and BUG support relies on ARCH_WARN_ASM to emit __bug_table entries. On s390 the macro is missing, so Rust code cannot generate proper WARN/BUG metadata for the kernel's bug reporting infrastructure. Define ARCH_WARN_ASM to produce the same assembly sequence and __bug_table entry format as the existing s390 BUG handling, including the monitor call. Define ARCH_WARN_REACHABLE as empty since s390 does not provide reachability analysis for warning paths. Signed-off-by: Jan Polensky --- arch/s390/include/asm/bug.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h index 59017fd3d935..baaf5d571785 100644 --- a/arch/s390/include/asm/bug.h +++ b/arch/s390/include/asm/bug.h @@ -4,6 +4,7 @@ =20 #include #include +#include =20 #define MONCODE_BUG _AC(0, U) #define MONCODE_BUG_ARG _AC(1, U) @@ -121,6 +122,17 @@ do { \ #define HAVE_ARCH_BUG_FORMAT #define HAVE_ARCH_BUG_FORMAT_ARGS =20 +#define ARCH_WARN_ASM(file, line, flags, size) \ + ".section .rodata.str,\"aMS\",@progbits,1\n" \ + "9:\n" \ + ".asciz \"\"\n" /* Empty string for compatibility */ \ + ".previous\n" \ + "0:\n" \ + __stringify(mc MONCODE_BUG(%r0),0) "\n" \ + __BUG_ENTRY("9b", file, line, flags, size) + +#define ARCH_WARN_REACHABLE + #endif /* CONFIG_BUG && CONFIG_CC_HAS_ASM_IMMEDIATE_STRINGS */ #endif /* __ASSEMBLER__ */ =20 --=20 2.51.0 From nobody Wed May 13 11:31:01 2026 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 7F6DE38E8A8; Tue, 12 May 2026 11:00:17 +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=1778583620; cv=none; b=XuEh3QjHX/KH0klkUE1GJ298IBkU6tbEAD3ZrSawtBwdK9edIiqCZEyOqlc3UxEkA2bDX6DbDM62ai9p+LCvcCwt2RyUsrJov1UqwHMsEwnEFRfqcCDLQrQDQkW9f3941v0q4zRElcjeYYPijX3y/sh5rm/qhTy04AcOIjNjEE4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778583620; c=relaxed/simple; bh=2ThIm2CMDh0Mcy38o6Gxo+M5zVXsX2ypo/FlQXj6y1w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OjdCcNymPbITWNdw8yhSmiUuVxLJLAcY/sBrTyAhR1AuVgfhCDsZduUdeHEqE5SSPzlFH3XjCOYD+YN/4NXuzJwwyv78gynVxIKXoUxOrrjF2xyEd08q+IuPz4r0/JSVa5c7QhvSR0g8ucW+KtS18q5HkVjknsHspKg6qA4SDVU= 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=U3YfFLfW; 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="U3YfFLfW" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64BK6nuv2606743; Tue, 12 May 2026 10:59:39 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=J9Xe4sJWq+su7oQiB MYR/VMHh9Q3ISWdU+TMfiuypxE=; b=U3YfFLfWqNi2pHn2MIfpxkQenVPeq0SV8 tG53AXra8QFsgpTuLA/olSWgkJoD4yyS6owYIHt6sYIJ2k7vSsI/Q4RcLP/Jb4Y/ o042a8dYnVZjODizp5v7bRKgG0peX15g4Ej3HgyAjoJmHZPj+Y1/AN1aQdoIFOU2 mWwyRlbM0BSOW52Hww/2LOnDM/Trh9nZtnyojdRxsa+Mxq7lyXfK42+YpP8ZQrGi XWXEbek3VYEHsoxSrD7pIcBt2feON1nTn1dQfhRE53zWJL9li2WnIyspZPY/2JnM dk9rU2cgj7aKwfD9qn5zqytxtrVDj/RnRpkmKRXtEV7NsONQ5Hd1A== 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 4e3nv52nxc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 May 2026 10:59:38 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64CAdTi4007015; Tue, 12 May 2026 10:59:37 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4e3nfgjtch-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 May 2026 10:59:36 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64CAxXpG14942486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 May 2026 10:59:33 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24DDE2004E; Tue, 12 May 2026 10:59:33 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C7C362004D; Tue, 12 May 2026 10:59:32 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 12 May 2026 10:59:32 +0000 (GMT) From: Jan Polensky To: hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, ojeda@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, aliceryhl@google.com Cc: borntraeger@linux.ibm.com, svens@linux.ibm.com, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org, rostedt@goodmis.org, ardb@kernel.org, linux-s390@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] s390/jump_label: Implement ARCH_STATIC_BRANCH_JUMP_ASM and ARCH_STATIC_BRANCH_ASM macros Date: Tue, 12 May 2026 12:59:18 +0200 Message-ID: <20260512105920.2426293-3-japo@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260512105920.2426293-1-japo@linux.ibm.com> References: <20260512105920.2426293-1-japo@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-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTEyMDEwOSBTYWx0ZWRfX5VGOT+5AQOSJ r/JZuDJEtjEUL7gVxfdBj3pVPjvqrQnFsE87nnsYQBYcCFZrxV30uZZDLlMS8cll6lcAYqTa73t gtlvdH54/1EzVJwQG9YfnmcMm3wsFxeOqw2l35xYRS5thi/SKfPokWHXIxRpkD1GsZzJyPqsCxV KKViQGyR1xXW39smTYVNnXrtPsikEYBOqeOSPB6h3UVPq08jAx2t2/IAikhxZJDUXSRlWI49JoU OkW+MW86cK7auCbZR/m6hGQqYRxyDdYYUVv9Q4LbllYxO/W7jry6M/iCvDhiW8ygNzIXY6RmskS Dmq2srVzC/jF3OEfGz+U4mN4ZsMA036Nj8oqKvBv+rdM7JHPCFqRoZhQUXHkA6Jx/gQHqm3aUJw 69P/4Mh/k8w4OZSQ6HpSBg32Fya2seo6iKS6N2gx/mz2g9jQj/x4aWYYthfPLH4pISp23Ug8zE5 UaDQUfPeBEjD4DxnEEw== X-Proofpoint-ORIG-GUID: 6PnBxjdJk1ULrfNypeM2w_JOA-zW5YEu X-Authority-Analysis: v=2.4 cv=Jc6Ma0KV c=1 sm=1 tr=0 ts=6a03081a cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VnNF1IyMAAAA:8 a=V3UG4Yqg79Bxd1UTefQA:9 X-Proofpoint-GUID: xIXG0wP7jiv_mrMKjiup93jc8FKiVNYV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-11_05,2026-05-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 clxscore=1015 phishscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605050000 definitions=main-2605120109 Content-Type: text/plain; charset="utf-8" Rust static branch support needs the s390 jump label instruction sequence and __jump_table emission in a reusable form. The current implementation embeds the sequence directly in the C asm goto blocks, which cannot be shared with Rust. Introduce ARCH_STATIC_BRANCH_ASM and ARCH_STATIC_BRANCH_JUMP_ASM to describe the brcl sequences for the likely-false and likely-true cases and to emit the same __jump_table entries as before. Switch the existing C helpers to use the new macros to avoid duplication without changing the generated code. Signed-off-by: Jan Polensky --- arch/s390/include/asm/jump_label.h | 33 +++++++++++++++++------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jum= p_label.h index d9cbc18f6b2e..1f0114150786 100644 --- a/arch/s390/include/asm/jump_label.h +++ b/arch/s390/include/asm/jump_label.h @@ -23,15 +23,25 @@ * We use a brcl 0, instruction for jump labels so it * can be easily distinguished from a hotpatch generated instruction. */ +#define ARCH_JUMP_TABLE_ENTRY(key, label, local_label) \ + ".pushsection __jump_table,\"aw\"\n" \ + ".balign 8\n" \ + ".long " local_label "-.," label "-.\n" \ + ".quad " key "-.\n" \ + ".popsection\n" + +#define ARCH_STATIC_BRANCH_ASM(key, label) \ + "0: brcl 0," label "\n" \ + ARCH_JUMP_TABLE_ENTRY(key, label, "0b") + +#define ARCH_STATIC_BRANCH_JUMP_ASM(key, label) \ + "0: brcl 15," label "\n" \ + ARCH_JUMP_TABLE_ENTRY(key, label, "0b") + static __always_inline bool arch_static_branch(struct static_key *key, boo= l branch) { - asm goto("0: brcl 0,%l[label]\n" - ".pushsection __jump_table,\"aw\"\n" - ".balign 8\n" - ".long 0b-.,%l[label]-.\n" - ".quad %0+%1-.\n" - ".popsection\n" - : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label); + asm goto(ARCH_STATIC_BRANCH_ASM("%0+%1", "%l[label]") + : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label); return false; label: return true; @@ -39,13 +49,8 @@ static __always_inline bool arch_static_branch(struct st= atic_key *key, bool bran =20 static __always_inline bool arch_static_branch_jump(struct static_key *key= , bool branch) { - asm goto("0: brcl 15,%l[label]\n" - ".pushsection __jump_table,\"aw\"\n" - ".balign 8\n" - ".long 0b-.,%l[label]-.\n" - ".quad %0+%1-.\n" - ".popsection\n" - : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label); + asm goto(ARCH_STATIC_BRANCH_JUMP_ASM("%0+%1", "%l[label]") + : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label); return false; label: return true; --=20 2.51.0 From nobody Wed May 13 11:31:01 2026 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 9CC1738E8B1; Tue, 12 May 2026 11:00:17 +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=1778583620; cv=none; b=NwhNAXfS4QcOyo0OsKS3VNY0nGFTNU2+KA4mivh/v6xz83RMaiKlQNA02cP+nE2RPe5CO6dHC7v9sfpIIQElb8LIzHvqkjhnfmHZLGZUCjf9mA6yzzawvojcnRSYLPYNhKLzCvFOwNaXuliyOrTpcoBSCWQm+btRqXP1X/iB1+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778583620; c=relaxed/simple; bh=Re8+bd2wq8+ZexfcrJuSaZHFiBHz1OF4GU4RxncQ+dw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nm2k0IKw9QKgAMebzYze6zXwWD2ae/7xVvpVnXlwLxQUuvgoQnlwGO1X7HcJHeLUCN+DoOahTWvljFOdmFGvisvq9G1uxHr2zCXhSoXn/MESNBdX4It0SwusdBBspWBy2462tSuIFzxPTCj8wTgonpMfrqSXNVU9P5kUIxx/uK8= 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=KOINCfbB; 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="KOINCfbB" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64BK7Z5X2611836; Tue, 12 May 2026 10:59:39 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=h0yk3VYeg6jg7PMBb qESJV6xdZRUSbooCkYHv7lCfbc=; b=KOINCfbBWyJLbN2xazfSOtSKkT2hO9fmw /khx5pM/pnFtQ1VmrMKl5N2ToZBLGmLMqYaAP/9SPp9/bG95wc+Ww/DpGKjoxhwA lWXpPh+HYr/0vbJV0zIjzw/mm2PrHEsQuIZDwoslMf/4g4SHDW286KHVanSZZIzB XA5/3tJdM3uQNavKkEjAAnzMQGG010SaHW2vI7ZOxWeXbXAzMxUTb9NiSzr6RtLi 3gVrel/2qG3+2QzW0vKjWOByDS+p5WlvVaa9hSkUdr7T+DK24vF40E8SiBlpwMkJ Ipd5ogAm61IbYCSfkGefX1bjMJkWyubAn4JAkungvJYixnhkb1PdA== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4e3nvdtp3h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 May 2026 10:59:38 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64CAsKnS021920; Tue, 12 May 2026 10:59:37 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4e3nfgat70-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 May 2026 10:59:37 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64CAxXZ714942488 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 May 2026 10:59:33 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8504520043; Tue, 12 May 2026 10:59:33 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29C722004F; Tue, 12 May 2026 10:59:33 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 12 May 2026 10:59:33 +0000 (GMT) From: Jan Polensky To: hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, ojeda@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, aliceryhl@google.com Cc: borntraeger@linux.ibm.com, svens@linux.ibm.com, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org, rostedt@goodmis.org, ardb@kernel.org, linux-s390@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] rust/bindgen_parameters: Mark s390 types as opaque to prevent repr conflicts Date: Tue, 12 May 2026 12:59:19 +0200 Message-ID: <20260512105920.2426293-4-japo@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260512105920.2426293-1-japo@linux.ibm.com> References: <20260512105920.2426293-1-japo@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-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=Y/XIdBeN c=1 sm=1 tr=0 ts=6a03081a cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VwQbUJbxAAAA:8 a=QyXUC8HyAAAA:8 a=VnNF1IyMAAAA:8 a=Ulcv6RcHQRQKaI22KjAA:9 X-Proofpoint-GUID: cQvzuh0RaOFnRv8kiQ_h-HjqcEM7g4zz X-Proofpoint-ORIG-GUID: u77MItQkDtBSHXEejGEAMwyaRXk1qvLj X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTEyMDEwOSBTYWx0ZWRfX65uWPGxstxEq mm9oUlhTX7mpzUfYMOnUqfnNDD7RYtfDfW9+wIvfKcul9dSEmFeV4Sby8Kr/6rUrJQeWtPf6X5b ifvlfzFYnZrE7K4RlGcKJV71HjHZg9Bq7LjkohtuZl2G1BeIrlkOtFi0t+ytPHNvjHDFErVJrAL vcmdBJPbm5FdGsEwDnfrY9Q4odfPqtFXh4r4xXqhvhnfkrtXk7bgAzO+dQKpIsOcVQb38DsWZwo BfXbDuwzXDswNPH7il7pASIWOqJNrSVN90T4VqZ5ne7RngG6nlwqUgcZDpb7mDBpl7QipBJGqKM /+WFXkGWJSnel1SqPd8zm2MBOM+fUm7B+jHSK+tW7tEnAFHbZepD91csvlB5ikOoxRn0BtIStkF 4TB9yVIha4rj2+6/LC7Dz40ho6u0CvtLaBokYYVjk8n0LOZSt+/oWmTEKx6vWI7oFQdHpdErLFz AQ94WapzXQmX1KdV5fg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-11_05,2026-05-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 phishscore=0 malwarescore=0 suspectscore=0 bulkscore=0 spamscore=0 adultscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605050000 definitions=main-2605120109 Content-Type: text/plain; charset="utf-8" Bindgen attempts to generate Rust layouts for a number of s390 structs that are packed but contain, or transitively contain, aligned fields. Rust rejects such layouts with E0588 ("packed type cannot transitively contain a #[repr(align)] type"). Add the affected s390 types to the opaque type list so bindgen emits opaque blob types instead of full representations. This matches existing workarounds for x86 types such as alt_instr and x86_msi_data. References: https://lore.kernel.org/all/e5c7aa10-590d-0d20-dd3b-385bee2377e= 7@intel.com/ Signed-off-by: Jan Polensky Reviewed-by: Gary Guo --- rust/bindgen_parameters | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rust/bindgen_parameters b/rust/bindgen_parameters index 6f02d9720ad2..8402b0c93545 100644 --- a/rust/bindgen_parameters +++ b/rust/bindgen_parameters @@ -14,6 +14,13 @@ --opaque-type alt_instr --opaque-type x86_msi_data --opaque-type x86_msi_addr_lo +# s390-only: same packed/align issue as above (E0588). +--opaque-type lowcore +--opaque-type tod_clock +--opaque-type tpi_info +--opaque-type uv_cb.* +--opaque-type uv_secret.* +--opaque-type zpci_fib =20 # If SMP is disabled, `arch_spinlock_t` is defined as a ZST which triggers= a Rust # warning. We don't need to peek into it anyway. --=20 2.51.0 From nobody Wed May 13 11:31:01 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 23F153839A9; Tue, 12 May 2026 11:00: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=1778583626; cv=none; b=qdH2G0EZRvcW3Fbf5dCnbfYsMSHvFhhns+nNIskwZEJS7hq0VfxYUi793chSCpYiFsAvNwMtRMGYx7yUliB0Cb0o9WP7ttDH/N7yYqe6YfAEDRHGvlnHCw2K8R/0dMhn0iE7a6207j53iD9bX4OF2nJ0fnwHZvP6AFpWeKUVKqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778583626; c=relaxed/simple; bh=q2R+EVNo1o9PgkGYpslbUjkN2z64oCvqM+PH3e97aBc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UZR6cAF6PQvY/Qs0VR8A8yEItLMl0tBd9nd7UE/qSdlu805etHVLZflsc/989yvJ0pMhgkPoJqTCTRA1n/LX+66rqT3Yb6eb8BDb4RHQPy814wwHb7qrYoZw5ybNcbnBGlnBl3GASDDI7T00JZ9YzsqljsVnrerkGMi594qPdmc= 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=OeHSfNZz; 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="OeHSfNZz" 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 64BK7PvM3180075; Tue, 12 May 2026 10:59:39 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=k0wTovysRtG6sqD3D xP+NT+DiL9VptC1pj45zPv0kww=; b=OeHSfNZz44h6NlwkS7d39u6aEkmujteYg b8ZbI21SEoNCbQKnsBX8rUWn5xLBjBbNfgZmOmQv9HypDPGe1KVvY5iEg3OP+Y1T YI7sxiyQYSLVlp0c8CFOcCfQtWVr+K17RmH5zjtnrxbUoOBrzOO65dwFFTVu8A/d 5nFn61X2CwJX3N3piZkQCfLii7u9vqoGDHFKk/ZyZ8+JrFPrBTFJwA2wHIObqx0Z XFZXGldodUi+quv0gQna+Wdxwfj/Fgg4kBLziPqTaNZ/pCKQRIJpdNDAgU8CKHnA O5AeC2Un7nr4W7zzxEmZsN+1prfLSkSCZNRbq7ibfgVLKGAqEstbg== 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 4e3nv6jhks-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 May 2026 10:59:38 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64CAdYnw007502; Tue, 12 May 2026 10:59:37 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4e3nfgjtcn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 May 2026 10:59:37 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64CAxXvl29950678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 May 2026 10:59:34 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB39320040; Tue, 12 May 2026 10:59:33 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8BA8D2004D; Tue, 12 May 2026 10:59:33 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 12 May 2026 10:59:33 +0000 (GMT) From: Jan Polensky To: hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, ojeda@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, aliceryhl@google.com Cc: borntraeger@linux.ibm.com, svens@linux.ibm.com, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org, rostedt@goodmis.org, ardb@kernel.org, linux-s390@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] s390: enable Rust support Date: Tue, 12 May 2026 12:59:20 +0200 Message-ID: <20260512105920.2426293-5-japo@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260512105920.2426293-1-japo@linux.ibm.com> References: <20260512105920.2426293-1-japo@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-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=Us1T8ewB c=1 sm=1 tr=0 ts=6a03081a cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=OycHxKo1JGOom9522MEA:9 X-Proofpoint-GUID: 0qdPOTKxaVl0fE-6NJ_YAIzcXSUzmurX X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTEyMDEwOSBTYWx0ZWRfXyy4DR4X8iF+V opC6FbN6RGvfnkHMHGJrbQ1x43ezBlRdEtRN7m9tgwlQFKwk5jcorSaDE78869xF1gE08PAomlE gN7pT2CfDIko+Spy/RGx8Fiwx/9JQ3F5qVpsz5T+6sCEStKtCg2asSUJsVgccVT3xktPy3ZI9nV IksDWNETNWg6Uo26l/cS6wvHQJPglIyVQa+L3BxfcH7jurLQjtUp9O4HnToFKDy/eOWJYcLAZ0F G2Yidr955B1NEkOFCXBGOgw2H7Wyi1/ACXOsVdnCo0dN7nhBOGtI6v19ijtZKPz0deatHiKhq85 kqhIr6TZU15aUj7s+f60cArmvb5VXPh1HOfBnph1OXRCt163TTwiXI658lkuqPI230PLKufNhXZ xg5aWOG1krviw8H6QsQph3urlCM0LHbbrSw4O3akWBtohkTvLq0C6AgNEVfYfikhT9FHA4L21oB FHH0493yEqE1oNOmMnA== X-Proofpoint-ORIG-GUID: j-eSqocwXA4keioqoHmZemb-aQmd4aaC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-11_05,2026-05-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 spamscore=0 malwarescore=0 clxscore=1015 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605050000 definitions=main-2605120109 Content-Type: text/plain; charset="utf-8" Enable building Rust code on s390 by wiring the architecture into the kernel Rust infrastructure. Add s390 to the Rust arch support documentation, provide the s390 Rust target and required compiler flags, and set the bindgen target for arch/s390. Adjust the Rust target generation and minimum rustc version gating so the s390 setup is handled explicitly. The Rust toolchain uses the "s390x" triple naming for the 64 bit target. Rust support is currently incompatible with CONFIG_EXPOLINE, which relies on compiler support for the -mindirect-branch=3D and -mfunction_return=3D options. Therefore, select HAVE_RUST only when EXPOLINE is disabled. Signed-off-by: Jan Polensky --- Documentation/rust/arch-support.rst | 1 + arch/s390/Kconfig | 1 + arch/s390/Makefile | 28 +++++++++++++++++----------- rust/Makefile | 1 + scripts/generate_rust_target.rs | 2 ++ scripts/min-tool-version.sh | 6 +++++- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-= support.rst index 6e6a515d0899..ce9804b8226c 100644 --- a/Documentation/rust/arch-support.rst +++ b/Documentation/rust/arch-support.rst @@ -19,6 +19,7 @@ Architecture Level of support Constraints ``arm64`` Maintained Little Endian only. ``loongarch`` Maintained \- ``riscv`` Maintained ``riscv64`` and LLVM/Clang only. +``s390`` Maintained \- ``um`` Maintained \- ``x86`` Maintained ``x86_64`` only. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index ecbcbb781e40..26951781d74d 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -248,6 +248,7 @@ config S390 select HAVE_RELIABLE_STACKTRACE select HAVE_RETHOOK select HAVE_RSEQ + select HAVE_RUST if !EXPOLINE select HAVE_SAMPLE_FTRACE_DIRECT select HAVE_SAMPLE_FTRACE_DIRECT_MULTI select HAVE_SETUP_PER_CPU_AREA diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 297976b41088..c393c22c47c8 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -35,25 +35,31 @@ KBUILD_CFLAGS_DECOMPRESSOR +=3D $(if $(CONFIG_DEBUG_INF= O),-g) KBUILD_CFLAGS_DECOMPRESSOR +=3D $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call c= c-option, -gdwarf-4,)) KBUILD_CFLAGS_DECOMPRESSOR +=3D $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-arr= ay-bounds) =20 +KBUILD_RUSTFLAGS +=3D --target=3Ds390x-unknown-none-softfloat -Zpacked-sta= ck -Ctarget-feature=3D+backchain + UTS_MACHINE :=3D s390x STACK_SIZE :=3D $(if $(CONFIG_KASAN),65536,$(if $(CONFIG_KMSAN),65536,1638= 4)) CHECKFLAGS +=3D -D__s390__ -D__s390x__ =20 export LD_BFD =20 -mflags-$(CONFIG_MARCH_Z10) :=3D -march=3Dz10 -mflags-$(CONFIG_MARCH_Z196) :=3D -march=3Dz196 -mflags-$(CONFIG_MARCH_ZEC12) :=3D -march=3DzEC12 -mflags-$(CONFIG_MARCH_Z13) :=3D -march=3Dz13 -mflags-$(CONFIG_MARCH_Z14) :=3D -march=3Dz14 -mflags-$(CONFIG_MARCH_Z15) :=3D -march=3Dz15 -mflags-$(CONFIG_MARCH_Z16) :=3D -march=3Dz16 -mflags-$(CONFIG_MARCH_Z17) :=3D -march=3Dz17 +march-name-$(CONFIG_MARCH_Z10) :=3D z10 +march-name-$(CONFIG_MARCH_Z196) :=3D z196 +march-name-$(CONFIG_MARCH_ZEC12) :=3D zEC12 +march-name-$(CONFIG_MARCH_Z13) :=3D z13 +march-name-$(CONFIG_MARCH_Z14) :=3D z14 +march-name-$(CONFIG_MARCH_Z15) :=3D z15 +march-name-$(CONFIG_MARCH_Z16) :=3D z16 +march-name-$(CONFIG_MARCH_Z17) :=3D z17 =20 -export CC_FLAGS_MARCH :=3D $(mflags-y) +mflags +=3D -march=3D$(march-name-y) =20 -aflags-y +=3D $(mflags-y) -cflags-y +=3D $(mflags-y) +export CC_FLAGS_MARCH :=3D $(mflags) + +aflags-y +=3D $(mflags) +cflags-y +=3D $(mflags) + +KBUILD_RUSTFLAGS +=3D -Ctarget-cpu=3D$(march-name-y) =20 cflags-$(CONFIG_MARCH_Z10_TUNE) +=3D -mtune=3Dz10 cflags-$(CONFIG_MARCH_Z196_TUNE) +=3D -mtune=3Dz196 diff --git a/rust/Makefile b/rust/Makefile index b9e9f512cec3..77460502f576 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -403,6 +403,7 @@ BINDGEN_TARGET_x86 :=3D x86_64-linux-gnu BINDGEN_TARGET_arm64 :=3D aarch64-linux-gnu BINDGEN_TARGET_arm :=3D arm-linux-gnueabi BINDGEN_TARGET_loongarch :=3D loongarch64-linux-gnusf +BINDGEN_TARGET_s390 :=3D s390x-linux-gnu # This is only for i386 UM builds, which need the 32-bit target not -m32 BINDGEN_TARGET_i386 :=3D i386-linux-gnu BINDGEN_TARGET_um :=3D $(BINDGEN_TARGET_$(SUBARCH)) diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target= .rs index 38b3416bb979..8f1df6819d0b 100644 --- a/scripts/generate_rust_target.rs +++ b/scripts/generate_rust_target.rs @@ -256,6 +256,8 @@ fn main() { } } else if cfg.has("LOONGARCH") { panic!("loongarch uses the builtin rustc loongarch64-unknown-none-= softfloat target"); + } else if cfg.has("S390") { + panic!("s390 uses the builtin rustc s390x-unknown-none-softfloat t= arget"); } else { panic!("Unsupported architecture"); } diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh index b96ec2d379b6..b1020cb9b755 100755 --- a/scripts/min-tool-version.sh +++ b/scripts/min-tool-version.sh @@ -31,7 +31,11 @@ llvm) fi ;; rustc) - echo 1.85.0 + if [ "$SRCARCH" =3D "s390" ]; then + echo 1.97.0-nightly + else + echo 1.85.0 + fi ;; bindgen) echo 0.71.1 --=20 2.51.0