From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E31382BD0D; Wed, 5 Jun 2024 06:22:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717568558; cv=none; b=RxRnC80TZWtbxsqm1HNLAjWYtBBQLRbipviitObd/WfjpOxExbUGLzWuk/wJoc8e6Ky76HPN7bh8k67RY4k1RZrbXzOmcoi/cWTzQjGGILsuq+mD0LxYY0rXoQMrctxUrd6gJo0FmafVRlwPu4g29+u9gctVJfE/5TsJjx8Snno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717568558; c=relaxed/simple; bh=22vGbdo3lcoqgtt6iTgodLgKpeC1H2mmwljTBZUWyNs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tMuN1kz4ll1SetiPdPh6FX5r5p+PyJBiAVafdw+187Wp2vWeUYuGoczpGapmohek+KfsJZXAiyVUOR4oHejZNo60Dz6FJfaruGgrOKWP9rg7Zink3hqC6Q4f5Y80ZsXObz7YCHQFYJBdFQLpJ588Lwadw9uM9yt6QsZpN14xfPI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LuiuKYoV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LuiuKYoV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFA3CC3277B; Wed, 5 Jun 2024 06:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717568557; bh=22vGbdo3lcoqgtt6iTgodLgKpeC1H2mmwljTBZUWyNs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LuiuKYoVXSbCm1Dbvh0V60xcmtNnwomS1+agdGXYtSH5RlrxJbcdXsIy1lqp5wItG JJyN5q3EzSLIvKCXaYZzkbTVItVxMxvBWyqXCcRFhXNDfq7MFeCHslkWNW9Sao3nLj jNn/BbgErH5YpRHQIJ3pAF94KPw8WHbwel+G3StODSKyFX38S4hfpQC6O5crO6uFn8 b6xfpTP1idOJvxSjt5esKEXWgS7Hk6s2UujbwBliTpEhdDIoHyLKAaQWyJYJKAFx9E mbEcmRhEGOU/o4xFSZxyQp1k1cqmH7XBpuHaF8vuA25/uRVG0SkaSJOftyk7bgCnxI XFYJoiZO2IcMQ== Date: Tue, 4 Jun 2024 23:22:34 -0700 From: Nathan Chancellor To: David Gow Cc: Brendan Higgins , Rae Moar , Thomas Gleixner , Ingo Molnar , Miguel Ojeda , "H . Peter Anvin" , Masahiro Yamada , Richard Weinberger , Anton Ivanov , Johannes Berg , kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-um@lists.infradead.org, rust-for-linux@vger.kernel.org, x86@kernel.org, Wedson Almeida Filho , Borislav Petkov , Dave Hansen , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] arch: um: rust: Add i386 support for Rust Message-ID: <20240605062234.GE279426@thelio-3990X> References: <20240604224052.3138504-1-davidgow@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240604224052.3138504-1-davidgow@google.com> Hi David, Just a fly by comment on style, I don't have much to say content :) On Wed, Jun 05, 2024 at 06:40:50AM +0800, David Gow wrote: > 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 probably like support CONFIG_X86_32. > > We still use generate_rust_target, rather than a built-in rustc target, > in oPrder 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 ... > -ifdef CONFIG_X86_64 > +ifneq ($(or $(CONFIG_X86_64),$(CONFIG_X86_32)),) These configurations are mutually exclusive, so would it look more readable to have it be: ifeq ($(CONFIG_X86_32)$(CONFIG_X86_64),y) ? Cheers. Nathan