lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f8b59f05-55b5-4208-8bdf-b4be8e93bc22@gmail.com>
Date: Fri, 31 Jan 2025 16:34:08 +0100
From: Christian Schrefl <chrisi.schrefl@...il.com>
To: Arnd Bergmann <arnd@...db.de>, Miguel Ojeda <ojeda@...nel.org>,
 Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>,
 Gary Guo <gary@...yguo.net>, Björn Roy Baron
 <bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>,
 Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
 Trevor Gross <tmgross@...ch.edu>, Jonathan Corbet <corbet@....net>,
 Russell King <linux@...linux.org.uk>, Rudraksha Gupta <guptarud@...il.com>,
 Ard Biesheuvel <ardb@...nel.org>, Geert Stappers <stappers@...ppers.nl>,
 Andrew Lunn <andrew@...n.ch>, Jamie Cunliffe <Jamie.Cunliffe@....com>,
 Sven Van Asbroeck <thesven73@...il.com>
Cc: rust-for-linux@...r.kernel.org, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3] arm: rust: Enable Rust support for ARMv7



On 31.01.25 8:40 AM, Arnd Bergmann wrote:
> On Thu, Jan 23, 2025, at 23:40, Christian Schrefl wrote:
>> This commit allows building ARMv7 kernels with Rust support.
>>
>> The rust core library expects some __eabi_... functions
>> that are not implemented in the kernel.
>> Those functions are some float operations and __aeabi_uldivmod.
>> For now those are implemented with define_panicking_intrinsics!.
> 
> I see you are doing this part the same as the other architectures,
> but I don't see why it's done like this in the first place:
> 
> In C code, we really want to get a link failure rather than a
> runtime error in order to catch those bugs as early as possible
> and fix them before even trying to run the kernel. Is there a
> reason this doesn't work in rust, or is there a plan to change
> this later when the existing callers of those functions have
> been fixed?

I agree having a linker error instead of a runtime panic would
be ideal, but it is currently impossible to build without these
intrinsics.

To fix this Rust would have to provide a way to build the core
library without float support. I don't know if there is a plan
already to allow this.

> 
> 202397be76d8037b531b34dee16c7dfcfd0124ef..3375c91e698c024f95a85682f5a91d9815c355e5 
>> 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -130,6 +130,7 @@ config ARM
>>  	select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE
>>  	select HAVE_REGS_AND_STACK_ACCESS_API
>>  	select HAVE_RSEQ
>> +	select HAVE_RUST if CPU_LITTLE_ENDIAN && CPU_32v7
> 
> The ARMv7 dependency makes sense, but I think it needs
> be disabled on combined v6/v7 kernels, like (CPU_V7 && !CPU_V6 && !CPU_V6K).

That might be correct, I don't know much about the build
system for the kernel. I've tried it and it still builds
with this change.

Also it should probably be relatively easy to support 
armv6 as well.

Cheers
Christian


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ