From nobody Tue Feb 10 23:12:18 2026 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 C7FB5360728 for ; Tue, 10 Feb 2026 10:57:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770721051; cv=none; b=Z1qG63W0ELExjAkzkg2ZJWiPu6Lg1IKEXJwR9TUFwquEB93OQwWQFpNIY+XBB4cH36ckFrzV8zkUrorF2430DxUersIEut5HwNb3Wv/yAxJZX11Ay2rxoQmBIEi5cUwgeGwvVc8MCTsuGCoKpuH9vu7Zi8uJEhLykcMqGM/BH/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770721051; c=relaxed/simple; bh=TeX6FpDhYE6FSzmi7IBpjgfnly62UeaRLnW4YBkuyHg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pBN5fSFe+sUvrRYJ/6N9Gwacr9bHHP3loxlCK4X+1/9rWrbVd/hHRloNQnUOqTsoUHliXAxAPtc9ohowYPcZCRNIFoqRIww2PkZ6h/7F+GJ9LLj+GkZJLnAdF5gZAZSm6mYsmxKpVKfBBz4Tw/0h3HaDiNaSUOJJkqLZSEXHAOs= 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=ZcftNBcf; arc=none smtp.client-ip=209.85.167.174 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="ZcftNBcf" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-45c7c841904so2572401b6e.3 for ; Tue, 10 Feb 2026 02:57:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770721048; x=1771325848; 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=fIJz3kYN33qG3Fl2V6Bqi8+KcSudbe9ldFTSf7iXp3g=; b=ZcftNBcfhxbMrjbyDtqwvTTZF+i6EZIUvgJJiVJa441M+GIIncjf69U/nMaOa2np6g vsCgvaYd8nHichB3tKWjRtdMrGqAjcsfU0mDyxDnHTJWMpAASNDCyRURZtpq7tlsmGhk HANYFW3oPU0kwsTUjresPLUMHGgPg1AJQs0kpDZryBsKMu76gnLeqpFK7Y7Bd12jmxnX KvhMvjP2QMkZLPuAq/lRSCRU7J2JXPQLLl10pbz0JHAtjsQ6GYNnlptSwMgoHjh4wG1U tOsjHp42t0RREU16LEoMB0pDuyFpHnqcGXHGoo8MxBUO2hXhQEEy3IKZY/dscYitL588 TYuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770721048; x=1771325848; 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=fIJz3kYN33qG3Fl2V6Bqi8+KcSudbe9ldFTSf7iXp3g=; b=K8LnlWBiZevOjYfaGXvqnHxHq8VLGVTMYP3jZLqPu6D/pwhiDZiwEeg3ubwmFLHifl wJ9K0LFPJ5mnWjmn08kYGXLpEuq8ZtbaabO75pQH3XtGEpEvwPJmpoRxLnO+QqJI33BX Kg9RKIOHMQmMEhZthQYornOboj7jMJznAtN5MqjxX+er8mFrtW52pcYBKwSOK4KSd26N lOI96IjwiYsUzfOGASsJZvQPZ8zcORN08R+zuFLDt+gXMp5nWnLNpQKTrwWTOag09n// 06WseG/BR/uxogZnNGY9wfYtZrX905pvHGhuMhpfKrztLF0U7ej8M5yiZcirYP8ar6Y8 RqOw== X-Forwarded-Encrypted: i=1; AJvYcCXc7iqNxEbnmea8LjLI6jY0kYUTudZ98YRO1TzGH+UmVxnbOUbWugFcR7Vba4dW6tS5manGMIUS4SqeGNc=@vger.kernel.org X-Gm-Message-State: AOJu0YyqMj2QD9/eJlbdhTryAzh26inM6W84UNZG6A+tO6c1g17wjGvA nrD6VyGj4tEp3XD2IZ6ZRPoZwBHE0A0pO1rQbfUaXxFLwqIkGBrCRxoIdO7RZw== X-Gm-Gg: AZuq6aIuaJATF+/4c8bmuvm/BwDk/WNDetCln+esP8YsG45O06LM30BCcKc+uRoHSUM 9HutziRNGzKZmv5atTdKTw41IVQGoknI9zelNyYe9qaEWnGgvtiDoCfWdDCGNpPmfydl2zhkrzQ crxcfTLcFV1be5aZ+9BolIBaubyQ6wdvdfc1lEfa/PXAsqDVdNIluPRvanVJhdFhJQaZ7/cb6M7 TK44rpBzXgeUheIZUVg5KqDegqSznvN/JaIojytQzFgBNfaJkoUSfmHn4UNVkEgifXzbd/4tiYa kdO5jzlrxjxnzBUjsrz/BQnbzhQEpkcy4kCpCA0TK3fqFKbCGj5yCI7f3HgBqX3CfrX0+oSwJV5 d/dujgJHL+m0CEcE+WaA38+cokROoBtjESUS4c50CJIVwEfv1g7OlCPOzWW+cBhPbvAEv66LBmj GjknuoV82GqXaXTiTrl+dlZHjjcYVBqq2vzhFWgjNhU875Wt3lLEyqdLoT4WDQBU7BVl2WzpCQL ukdMcuCpw== X-Received: by 2002:a17:903:b4e:b0:2a0:fe9f:1884 with SMTP id d9443c01a7336-2a95194aaeamr120907585ad.55.1770714055465; Tue, 10 Feb 2026 01:00:55 -0800 (PST) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.in.ibm.com ([129.41.58.2]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a951c7a342sm129536605ad.26.2026.02.10.01.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 01:00:55 -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)" , Venkat Rao Bagalkote Subject: [PATCH V6 3/3] powerpc: Enable Rust for ppc64le Date: Tue, 10 Feb 2026 14:30:22 +0530 Message-ID: <20260210090023.2587534-4-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260210090023.2587534-1-mkchauras@gmail.com> References: <20260210090023.2587534-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) Tested-by: Venkat Rao Bagalkote Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- Documentation/rust/arch-support.rst | 2 +- arch/powerpc/Kconfig | 1 + arch/powerpc/Makefile | 7 ++++++- rust/Makefile | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-= support.rst index 70b9e192a7a0..70bcd726ad0e 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`` Maintained 32-bit Big Endian only. +``powerpc`` Maintained 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..9385db478c59 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -61,7 +61,12 @@ else KBUILD_LDFLAGS_MODULE +=3D $(objtree)/arch/powerpc/lib/crtsavres.o endif =20 -KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc-unknown-linux-gnu +ifdef CONFIG_PPC64 +KBUILD_RUSTFLAGS +=3D --target=3Dpowerpc64le-unknown-linux-gnu +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