Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp100903lqr; Tue, 4 Jun 2024 23:22:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXLH+ZFfMNfb5jUvTPznYMaAfu8r22QvJBj0oLlMoJkPehchAYYEoaGqe2z8ul4GJwk5NxOsP7Uar+ZRXB47H7mfoN3YoKTfRyD81X+g== X-Google-Smtp-Source: AGHT+IERmSRbZwwAIdc9+YCd+7qwFNsmx4v0lRdXhoMocGJp04/EUA5IH42mJsBQReqigeYhls4o X-Received: by 2002:a05:6870:7247:b0:24f:eada:e1e with SMTP id 586e51a60fabf-25121ff2ee2mr1822144fac.42.1717568568450; Tue, 04 Jun 2024 23:22:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717568568; cv=pass; d=google.com; s=arc-20160816; b=TuUKOafBS1+iO6AluY8UxYHi+EIDTkD5ZQc+5f2yIk1db7bYvCUnffKRtEhnCawlEs wki2K4DEMfvYu4aD4p6WrULuvi993wLR/GBx40dXj1UuzOylJ/dAoSKX/0RqBZWmixi2 HX/IJB3BdTID8xSpYWieQVKBpZcKF444ud6SVUFUVT6LfJwWp/yLDdlqMTEWuodCPD1w kcagor+NWv8vgZn/cpNN3xqziwM64k3vQR8ymkRgznvy3nD/BugkBQTB+x6gVZgcWAKQ D0di4HFhDih+xHtFMIZTNTuWKaMXSP0PJzahtn4RGu5Fsv2EjE+fAolt3xVxNIr62ZdX Ln0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nJm/hiwq3LyM7HzkaXHiUtUL0ydAgPipUMAjXzNNlms=; fh=9aEkJ17X/DS05lLe1UrpvXlJSahAY0Qc93UtyJz27to=; b=J9VP4AIJdsmhZZIdo0cvPdtJ+k72OmgxwnSj7sE1o0gxFEAJsAK4tQkiE5NJ8wWw4/ dDV98U1tCW/wsYt6vWOsKtmGmpH9qA/t9v2A4sKQ+TA/6raNjymHkraI1+Q4K32fVxOw kccmUJ4KgVA599LSLPT72C5xkJ8aztPQvPEFdXrdzQAf04v/r/cY6+32OOzPsFOFi86E ZTYKw5EAu6g43rEv9iKifqEcz7tgcKI2yOD9742btanC5PlTeYKfEYmTiIopYc9frhiI 9KQzVH0DsbhmICYKRBx254Xlt//SaLOmxAfzAZlvj83qQTsaadCGYa9OYOhvtrErcpcU i7gg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LuiuKYoV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201802-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201802-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-70242b0ff5asi9479846b3a.206.2024.06.04.23.22.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 23:22:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201802-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LuiuKYoV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201802-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201802-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F2862282FCF for ; Wed, 5 Jun 2024 06:22:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D074D3DABF4; Wed, 5 Jun 2024 06:22:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LuiuKYoV" 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 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