From nobody Sat Apr 18 06:50:30 2026 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73A05257851 for ; Tue, 10 Feb 2026 05:38:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770701897; cv=none; b=ldemNfVcDNvIbrmMkf5oQwXjC4V75LG7n3iOzQedc0t62ZQcBICWoCquaU85VkLJMl490np//nnVBoNFAPOBMomclJQHOMXZQhM0J3B20flnv9Cgat5T2VB4Z2E/cqI6ywZpsuP+v6YLGO/kI+ZiGcnDsRRqByS1e8pT44daXhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770701897; c=relaxed/simple; bh=63ZYZ44YU4LogYL8Tr91C4w7OlzNcXn3CNTZsrHwj9U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BbjC68h+rpQrK1jB+/TNwBqzhxYifBwHChsautXXheeIpy2OM3sztOwTz6WhnenSIMTNpykGriwOKLSEbKqoyhtJi/iWLB5GDR+V8OmMkqM6IQx09R8PUsr0yNmnmWp0V2dAwJTGIV9ULSXqqXI/A3BwOvvIeYkVTmadqv4VljA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KdDdM3sT; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KdDdM3sT" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-824484dba4dso403135b3a.0 for ; Mon, 09 Feb 2026 21:38:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770701895; x=1771306695; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GWQDA/EkiuOrnzzQZpTgk67yZSDsyGvnGU0WBzxGHSc=; b=KdDdM3sTXZE90m0ae+6F8OiU5wyUsOpNvljHSTLIx5nJ65b1U2dIpEBjLxHh+3+e+E GChk4m0YulxGnBcmknx4EBZ0xtZgack5Xge6hDJ6OyrfoSFxEPMDxizS5NVeX1ry5OWz F++3tYIL9asF70Oe3Nyvo1a7+9InlF5KKvuQnSrk3Zyps/bPejmf5Z9R6ncS0/nQpj5d v1E0ol9hFtqZYGfl92bggpAgwA8GEGwmThz8NClGtC1hxd0oKYXbY8I4xT6uaOgBqIND ugHOqIOR9gakZr45i0lTaziTtN77+Mbu8DnJFkh3+5jdXvMeXzyU5STY5zSwrHlZxDC0 paLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770701895; x=1771306695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=GWQDA/EkiuOrnzzQZpTgk67yZSDsyGvnGU0WBzxGHSc=; b=OTXbJZagnKHZreVyHA7Zrgul6kiOjKlcmXsLAgDTBj9dWipTzR6PMNxeol6fxh6itR tv7mYLtsFakxv5TVXbKCbqkhR+1xSw0/Yhm+eXBaSgEYW/fiUDwtX6hGsKco2YxFeD4h xR7GHsRHzD/xrWcDWAAAuD4pab49vo99FcxuOXeXYXBlA/aTP5wcwl9Te1Ux7aVHppCf gi/NLcKezF3EcEm4PBSFpo/ZSv4nL6AtyJZmS2wZVSVRREllhxaR/Z3qy3/W5Xo+G76X i9pJT/Xeuz7501qYn9c1HcCoF+zGvebcN7pR7WEOyuYcZtpjuY/LjfDBGRw7lHRx0t4D w/rg== X-Forwarded-Encrypted: i=1; AJvYcCVM59HWzI5DdtPolw9Vqaome4YjLxzOGy9l0Z7mHxBg6TJmfeASBsp6tOkkDFpSaypo6vSLxkVbFnHEjiY=@vger.kernel.org X-Gm-Message-State: AOJu0YxGk5MPCieABWEldYtRpIIH+d+fQk9eaQkXy1TPib1HmoybG0L8 ArwNy4kQLyFxAxv/PV/l2QH9hP/gunLE+eZvle9k7qOx9kqIdXi7F6z9 X-Gm-Gg: AZuq6aKZwRVJ1wKsAtYirv7HoV4p8/vJ5wxGcInKK+mxxmvLylE4YNZHaMJ0oSq1TJv vZ+/BkZ/tQuwmTyk24PBC1LB09yMaS6mfBomLIv80fnqPT0GoGhoD9fffwlq+RDBeB2S8EOgWWR HU+OD09GyZZauqYll4c1umY8qalCZKhCZ6VrpEIbgsOlPJUwv8Jg0QECCXeTU8CFPGOTPCnbYd8 J5EhVexRFUFo6nZhigA/CwKIEslxBtV3wKDMHrHsCENK5Ez62lyPrMS98cvEjMAJe+GaBCi4xTe GUbYbuE4+B1zeFVs3S3aRQxqsUEKe6Tv5nAw1jQ7TkRYB84QTPM13y2DsYH/+wV+BN34Bninkmc PWzl++huI5HlOj/f8GU8bfDt9RkiTuBbxhYRqHwV0bN/eFQePcVB/4rl/0S5v4Khitp2W7TBBxF 7/ywNoJQJ6n+rR8qtMHPZ0TXbQtVwMmeDlbsA/1EwG26fRa/QlhVMoPTtWGgNvWerxEKr3i34= X-Received: by 2002:a05:6a00:414e:b0:81e:8e66:38d9 with SMTP id d2e1a72fcca58-82441632ce9mr12934398b3a.17.1770701894709; Mon, 09 Feb 2026 21:38:14 -0800 (PST) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.in.ibm.com ([129.41.58.2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8245b62d773sm7529056b3a.36.2026.02.09.21.38.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Feb 2026 21:38:14 -0800 (PST) From: "Mukesh Kumar Chaurasiya (IBM)" To: linkmauve@linkmauve.fr, ojeda@kernel.org, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org, corbet@lwn.net, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, rostedt@goodmis.org, ardb@kernel.org, rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: "Mukesh Kumar Chaurasiya (IBM)" Subject: [PATCH V5 1/3] powerpc/jump_label: adjust inline asm to be consistent Date: Tue, 10 Feb 2026 11:07:54 +0530 Message-ID: <20260210053756.2088302-2-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260210053756.2088302-1-mkchauras@gmail.com> References: <20260210053756.2088302-1-mkchauras@gmail.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 Content-Type: text/plain; charset="utf-8" Added support for a new macro ARCH_STATIC_BRANCH_ASM in powerpc to avoid duplication of inline asm between C and Rust. This is inline with commit aecaf181651c '("jump_label: adjust inline asm to be cons= istent")' Co-developed-by: Madhavan Srinivasan Signed-off-by: Madhavan Srinivasan Reviewed-by: Alice Ryhl Reviewed-by: Christophe Leroy (CS GROUP) Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- arch/powerpc/include/asm/jump_label.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/jump_label.h b/arch/powerpc/include/a= sm/jump_label.h index d4eaba459a0e..a6b211502bfe 100644 --- a/arch/powerpc/include/asm/jump_label.h +++ b/arch/powerpc/include/asm/jump_label.h @@ -15,14 +15,20 @@ #define JUMP_ENTRY_TYPE stringify_in_c(FTR_ENTRY_LONG) #define JUMP_LABEL_NOP_SIZE 4 =20 +#define JUMP_TABLE_ENTRY(key, label) \ + ".pushsection __jump_table, \"aw\" \n\t" \ + ".long 1b - ., " label " - . \n\t" \ + JUMP_ENTRY_TYPE key " - . \n\t" \ + ".popsection \n\t" + +#define ARCH_STATIC_BRANCH_ASM(key, label) \ + "1: nop \n\t" \ + JUMP_TABLE_ENTRY(key,label) + static __always_inline bool arch_static_branch(struct static_key *key, boo= l branch) { - asm goto("1:\n\t" - "nop # arch_static_branch\n\t" - ".pushsection __jump_table, \"aw\"\n\t" - ".long 1b - ., %l[l_yes] - .\n\t" - JUMP_ENTRY_TYPE "%c0 - .\n\t" - ".popsection \n\t" + asm goto( + ARCH_STATIC_BRANCH_ASM("%c0", "%l[l_yes]") : : "i" (&((char *)key)[branch]) : : l_yes); =20 return false; @@ -34,10 +40,7 @@ static __always_inline bool arch_static_branch_jump(stru= ct static_key *key, bool { asm goto("1:\n\t" "b %l[l_yes] # arch_static_branch_jump\n\t" - ".pushsection __jump_table, \"aw\"\n\t" - ".long 1b - ., %l[l_yes] - .\n\t" - JUMP_ENTRY_TYPE "%c0 - .\n\t" - ".popsection \n\t" + JUMP_TABLE_ENTRY("%c0", "%l[l_yes]") : : "i" (&((char *)key)[branch]) : : l_yes); =20 return false; --=20 2.53.0 From nobody Sat Apr 18 06:50:30 2026 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4F5930BBB7 for ; Tue, 10 Feb 2026 05:38:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770701902; cv=none; b=UxzUkziCjVaPs4Dl4sUi6vAOZoikBnEvCkB/l0u8ZXsmzJ5H34lZ23ZpDfIOR9djslIqxv7W5VuIWGUYYx7LYkvvT6dW/HfpxxW3wbHlI1Rv9Is+ciTQGFUW3Ao0Wi9qS3TYzooIRKlcIbhwNTAC2mRZ0JEiy8dPBAQjtNphz6w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770701902; c=relaxed/simple; bh=xG+iKu12LZBylrATKh/futyKH7FfBK8l0BhELtv+O7c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=m8iooQS4sp4foig7B4n/DAI/jARh1N2bGhbVEcek78Zie1XvlfHzajNfxtU2svJ7vUNYDtqikLlE5g375eQJM7D5mM4lQIAjG4TKA9Wuhe3BeHluTmIAgc17W8+4xcc5Wds12B4P++NIlG1XvUtl8GMh9m9AjiwYrRKBZKMSXic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KaKqUwu4; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KaKqUwu4" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-82311f4070cso3445626b3a.0 for ; Mon, 09 Feb 2026 21:38:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770701901; x=1771306701; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Cqa51jQ51mIYrhUu71vdVarPvI31OG/fcLZs5WN5E9s=; b=KaKqUwu4f6JJUpT06wW+dtpwtIDJ8eTjhLPpbl6TVIIvkcgolVxKS9f973CRIQO7KA u9cIaVZ4eZUa2OzQUku71OffzIQ7HuToeI5mCUGbWUxH+3r6B+4diw8UvnofI6h2d/dG V9Ikenr1J63OGlDwi2T/nFzQbL5Gksz2UNDfwhzAD4dFTbbuEsoUnjvsGp4PsAqNEU5W j1jvKmqDEujicKwM2Uik52IZqpFtDr/o6AJU1eG9e1afXSqJM6tqhASin3PjL2AMw6La O0p8gWp3VHnFKKcKD0Xug0ZIkicmk9zCnrP5K6ep64Mp5f+EnbljWTKtdtN6JU9zYAw0 XQfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770701901; x=1771306701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Cqa51jQ51mIYrhUu71vdVarPvI31OG/fcLZs5WN5E9s=; b=YPhG99o2xiFO/1L6+WEEyI/K2KKCLzapDxstzaTlsJaeGyjcVOFDOSJlw2ZamBOh8/ ENzyrUbWIX9bAQm6LYZeHysxVWKqIxPMA6mkriT0caBUBcyhHBxRiKdbmpJF7ZxOe61u pZpOqasjTXBeOnClu4EvyNn16+TcWssEUgYtB6ZqSbv69HfrFNQcKnUoOdwQBjiuV4P3 a6FUcS6+NbVTowiW6+ZYV6q/zqU3Ou86+juELT3wG2jAk5XmK1qkqRPFdm7DmHd6CPyI 7tGbYgauypj2bo5kSRcGin4JMloBKYkbVHxDhzZqcepizUM4TPyLTKhOeaYZtGdpJrhg 3w/A== X-Forwarded-Encrypted: i=1; AJvYcCVE+78zn53p5vXbT7k4U+dQlWY0mpT1xqt/jAGV3u2Cd+0THbqRQY3K8p6yFS7x7adn6ULdt9L2+iGnaIY=@vger.kernel.org X-Gm-Message-State: AOJu0YxFc6jWXWVZnuTnn2SkSBBeAJy4RkqTbRhtfU1ME/5Dd5NY097y zHdi84MacSIROYFWfvb06BZbjCkl4N7iCVnjv/sc5URk6Kj0lcJ1qWQA X-Gm-Gg: AZuq6aKHrFnLGLauJNvmgf+y5ML+MPBLcOhAFbGDnbt8Y5n1hClU/U7IPgLPOebhcHD 0vj5GjM78XbRP9chpnkZ3xtGAr2o7YKmpIj6ncSroDdRxeux/UT2TWF1SIh0RhXTzdsu88CQPnw vY2UDE4PhaC6E4jAeXcVxUwFCHWLhyfD7oPuMi7Ekt0U/W+z3c8X5pRxi2dD17g51I+bOZbR96g AuwmgxVClSopkg76tKFs5do9i7FxUBS84vfL0MvIIAv/n/q7fNaSvrCNNtWiSMvSEkDQhq4xrdY VnktD7KFOoshrRcsmLqvxHMg6qrTaBSyZzLhiRxSjxk+IlxUs6QNQD3tDRlYJ83PqBVvMzMBrf7 vuJHFZgy1vYhTgKGaKYUAm3myg+/+kepHky5AKb7NyZc8XBc1mW8d7h6PA44C9SL+BSzykjzUdN HUQKeAlIljRJUawFf4VDxsuYTEMyGKrkKObpayJdO1vP+XySmI0+6lLIdB6N6lgN36EMg3r1IF4 mCtoCslVw== X-Received: by 2002:a05:6a00:22c8:b0:81f:4e1c:1d3b with SMTP id d2e1a72fcca58-824877d3c6fmr1007679b3a.23.1770701900828; Mon, 09 Feb 2026 21:38:20 -0800 (PST) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.in.ibm.com ([129.41.58.2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8245b62d773sm7529056b3a.36.2026.02.09.21.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Feb 2026 21:38:20 -0800 (PST) From: "Mukesh Kumar Chaurasiya (IBM)" To: linkmauve@linkmauve.fr, ojeda@kernel.org, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org, corbet@lwn.net, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, rostedt@goodmis.org, ardb@kernel.org, rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: "Mukesh Kumar Chaurasiya (IBM)" Subject: [PATCH V5 2/3] rust: Add PowerPC support Date: Tue, 10 Feb 2026 11:07:55 +0530 Message-ID: <20260210053756.2088302-3-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260210053756.2088302-1-mkchauras@gmail.com> References: <20260210053756.2088302-1-mkchauras@gmail.com> 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="utf-8" Content-Transfer-Encoding: quoted-printable From: Link Mauve For now only Big Endian 32-bit PowerPC is supported, as that is the only hardware I have. This has been tested on the Nintendo Wii so far, but I plan on also using it on the GameCube, Wii U and Apple G4. These changes aren=E2=80=99t the only ones required to get the kernel to co= mpile and link on PowerPC, libcore will also have to be changed to not use integer division to format u64, u128 and core::time::Duration, otherwise __udivdi3() and __umoddi3() will have to be added. I have tested this change by replacing the three implementations with unimplemented!() and it linked just fine. Signed-off-by: Link Mauve Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- Documentation/rust/arch-support.rst | 1 + arch/powerpc/Kconfig | 1 + arch/powerpc/Makefile | 2 ++ rust/Makefile | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-= support.rst index 6e6a515d0899..e26a94808e97 100644 --- a/Documentation/rust/arch-support.rst +++ b/Documentation/rust/arch-support.rst @@ -18,6 +18,7 @@ Architecture Level of support Constraints ``arm`` Maintained ARMv7 Little Endian only. ``arm64`` Maintained Little Endian only. ``loongarch`` Maintained \- +``powerpc`` Experimental 32-bit Big Endian only. ``riscv`` Maintained ``riscv64`` and LLVM/Clang only. ``um`` Maintained \- ``x86`` Maintained ``x86_64`` only. diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 9537a61ebae0..17db23b82e91 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -283,6 +283,7 @@ config PPC select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE select HAVE_RSEQ + select HAVE_RUST if PPC32 select HAVE_SAMPLE_FTRACE_DIRECT if HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS select HAVE_SAMPLE_FTRACE_DIRECT_MULTI if HAVE_DYNAMIC_FTRACE_WITH_DIRECT= _CALLS select HAVE_SETUP_PER_CPU_AREA if PPC64 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index a58b1029592c..9fd82c75dcbd 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -61,6 +61,8 @@ else KBUILD_LDFLAGS_MODULE +=3D $(objtree)/arch/powerpc/lib/crtsavres.o endif =20 +KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc-unknown-linux-gnu + ifdef CONFIG_CPU_LITTLE_ENDIAN KBUILD_CPPFLAGS +=3D -mlittle-endian KBUILD_LDFLAGS +=3D -EL diff --git a/rust/Makefile b/rust/Makefile index 4dcc2eff51cb..ae22f2c5f0b3 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -384,13 +384,15 @@ bindgen_skip_c_flags :=3D -mno-fp-ret-in-387 -mprefer= red-stack-boundary=3D% \ -fstrict-flex-arrays=3D% -fmin-function-alignment=3D% \ -fzero-init-padding-bits=3D% -mno-fdpic \ -fdiagnostics-show-context -fdiagnostics-show-context=3D% \ - --param=3D% --param asan-% -fno-isolate-erroneous-paths-dereference + --param=3D% --param asan-% -fno-isolate-erroneous-paths-dereference \ + -ffixed-r2 -mmultiple -mno-readonly-in-sdata =20 # Derived from `scripts/Makefile.clang`. 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_powerpc :=3D powerpc-linux-gnu BINDGEN_TARGET_um :=3D $(BINDGEN_TARGET_$(SUBARCH)) BINDGEN_TARGET :=3D $(BINDGEN_TARGET_$(SRCARCH)) =20 --=20 2.53.0 From nobody Sat Apr 18 06:50:30 2026 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7162A32FA2B for ; Tue, 10 Feb 2026 07:08:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770707326; cv=none; b=tlt+lyA9VJk/DL6RDUIunA+9YTtzJTgerWuBHhBANqepp5djRLg054XBgWrXktA5AFLJiwu8uteft5BYYTIpo3ots5yfQMXgi0Clwza9eLPhwKOmdjuySeOMM91tZP0udGkMQ3ncTmiE44nuk0wazAG6D3grdp+CGcyBOaEM8ck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770707326; c=relaxed/simple; bh=4vMSjpDvokaDPJWcGhnJnR0EhkBdHN+zzZ41Z2GkwAQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KF7lIKS1Wh/2E4dzjX7omQgqZHCU3GShgJjkXmgFFhQ2Ngg2TnbaS+obvsDd0faSy7TEazXIGaLBtHB+qB44JQVrxZBJTmj8ckDqAm/MXBSSsbz3JQumuvSbtj3cdsIYI/7QOgwqNPxF0BWmU8wrddsC6NYzuPcPBUXqJiIYZjs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=F3590TpY; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F3590TpY" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-b4755f37c3eso2482268a12.3 for ; Mon, 09 Feb 2026 23:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770707325; x=1771312125; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+ELct8JbGFslmyeZtvX1PbcqdzEj+R+mb18t5qqOGr8=; b=F3590TpYXNL5piRG+15xbut0vBHSutpWEzd3LJD/7PhZMiqoeNNzkqvb3m6XSZMQgj UT/CItYK1EteWY5sxXXcgS/n7bBJ+Lm8RCQeVWz6UthL3zw0WZ/x11mjJWT/Z7iOGcyc QE4A7ylghNKqYOa2A8jphGIKfxN4ljCFRRNLNiBUK6ohac2+4jWkHSY5gXDdzfEICqfa XltBL5pJmlappM+fwY5Jlm+6p/5DK16z5lTK6KRXkyp/B95EMx5rBPBUQgvYVsvURY52 42C99PEsv+wqXvlij/d0hi6HZuYoez6QHXTuLHDEEaplBTmaZiv/K4oMVf69qrHVz0uq kpcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770707325; x=1771312125; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+ELct8JbGFslmyeZtvX1PbcqdzEj+R+mb18t5qqOGr8=; b=F/YcO0YEJ/aca4JkBkFQL2Ybm+EJTveEkgS/dn9ywSXD4RZg9YVK+nPbj/79kIdxvH DSYanQr9y3KmVccf0aMCEntZHoEvg8rfUcZNYIBEvOJqSuHweBGS/od0DRIa9pbsr5+S Vpe2NyUSC2jvMezEdnak5ugwBVGUV0wXh8N99WFVjh9lT4ZNidr2Kysb3pZO8BGJfFYZ 2N4OOOIGL4S5H+P91ZpmCA/x0ihS3eCVanhdTNfoNqwdSymJJEGyjlpZ4MB96SOUOMai FjgBSvV1Gklvf7lW7QOaigxZjKBveKJ0IdlTXFz7IO6KTIdB1Uu6DWkTO1EOmJ6rrDrW jPVg== X-Forwarded-Encrypted: i=1; AJvYcCUC2CN59uAIxRjvEMUeVR17YiVU2DSAh9edFzGeVMN/A1wGf4t4bShqz2yl3W+//nCSapXs029M005i1kc=@vger.kernel.org X-Gm-Message-State: AOJu0YyZ+Bg+rJ6d4YPEnye5bIzVBMZcnjjy3+DJFupRVqDUj6oP4d55 mN5qyS0WIA+81RmdLLKnl0tuMsugxsboJ5YCyWqwWYtmK8fPEbXaOLXqz2tHig== X-Gm-Gg: AZuq6aLGgW4rmT7fjFwQtJD/yTMJ65AIUmVXXBS0vnarx7byRLUfNH8QJdnaMV9TLT+ GF7R+Q/jsY086ugN68mCmP/zRWdVKCHqT/xE4lp11WSgvgm3hEesWvZIlvweUTxPFT+jVVNccEH JH2ckTB2sCKUeiSXpLpMYOxMOfxL3H2VTYpfE525KcSwyQC3ikE5wbmpjp04/S2r1yBiorE4jlB SIU61ETMHT8JiftIJanGsaw4ZEEwC4nOuebU0vsFgrCjQt7VXbCUkWcqNHzRnYMADu7w7oabPkb uANZySNsOv6G6ttnrCCQyBw+qcIdHN5IK/V7bcmQHTzBGdnXhb9RCHt8uuYD7/ZFYTRzY143XNH h9OxFp0RJ7GagF6B/Qrf92T1tJ45IhNoUF5d6RZ/SdbtEWvjXJ5owHgeGG2OtRINvc0teuO9gWE SmaKwD8LWg3gPRkIZL5V8ftoI0bshocTc7UmSMPGmB0O3GpVUfPKt3qEDGPT3V8lbEQdL2ndeUi 1znhgQMyw== X-Received: by 2002:a05:6a20:734f:b0:37e:7e93:99cf with SMTP id adf61e73a8af0-393ad310a05mr12386368637.37.1770701906995; Mon, 09 Feb 2026 21:38:26 -0800 (PST) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.in.ibm.com ([129.41.58.2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8245b62d773sm7529056b3a.36.2026.02.09.21.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Feb 2026 21:38:26 -0800 (PST) From: "Mukesh Kumar Chaurasiya (IBM)" To: linkmauve@linkmauve.fr, ojeda@kernel.org, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org, corbet@lwn.net, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, rostedt@goodmis.org, ardb@kernel.org, rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: "Mukesh Kumar Chaurasiya (IBM)" Subject: [PATCH V5 3/3] powerpc: Enable Rust for ppc64le Date: Tue, 10 Feb 2026 11:07:56 +0530 Message-ID: <20260210053756.2088302-4-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260210053756.2088302-1-mkchauras@gmail.com> References: <20260210053756.2088302-1-mkchauras@gmail.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 Content-Type: text/plain; charset="utf-8" Enabling rust support for ppc64le only. Tested on powernv9: $ uname -rm 6.19.0-rc8+ ppc64le $ sudo modprobe rust_minimal [ 632.890850] rust_minimal: Rust minimal sample (init) [ 632.890881] rust_minimal: Am I built-in? false [ 632.890898] rust_minimal: test_parameter: 1 $ sudo rmmod rust_minimal [ 648.272832] rust_minimal: My numbers are [72, 108, 200] [ 648.272873] rust_minimal: Rust minimal sample (exit) $ sudo modprobe rust_print [ 843.410391] rust_print: Rust printing macros sample (init) [ 843.410424] rust_print: Emergency message (level 0) without args [ 843.410451] rust_print: Alert message (level 1) without args [ 843.410477] rust_print: Critical message (level 2) without args [ 843.410503] rust_print: Error message (level 3) without args [ 843.410530] rust_print: Warning message (level 4) without args [ 843.410557] rust_print: Notice message (level 5) without args [ 843.410594] rust_print: Info message (level 6) without args [ 843.410617] rust_print: A line that is continued without args [ 843.410646] rust_print: Emergency message (level 0) with args [ 843.410675] rust_print: Alert message (level 1) with args [ 843.410691] rust_print: Critical message (level 2) with args [ 843.410727] rust_print: Error message (level 3) with args [ 843.410761] rust_print: Warning message (level 4) with args [ 843.410796] rust_print: Notice message (level 5) with args [ 843.410821] rust_print: Info message (level 6) with args [ 843.410854] rust_print: A line that is continued with args [ 843.410892] rust_print: 1 [ 843.410895] rust_print: "hello, world" [ 843.410924] rust_print: [samples/rust/rust_print_main.rs:35:5] c =3D "he= llo, world" [ 843.410977] rust_print: Arc says 42 [ 843.410979] rust_print: Arc says hello, world $ sudo rmmod rust_print [ 843.411003] rust_print: "hello, world" [ 888.499935] rust_print: Rust printing macros sample (exit) Reviewed-by: Link Mauve Tested-by: Link Mauve Reviewed-by: Christophe Leroy (CS GROUP) Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- Documentation/rust/arch-support.rst | 2 +- arch/powerpc/Kconfig | 1 + arch/powerpc/Makefile | 9 ++++++++- rust/Makefile | 6 ++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-= support.rst index e26a94808e97..627471ac9238 100644 --- a/Documentation/rust/arch-support.rst +++ b/Documentation/rust/arch-support.rst @@ -18,7 +18,7 @@ Architecture Level of support Constraints ``arm`` Maintained ARMv7 Little Endian only. ``arm64`` Maintained Little Endian only. ``loongarch`` Maintained \- -``powerpc`` Experimental 32-bit Big Endian only. +``powerpc`` Experimental 64-bit Little Endian. 32-bit Big Endian. ``riscv`` Maintained ``riscv64`` and LLVM/Clang only. ``um`` Maintained \- ``x86`` Maintained ``x86_64`` only. diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 17db23b82e91..954af27e10c5 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -284,6 +284,7 @@ config PPC select HAVE_RELIABLE_STACKTRACE select HAVE_RSEQ select HAVE_RUST if PPC32 + select HAVE_RUST if PPC64 && CPU_LITTLE_ENDIAN select HAVE_SAMPLE_FTRACE_DIRECT if HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS select HAVE_SAMPLE_FTRACE_DIRECT_MULTI if HAVE_DYNAMIC_FTRACE_WITH_DIRECT= _CALLS select HAVE_SETUP_PER_CPU_AREA if PPC64 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 9fd82c75dcbd..f93816ddc036 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -61,7 +61,14 @@ else KBUILD_LDFLAGS_MODULE +=3D $(objtree)/arch/powerpc/lib/crtsavres.o endif =20 -KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc-unknown-linux-gnu +ifdef CONFIG_PPC64 +ifdef CONFIG_CPU_LITTLE_ENDIAN +KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc64le-unknown-linux-gnu +endif +KBUILD_RUSTFLAGS +=3D -Ctarget-feature=3D-mma,-vsx,-hard-float,-altivec +else +KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc-unknown-linux-gnu +endif =20 ifdef CONFIG_CPU_LITTLE_ENDIAN KBUILD_CPPFLAGS +=3D -mlittle-endian diff --git a/rust/Makefile b/rust/Makefile index ae22f2c5f0b3..0aef472c6cf5 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -392,7 +392,13 @@ 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 + +ifdef CONFIG_PPC64 +BINDGEN_TARGET_powerpc :=3D powerpc64le-linux-gnu +else BINDGEN_TARGET_powerpc :=3D powerpc-linux-gnu +endif + BINDGEN_TARGET_um :=3D $(BINDGEN_TARGET_$(SUBARCH)) BINDGEN_TARGET :=3D $(BINDGEN_TARGET_$(SRCARCH)) =20 --=20 2.53.0