linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] Rust enablement for LoongArch
@ 2024-01-08  3:21 WANG Rui
  2024-01-08  3:21 ` [PATCH v1 1/2] Documentation: rust: Add a character to the first column WANG Rui
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: WANG Rui @ 2024-01-08  3:21 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Huacai Chen,
	Jonathan Corbet
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, WANG Xuerui, rust-for-linux,
	linux-kernel, loongarch, linux-doc, loongson-kernel, WANG Rui

Enable Rust support for the LoongArch architecture.

Previous versions:
v0: https://lore.kernel.org/loongarch/20240106065941.180796-1-wangrui@loongson.cn/

Changes in v1:
 - Address htmldocs warning.

WANG Rui (2):
  Documentation: rust: Add a character to the first column
  LoongArch: Enable initial Rust support

 Documentation/rust/arch-support.rst | 13 +++++++------
 arch/loongarch/Kconfig              |  1 +
 arch/loongarch/Makefile             |  3 +++
 scripts/generate_rust_target.rs     | 10 ++++++++++
 4 files changed, 21 insertions(+), 6 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v1 1/2] Documentation: rust: Add a character to the first column
  2024-01-08  3:21 [PATCH v1 0/2] Rust enablement for LoongArch WANG Rui
@ 2024-01-08  3:21 ` WANG Rui
  2024-01-08  3:21 ` [PATCH v1 2/2] LoongArch: Enable initial Rust support WANG Rui
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 17+ messages in thread
From: WANG Rui @ 2024-01-08  3:21 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Huacai Chen,
	Jonathan Corbet
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, WANG Xuerui, rust-for-linux,
	linux-kernel, loongarch, linux-doc, loongson-kernel, WANG Rui

Add a character to the first table column in preparation for subsequent
'loongarch' row additions.

Signed-off-by: WANG Rui <wangrui@loongson.cn>
---
 Documentation/rust/arch-support.rst | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-support.rst
index b91e9ef4d0c2..14875a2e073a 100644
--- a/Documentation/rust/arch-support.rst
+++ b/Documentation/rust/arch-support.rst
@@ -12,10 +12,10 @@ which uses ``libclang``.
 Below is a general summary of architectures that currently work. Level of
 support corresponds to ``S`` values in the ``MAINTAINERS`` file.
 
-============  ================  ==============================================
-Architecture  Level of support  Constraints
-============  ================  ==============================================
-``um``        Maintained        ``x86_64`` only.
-``x86``       Maintained        ``x86_64`` only.
-============  ================  ==============================================
+=============  ================  ==============================================
+Architecture   Level of support  Constraints
+=============  ================  ==============================================
+``um``         Maintained        ``x86_64`` only.
+``x86``        Maintained        ``x86_64`` only.
+=============  ================  ==============================================
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v1 2/2] LoongArch: Enable initial Rust support
  2024-01-08  3:21 [PATCH v1 0/2] Rust enablement for LoongArch WANG Rui
  2024-01-08  3:21 ` [PATCH v1 1/2] Documentation: rust: Add a character to the first column WANG Rui
@ 2024-01-08  3:21 ` WANG Rui
  2024-01-08  4:23 ` [PATCH v1 0/2] Rust enablement for LoongArch Huacai Chen
  2024-01-09 19:33 ` Boqun Feng
  3 siblings, 0 replies; 17+ messages in thread
From: WANG Rui @ 2024-01-08  3:21 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Huacai Chen,
	Jonathan Corbet
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, WANG Xuerui, rust-for-linux,
	linux-kernel, loongarch, linux-doc, loongson-kernel, WANG Rui

Add initial Rust support for LoongArch.

Signed-off-by: WANG Rui <wangrui@loongson.cn>
---
 Documentation/rust/arch-support.rst |  1 +
 arch/loongarch/Kconfig              |  1 +
 arch/loongarch/Makefile             |  3 +++
 scripts/generate_rust_target.rs     | 10 ++++++++++
 4 files changed, 15 insertions(+)

diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-support.rst
index 14875a2e073a..73203ba1e901 100644
--- a/Documentation/rust/arch-support.rst
+++ b/Documentation/rust/arch-support.rst
@@ -15,6 +15,7 @@ support corresponds to ``S`` values in the ``MAINTAINERS`` file.
 =============  ================  ==============================================
 Architecture   Level of support  Constraints
 =============  ================  ==============================================
+``loongarch``  Maintained        -
 ``um``         Maintained        ``x86_64`` only.
 ``x86``        Maintained        ``x86_64`` only.
 =============  ================  ==============================================
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index 15d05dd2b7f3..6d39ec3077da 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -142,6 +142,7 @@ config LOONGARCH
 	select HAVE_REGS_AND_STACK_ACCESS_API
 	select HAVE_RETHOOK
 	select HAVE_RSEQ
+	select HAVE_RUST
 	select HAVE_SAMPLE_FTRACE_DIRECT
 	select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
 	select HAVE_SETUP_PER_CPU_AREA if NUMA
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index 4ba8d67ddb09..ba45cb7b621c 100644
--- a/arch/loongarch/Makefile
+++ b/arch/loongarch/Makefile
@@ -81,8 +81,11 @@ KBUILD_AFLAGS_MODULE		+= -Wa,-mla-global-with-abs
 KBUILD_CFLAGS_MODULE		+= -fplt -Wa,-mla-global-with-abs,-mla-local-with-abs
 endif
 
+KBUILD_RUSTFLAGS_MODULE		+= -Crelocation-model=pic
+
 ifeq ($(CONFIG_RELOCATABLE),y)
 KBUILD_CFLAGS_KERNEL		+= -fPIE
+KBUILD_RUSTFLAGS_KERNEL		+= -Crelocation-model=pie
 LDFLAGS_vmlinux			+= -static -pie --no-dynamic-linker -z notext $(call ld-option, --apply-dynamic-relocs)
 endif
 
diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
index 3c6cbe2b278d..3edda6a10dd0 100644
--- a/scripts/generate_rust_target.rs
+++ b/scripts/generate_rust_target.rs
@@ -161,6 +161,16 @@ fn main() {
         ts.push("features", features);
         ts.push("llvm-target", "x86_64-linux-gnu");
         ts.push("target-pointer-width", "64");
+    } else if cfg.has("LOONGARCH") {
+        ts.push("arch", "loongarch64");
+        ts.push(
+            "data-layout",
+            "e-m:e-p:64:64-i64:64-i128:128-n64-S128",
+        );
+        ts.push("features", "-f,-d");
+        ts.push("llvm-target", "loongarch64-linux-gnusf");
+        ts.push("llvm-abiname", "lp64s");
+        ts.push("target-pointer-width", "64");
     } else {
         panic!("Unsupported architecture");
     }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-08  3:21 [PATCH v1 0/2] Rust enablement for LoongArch WANG Rui
  2024-01-08  3:21 ` [PATCH v1 1/2] Documentation: rust: Add a character to the first column WANG Rui
  2024-01-08  3:21 ` [PATCH v1 2/2] LoongArch: Enable initial Rust support WANG Rui
@ 2024-01-08  4:23 ` Huacai Chen
  2024-01-09  9:54   ` Huacai Chen
  2024-01-09 19:33 ` Boqun Feng
  3 siblings, 1 reply; 17+ messages in thread
From: Huacai Chen @ 2024-01-08  4:23 UTC (permalink / raw)
  To: WANG Rui
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Jonathan Corbet,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, WANG Xuerui, rust-for-linux,
	linux-kernel, loongarch, linux-doc, loongson-kernel

No need to split patches.

Huacai

On Mon, Jan 8, 2024 at 11:21 AM WANG Rui <wangrui@loongson.cn> wrote:
>
> Enable Rust support for the LoongArch architecture.
>
> Previous versions:
> v0: https://lore.kernel.org/loongarch/20240106065941.180796-1-wangrui@loongson.cn/
>
> Changes in v1:
>  - Address htmldocs warning.
>
> WANG Rui (2):
>   Documentation: rust: Add a character to the first column
>   LoongArch: Enable initial Rust support
>
>  Documentation/rust/arch-support.rst | 13 +++++++------
>  arch/loongarch/Kconfig              |  1 +
>  arch/loongarch/Makefile             |  3 +++
>  scripts/generate_rust_target.rs     | 10 ++++++++++
>  4 files changed, 21 insertions(+), 6 deletions(-)
>
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-08  4:23 ` [PATCH v1 0/2] Rust enablement for LoongArch Huacai Chen
@ 2024-01-09  9:54   ` Huacai Chen
  0 siblings, 0 replies; 17+ messages in thread
From: Huacai Chen @ 2024-01-09  9:54 UTC (permalink / raw)
  To: WANG Rui
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Jonathan Corbet,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, WANG Xuerui, rust-for-linux,
	linux-kernel, loongarch, linux-doc, loongson-kernel

Squashed and applied, thanks.

Huacai

On Mon, Jan 8, 2024 at 12:23 PM Huacai Chen <chenhuacai@kernel.org> wrote:
>
> No need to split patches.
>
> Huacai
>
> On Mon, Jan 8, 2024 at 11:21 AM WANG Rui <wangrui@loongson.cn> wrote:
> >
> > Enable Rust support for the LoongArch architecture.
> >
> > Previous versions:
> > v0: https://lore.kernel.org/loongarch/20240106065941.180796-1-wangrui@loongson.cn/
> >
> > Changes in v1:
> >  - Address htmldocs warning.
> >
> > WANG Rui (2):
> >   Documentation: rust: Add a character to the first column
> >   LoongArch: Enable initial Rust support
> >
> >  Documentation/rust/arch-support.rst | 13 +++++++------
> >  arch/loongarch/Kconfig              |  1 +
> >  arch/loongarch/Makefile             |  3 +++
> >  scripts/generate_rust_target.rs     | 10 ++++++++++
> >  4 files changed, 21 insertions(+), 6 deletions(-)
> >
> > --
> > 2.43.0
> >

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-08  3:21 [PATCH v1 0/2] Rust enablement for LoongArch WANG Rui
                   ` (2 preceding siblings ...)
  2024-01-08  4:23 ` [PATCH v1 0/2] Rust enablement for LoongArch Huacai Chen
@ 2024-01-09 19:33 ` Boqun Feng
  2024-01-10  1:41   ` WANG Rui
  3 siblings, 1 reply; 17+ messages in thread
From: Boqun Feng @ 2024-01-09 19:33 UTC (permalink / raw)
  To: WANG Rui
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Huacai Chen,
	Jonathan Corbet, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, WANG Xuerui, rust-for-linux,
	linux-kernel, loongarch, linux-doc, loongson-kernel

Hi,

Thanks for the patch.

On Mon, Jan 08, 2024 at 11:21:15AM +0800, WANG Rui wrote:
> Enable Rust support for the LoongArch architecture.
> 

Could you share how you build and test? For example, I wonder the clang
or gcc version you used and bindgen version you used. Thanks.

Regards,
Boqun

> Previous versions:
> v0: https://lore.kernel.org/loongarch/20240106065941.180796-1-wangrui@loongson.cn/
> 
> Changes in v1:
>  - Address htmldocs warning.
> 
> WANG Rui (2):
>   Documentation: rust: Add a character to the first column
>   LoongArch: Enable initial Rust support
> 
>  Documentation/rust/arch-support.rst | 13 +++++++------
>  arch/loongarch/Kconfig              |  1 +
>  arch/loongarch/Makefile             |  3 +++
>  scripts/generate_rust_target.rs     | 10 ++++++++++
>  4 files changed, 21 insertions(+), 6 deletions(-)
> 
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-09 19:33 ` Boqun Feng
@ 2024-01-10  1:41   ` WANG Rui
  2024-01-10  2:09     ` Boqun Feng
  0 siblings, 1 reply; 17+ messages in thread
From: WANG Rui @ 2024-01-10  1:41 UTC (permalink / raw)
  To: Boqun Feng
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Huacai Chen,
	Jonathan Corbet, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, WANG Xuerui, rust-for-linux,
	linux-kernel, loongarch, linux-doc, loongson-kernel

Hi Boqun,

On Wed, Jan 10, 2024 at 3:35 AM Boqun Feng <boqun.feng@gmail.com> wrote:
>
> Hi,
>
> Thanks for the patch.
>
> On Mon, Jan 08, 2024 at 11:21:15AM +0800, WANG Rui wrote:
> > Enable Rust support for the LoongArch architecture.
> >
>
> Could you share how you build and test? For example, I wonder the clang
> or gcc version you used and bindgen version you used. Thanks.

You are welcome! The versions I'm using are listed in
scripts/min-tool-version.sh, and I have tested Rust samples and the
rnull block driver.

llvm: main branch (ea3c7b3397f8de8e885ea7cd1ed5138ec4a72d50)
rustc: 1.74.1
bindgen: 0.65.1

Here are the build steps:

1. Build llvm
2. Install rust, rust-src (using rustup) and bindgen
3. Build kernel

For more details, refer to Documentation/rust/quick-start.rst; there
is nothing special about it.

Regards,
Rui

>
> Regards,
> Boqun
>
> > Previous versions:
> > v0: https://lore.kernel.org/loongarch/20240106065941.180796-1-wangrui@loongson.cn/
> >
> > Changes in v1:
> >  - Address htmldocs warning.
> >
> > WANG Rui (2):
> >   Documentation: rust: Add a character to the first column
> >   LoongArch: Enable initial Rust support
> >
> >  Documentation/rust/arch-support.rst | 13 +++++++------
> >  arch/loongarch/Kconfig              |  1 +
> >  arch/loongarch/Makefile             |  3 +++
> >  scripts/generate_rust_target.rs     | 10 ++++++++++
> >  4 files changed, 21 insertions(+), 6 deletions(-)
> >
> > --
> > 2.43.0
> >
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-10  1:41   ` WANG Rui
@ 2024-01-10  2:09     ` Boqun Feng
  2024-01-10  2:29       ` WANG Rui
  0 siblings, 1 reply; 17+ messages in thread
From: Boqun Feng @ 2024-01-10  2:09 UTC (permalink / raw)
  To: WANG Rui
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Huacai Chen,
	Jonathan Corbet, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, WANG Xuerui, rust-for-linux,
	linux-kernel, loongarch, linux-doc, loongson-kernel

On Wed, Jan 10, 2024 at 09:41:38AM +0800, WANG Rui wrote:
> Hi Boqun,
> 
> On Wed, Jan 10, 2024 at 3:35 AM Boqun Feng <boqun.feng@gmail.com> wrote:
> >
> > Hi,
> >
> > Thanks for the patch.
> >
> > On Mon, Jan 08, 2024 at 11:21:15AM +0800, WANG Rui wrote:
> > > Enable Rust support for the LoongArch architecture.
> > >
> >
> > Could you share how you build and test? For example, I wonder the clang
> > or gcc version you used and bindgen version you used. Thanks.
> 
> You are welcome! The versions I'm using are listed in
> scripts/min-tool-version.sh, and I have tested Rust samples and the
> rnull block driver.
> 
> llvm: main branch (ea3c7b3397f8de8e885ea7cd1ed5138ec4a72d50)

This means the LLVM support is yet to release? Or does LLVM 17 also
work?

Regards,
Boqun

> rustc: 1.74.1
> bindgen: 0.65.1
> 
> Here are the build steps:
> 
> 1. Build llvm
> 2. Install rust, rust-src (using rustup) and bindgen
> 3. Build kernel
> 
> For more details, refer to Documentation/rust/quick-start.rst; there
> is nothing special about it.
> 
> Regards,
> Rui
> 
> >
> > Regards,
> > Boqun
> >
> > > Previous versions:
> > > v0: https://lore.kernel.org/loongarch/20240106065941.180796-1-wangrui@loongson.cn/
> > >
> > > Changes in v1:
> > >  - Address htmldocs warning.
> > >
> > > WANG Rui (2):
> > >   Documentation: rust: Add a character to the first column
> > >   LoongArch: Enable initial Rust support
> > >
> > >  Documentation/rust/arch-support.rst | 13 +++++++------
> > >  arch/loongarch/Kconfig              |  1 +
> > >  arch/loongarch/Makefile             |  3 +++
> > >  scripts/generate_rust_target.rs     | 10 ++++++++++
> > >  4 files changed, 21 insertions(+), 6 deletions(-)
> > >
> > > --
> > > 2.43.0
> > >
> >
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-10  2:09     ` Boqun Feng
@ 2024-01-10  2:29       ` WANG Rui
  2024-01-10 10:49         ` Miguel Ojeda
  0 siblings, 1 reply; 17+ messages in thread
From: WANG Rui @ 2024-01-10  2:29 UTC (permalink / raw)
  To: Boqun Feng
  Cc: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Huacai Chen,
	Jonathan Corbet, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, WANG Xuerui, rust-for-linux,
	linux-kernel, loongarch, linux-doc, loongson-kernel

On Wed, Jan 10, 2024 at 10:09 AM Boqun Feng <boqun.feng@gmail.com> wrote:
>
> On Wed, Jan 10, 2024 at 09:41:38AM +0800, WANG Rui wrote:
> > Hi Boqun,
> >
> > On Wed, Jan 10, 2024 at 3:35 AM Boqun Feng <boqun.feng@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > Thanks for the patch.
> > >
> > > On Mon, Jan 08, 2024 at 11:21:15AM +0800, WANG Rui wrote:
> > > > Enable Rust support for the LoongArch architecture.
> > > >
> > >
> > > Could you share how you build and test? For example, I wonder the clang
> > > or gcc version you used and bindgen version you used. Thanks.
> >
> > You are welcome! The versions I'm using are listed in
> > scripts/min-tool-version.sh, and I have tested Rust samples and the
> > rnull block driver.
> >
> > llvm: main branch (ea3c7b3397f8de8e885ea7cd1ed5138ec4a72d50)
>
> This means the LLVM support is yet to release? Or does LLVM 17 also
> work?

LLVM 17 doesn't work. The minimum LLVM version required for LoongArch
is 18.0.0. This is the reason why we have updated the
scripts/min-tool-version.sh. [1]

[1] https://lore.kernel.org/loongarch/20240108033138.217032-1-wangrui@loongson.cn/

Regards,
Rui

>
> Regards,
> Boqun
>
> > rustc: 1.74.1
> > bindgen: 0.65.1
> >
> > Here are the build steps:
> >
> > 1. Build llvm
> > 2. Install rust, rust-src (using rustup) and bindgen
> > 3. Build kernel
> >
> > For more details, refer to Documentation/rust/quick-start.rst; there
> > is nothing special about it.
> >
> > Regards,
> > Rui
> >
> > >
> > > Regards,
> > > Boqun
> > >
> > > > Previous versions:
> > > > v0: https://lore.kernel.org/loongarch/20240106065941.180796-1-wangrui@loongson.cn/
> > > >
> > > > Changes in v1:
> > > >  - Address htmldocs warning.
> > > >
> > > > WANG Rui (2):
> > > >   Documentation: rust: Add a character to the first column
> > > >   LoongArch: Enable initial Rust support
> > > >
> > > >  Documentation/rust/arch-support.rst | 13 +++++++------
> > > >  arch/loongarch/Kconfig              |  1 +
> > > >  arch/loongarch/Makefile             |  3 +++
> > > >  scripts/generate_rust_target.rs     | 10 ++++++++++
> > > >  4 files changed, 21 insertions(+), 6 deletions(-)
> > > >
> > > > --
> > > > 2.43.0
> > > >
> > >
> >
>


-- 
WANG Rui


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-10  2:29       ` WANG Rui
@ 2024-01-10 10:49         ` Miguel Ojeda
  2024-01-11  3:16           ` WANG Rui
  0 siblings, 1 reply; 17+ messages in thread
From: Miguel Ojeda @ 2024-01-10 10:49 UTC (permalink / raw)
  To: WANG Rui
  Cc: Boqun Feng, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
	Huacai Chen, Jonathan Corbet, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, WANG Xuerui,
	rust-for-linux, linux-kernel, loongarch, linux-doc,
	loongson-kernel

On Wed, Jan 10, 2024 at 3:49 AM WANG Rui <wangrui@loongson.cn> wrote:
>
> LLVM 17 doesn't work. The minimum LLVM version required for LoongArch
> is 18.0.0. This is the reason why we have updated the
> scripts/min-tool-version.sh. [1]
>
> [1] https://lore.kernel.org/loongarch/20240108033138.217032-1-wangrui@loongson.cn/

Thanks! Is this targeted at 6.9?

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-10 10:49         ` Miguel Ojeda
@ 2024-01-11  3:16           ` WANG Rui
  2024-01-14 15:43             ` Miguel Ojeda
  0 siblings, 1 reply; 17+ messages in thread
From: WANG Rui @ 2024-01-11  3:16 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Boqun Feng, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
	Huacai Chen, Jonathan Corbet, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, WANG Xuerui,
	rust-for-linux, linux-kernel, loongarch, linux-doc,
	loongson-kernel

On Wed, Jan 10, 2024 at 6:50 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Wed, Jan 10, 2024 at 3:49 AM WANG Rui <wangrui@loongson.cn> wrote:
> >
> > LLVM 17 doesn't work. The minimum LLVM version required for LoongArch
> > is 18.0.0. This is the reason why we have updated the
> > scripts/min-tool-version.sh. [1]
> >
> > [1] https://lore.kernel.org/loongarch/20240108033138.217032-1-wangrui@loongson.cn/
>
> Thanks! Is this targeted at 6.9?

6.8

Regards,
Rui

>
> Cheers,
> Miguel
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-11  3:16           ` WANG Rui
@ 2024-01-14 15:43             ` Miguel Ojeda
  2024-01-15  3:23               ` Huacai Chen
  0 siblings, 1 reply; 17+ messages in thread
From: Miguel Ojeda @ 2024-01-14 15:43 UTC (permalink / raw)
  To: WANG Rui
  Cc: Boqun Feng, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
	Huacai Chen, Jonathan Corbet, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, WANG Xuerui,
	rust-for-linux, linux-kernel, loongarch, linux-doc,
	loongson-kernel

On Thu, Jan 11, 2024 at 4:16 AM WANG Rui <wangrui@loongson.cn> wrote:
>
> 6.8

Thanks, that is quite expedited...

Please `rustfmt` the code to avoid failing the `rustfmtcheck` target.
I see you already created the 6.8 tag but I have not seen it in
linux-next yet and you did not send the PR, so it would be ideal if
you could fix this before it goes to Linus.

diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
index 3edda6a10..0da52b548 100644
--- a/scripts/generate_rust_target.rs
+++ b/scripts/generate_rust_target.rs
@@ -163,10 +163,7 @@ fn main() {
         ts.push("target-pointer-width", "64");
     } else if cfg.has("LOONGARCH") {
         ts.push("arch", "loongarch64");
-        ts.push(
-            "data-layout",
-            "e-m:e-p:64:64-i64:64-i128:128-n64-S128",
-        );
+        ts.push("data-layout", "e-m:e-p:64:64-i64:64-i128:128-n64-S128");
         ts.push("features", "-f,-d");
         ts.push("llvm-target", "loongarch64-linux-gnusf");
         ts.push("llvm-abiname", "lp64s");

Thanks!

Cheers,
Miguel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-14 15:43             ` Miguel Ojeda
@ 2024-01-15  3:23               ` Huacai Chen
  2024-01-15 16:08                 ` Miguel Ojeda
  0 siblings, 1 reply; 17+ messages in thread
From: Huacai Chen @ 2024-01-15  3:23 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: WANG Rui, Boqun Feng, Miguel Ojeda, Alex Gaynor,
	Wedson Almeida Filho, Jonathan Corbet, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	WANG Xuerui, rust-for-linux, linux-kernel, loongarch, linux-doc,
	loongson-kernel

Hi, Miguel,

On Sun, Jan 14, 2024 at 11:44 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Thu, Jan 11, 2024 at 4:16 AM WANG Rui <wangrui@loongson.cn> wrote:
> >
> > 6.8
>
> Thanks, that is quite expedited...
>
> Please `rustfmt` the code to avoid failing the `rustfmtcheck` target.
> I see you already created the 6.8 tag but I have not seen it in
> linux-next yet and you did not send the PR, so it would be ideal if
> you could fix this before it goes to Linus.
>
> diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
> index 3edda6a10..0da52b548 100644
> --- a/scripts/generate_rust_target.rs
> +++ b/scripts/generate_rust_target.rs
> @@ -163,10 +163,7 @@ fn main() {
>          ts.push("target-pointer-width", "64");
>      } else if cfg.has("LOONGARCH") {
>          ts.push("arch", "loongarch64");
> -        ts.push(
> -            "data-layout",
> -            "e-m:e-p:64:64-i64:64-i128:128-n64-S128",
> -        );
> +        ts.push("data-layout", "e-m:e-p:64:64-i64:64-i128:128-n64-S128");
>          ts.push("features", "-f,-d");
>          ts.push("llvm-target", "loongarch64-linux-gnusf");
>          ts.push("llvm-abiname", "lp64s");
>
> Thanks!
Thank you for your suggestion, but since this will be replaced by the
built-in target soon, and I don't want to change the tag to make Linus
unhappy. Let's leave it as is.

Huacai

>
> Cheers,
> Miguel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-15  3:23               ` Huacai Chen
@ 2024-01-15 16:08                 ` Miguel Ojeda
  2024-01-16  9:31                   ` Huacai Chen
  0 siblings, 1 reply; 17+ messages in thread
From: Miguel Ojeda @ 2024-01-15 16:08 UTC (permalink / raw)
  To: Huacai Chen
  Cc: WANG Rui, Boqun Feng, Miguel Ojeda, Alex Gaynor,
	Wedson Almeida Filho, Jonathan Corbet, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	WANG Xuerui, rust-for-linux, linux-kernel, loongarch, linux-doc,
	loongson-kernel

On Mon, Jan 15, 2024 at 4:23 AM Huacai Chen <chenhuacai@kernel.org> wrote:
>
> Thank you for your suggestion, but since this will be replaced by the
> built-in target soon, and I don't want to change the tag to make Linus
> unhappy. Let's leave it as is.

The issue is not a big deal and I appreciate that you made the effort
to enable Rust for your architecture. However, please note that we do
our best to maintain a clean formatting state for Rust code (i.e.
`rustfmt` should be run) and that people may see this in tests/CIs
that use the Make target.

I don't think Linus would mind too much, and you could point him to
this email if you want (or you could put the fix on top); but if you
really want to keep the tag as-is, then we should consider it as a fix
for this cycle, i.e. we should not wait for e.g. the next cycle for
the built-in target. Could you please send it through your tree as
soon as possible?

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-15 16:08                 ` Miguel Ojeda
@ 2024-01-16  9:31                   ` Huacai Chen
  2024-01-16 15:15                     ` Miguel Ojeda
  0 siblings, 1 reply; 17+ messages in thread
From: Huacai Chen @ 2024-01-16  9:31 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: WANG Rui, Boqun Feng, Miguel Ojeda, Alex Gaynor,
	Wedson Almeida Filho, Jonathan Corbet, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	WANG Xuerui, rust-for-linux, linux-kernel, loongarch, linux-doc,
	loongson-kernel

Hi, Miguel,

On Tue, Jan 16, 2024 at 12:08 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Mon, Jan 15, 2024 at 4:23 AM Huacai Chen <chenhuacai@kernel.org> wrote:
> >
> > Thank you for your suggestion, but since this will be replaced by the
> > built-in target soon, and I don't want to change the tag to make Linus
> > unhappy. Let's leave it as is.
>
> The issue is not a big deal and I appreciate that you made the effort
> to enable Rust for your architecture. However, please note that we do
> our best to maintain a clean formatting state for Rust code (i.e.
> `rustfmt` should be run) and that people may see this in tests/CIs
> that use the Make target.
>
> I don't think Linus would mind too much, and you could point him to
> this email if you want (or you could put the fix on top); but if you
> really want to keep the tag as-is, then we should consider it as a fix
> for this cycle, i.e. we should not wait for e.g. the next cycle for
> the built-in target. Could you please send it through your tree as
> soon as possible?
OK, since Linus said the merge window is paused now, I rebase and
retag my tree and the Rust commit is like this, I think this is
perfect now?

https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/commit/?h=loongarch-next&id=706f9e1ab7c7a58d80ef2c87d8720131253a2256

Huacai

>
> Cheers,
> Miguel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-16  9:31                   ` Huacai Chen
@ 2024-01-16 15:15                     ` Miguel Ojeda
  2024-01-17  4:34                       ` Huacai Chen
  0 siblings, 1 reply; 17+ messages in thread
From: Miguel Ojeda @ 2024-01-16 15:15 UTC (permalink / raw)
  To: Huacai Chen
  Cc: WANG Rui, Boqun Feng, Miguel Ojeda, Alex Gaynor,
	Wedson Almeida Filho, Jonathan Corbet, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	WANG Xuerui, rust-for-linux, linux-kernel, loongarch, linux-doc,
	loongson-kernel

On Tue, Jan 16, 2024 at 10:31 AM Huacai Chen <chenhuacai@kernel.org> wrote:
>
> OK, since Linus said the merge window is paused now, I rebase and
> retag my tree and the Rust commit is like this, I think this is
> perfect now?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/commit/?h=loongarch-next&id=706f9e1ab7c7a58d80ef2c87d8720131253a2256

Thanks a lot! That works, yeah.

I also took the chance to build LLVM and QEMU and I tested the tag --
it seems to work: I see the samples (built-in) printing in the kernel
log :)

So in case you end up rebasing for another reason and want to add it,
even if it is a simple check I did:

Tested-by: Miguel Ojeda <ojeda@kernel.org>

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v1 0/2] Rust enablement for LoongArch
  2024-01-16 15:15                     ` Miguel Ojeda
@ 2024-01-17  4:34                       ` Huacai Chen
  0 siblings, 0 replies; 17+ messages in thread
From: Huacai Chen @ 2024-01-17  4:34 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: WANG Rui, Boqun Feng, Miguel Ojeda, Alex Gaynor,
	Wedson Almeida Filho, Jonathan Corbet, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	WANG Xuerui, rust-for-linux, linux-kernel, loongarch, linux-doc,
	loongson-kernel

Hi, Miguel,

On Tue, Jan 16, 2024 at 11:16 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Tue, Jan 16, 2024 at 10:31 AM Huacai Chen <chenhuacai@kernel.org> wrote:
> >
> > OK, since Linus said the merge window is paused now, I rebase and
> > retag my tree and the Rust commit is like this, I think this is
> > perfect now?
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/commit/?h=loongarch-next&id=706f9e1ab7c7a58d80ef2c87d8720131253a2256
>
> Thanks a lot! That works, yeah.
>
> I also took the chance to build LLVM and QEMU and I tested the tag --
> it seems to work: I see the samples (built-in) printing in the kernel
> log :)
>
> So in case you end up rebasing for another reason and want to add it,
> even if it is a simple check I did:
>
> Tested-by: Miguel Ojeda <ojeda@kernel.org>
OK, if Xuerui updates this patch, then I will rebase again.
https://lore.kernel.org/loongarch/CAAhV-H7KteJvRVpj3Hz-Ui9VnmijcJq5D1Tb-KJvqTO_+jjp2Q@mail.gmail.com/T/#t

Huacai

>
> Cheers,
> Miguel

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-01-17  4:34 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-08  3:21 [PATCH v1 0/2] Rust enablement for LoongArch WANG Rui
2024-01-08  3:21 ` [PATCH v1 1/2] Documentation: rust: Add a character to the first column WANG Rui
2024-01-08  3:21 ` [PATCH v1 2/2] LoongArch: Enable initial Rust support WANG Rui
2024-01-08  4:23 ` [PATCH v1 0/2] Rust enablement for LoongArch Huacai Chen
2024-01-09  9:54   ` Huacai Chen
2024-01-09 19:33 ` Boqun Feng
2024-01-10  1:41   ` WANG Rui
2024-01-10  2:09     ` Boqun Feng
2024-01-10  2:29       ` WANG Rui
2024-01-10 10:49         ` Miguel Ojeda
2024-01-11  3:16           ` WANG Rui
2024-01-14 15:43             ` Miguel Ojeda
2024-01-15  3:23               ` Huacai Chen
2024-01-15 16:08                 ` Miguel Ojeda
2024-01-16  9:31                   ` Huacai Chen
2024-01-16 15:15                     ` Miguel Ojeda
2024-01-17  4:34                       ` Huacai Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).