[PATCH 3/3] rust: arch/um: Add support for CONFIG_RUST under x86_64 UML

2022-12-16 Thread David Gow
CONFIG_RUST currently supports x86_64, but does not support it under UML. With the previous patches applied, adding support is trivial: add CONFIG_HAVE_RUST to UML if X86_64 is set. The scripts/generate_rust_target.rs file already checks for CONFIG_X86_64, not CONFIG_X86, so is prepared for UML su

[PATCH 0/3] rust: arch/um: Rust support for UML

2022-12-16 Thread David Gow
This series adds support for building and running code in the Rust programming language under x86_64 UML kernels. It is based on two Pull Requests from the Rust-for-Linux GitHub page: - https://github.com/Rust-for-Linux/linux/pull/766 - https://github.com/Rust-for-Linux/linux/pull/881 The series

[PATCH 2/3] rust: arch/um: Disable FP/SIMD instruction to match x86

2022-12-16 Thread David Gow
The kernel disables all SSE and similar FP/SIMD instructions on x86-based architectures (partly because we shouldn't be using floats in the kernel, and partly to avoid the need for stack alignment, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 ) UML does not do the same thing, which isn'

[PATCH 1/3] rust: arch/um: Use 'pie' relocation mode under UML

2022-12-16 Thread David Gow
UML expects a position independent executable for some reason, so tell rustc to generate pie objects. Otherwise we get a bunch of relocations we can't deal with in libcore. Signed-off-by: David Gow --- arch/um/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/um/Makefile b/arch