linux/arch
David Gow ab0f4cedc3 arch: um: rust: Add i386 support for Rust
At present, Rust in the kernel only supports 64-bit x86, so UML has
followed suit. However, it's significantly easier to support 32-bit i386
on UML than on bare metal, as UML does not use the -mregparm option
(which alters the ABI), which is not yet supported by rustc[1].

Add support for CONFIG_RUST on um/i386, by adding a new target config to
generate_rust_target, and replacing various checks on CONFIG_X86_64 to
also support CONFIG_X86_32.

We still use generate_rust_target, rather than a built-in rustc target,
in order to match x86_64, provide a future place for -mregparm, and more
easily disable floating point instructions.

With these changes, the KUnit tests pass with:
kunit.py run --make_options LLVM=1 --kconfig_add CONFIG_RUST=y
--kconfig_add CONFIG_64BIT=n --kconfig_add CONFIG_FORTIFY_SOURCE=n

An earlier version of these changes was proposed on the Rust-for-Linux
github[2].

[1]: https://github.com/rust-lang/rust/issues/116972
[2]: https://github.com/Rust-for-Linux/linux/pull/966

Signed-off-by: David Gow <davidgow@google.com>
Link: https://patch.msgid.link/20240604224052.3138504-1-davidgow@google.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-07-03 12:22:22 +02:00
..
alpha mseal: wire up mseal syscall 2024-05-23 19:40:26 -07:00
arc bpf-for-netdev 2024-05-27 16:26:30 -07:00
arm SoC fixes for 6.10 2024-06-22 07:58:21 -07:00
arm64 hardening fixes for v6.10-rc6 2024-06-28 16:11:02 -07:00
csky syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-06-25 15:57:37 +02:00
loongarch syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
m68k mseal: wire up mseal syscall 2024-05-23 19:40:26 -07:00
microblaze syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
mips syscalls: fix compat_sys_io_pgetevents_time64 usage 2024-06-25 15:57:20 +02:00
nios2 Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
openrisc openrisc: Move FPU state out of pt_regs 2024-04-15 15:20:39 +01:00
parisc parisc: use generic sys_fanotify_mark implementation 2024-06-25 15:57:25 +02:00
powerpc powerpc: restore some missing spu syscalls 2024-06-25 15:57:26 +02:00
riscv RISC-V Fixes for 6.10-rc6 2024-06-28 16:14:59 -07:00
s390 hardening fixes for v6.10-rc6 2024-06-28 16:11:02 -07:00
sh sh: rework sync_file_range ABI 2024-06-25 15:57:26 +02:00
sparc sparc: fix compat recv/recvfrom syscalls 2024-06-25 15:57:25 +02:00
um arch: um: rust: Add i386 support for Rust 2024-07-03 12:22:22 +02:00
x86 arch: um: rust: Use the generated target.json again 2024-07-03 12:22:11 +02:00
xtensa mseal: wire up mseal syscall 2024-05-23 19:40:26 -07:00
.gitignore
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-17 12:57:03 -07:00