From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 064F370 for ; Tue, 20 Jul 2021 16:00:22 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C44C6100C; Tue, 20 Jul 2021 16:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626796822; bh=dkL66U96v0hwDpKIr0D2H6nA6y9CAYr1QQqGQ3siWGU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h3UTEvAshGtKER0AFHA3wbnou47cyMyJUnHQNWuM0Brr2hd1AnnuWQyl9/pVE6vfY JLGS0xJneooXS/tLAFhbKazmkj2t8BKeFkq1VqZNprMW3zMbJqyu4xHZsyXKMs88fj f+B9fZDLU8qlAamSnFp3gqHmJIMhhvshiBdJN2egwRiWFbykZqrRgFGk4MjTc9wOPI ZhuoIwCrV8nzSWn5SLENBY7PgieG/XTrtLgfyIa8Jnvh0t5MGV1TafSKO64AYYQFTu IE18EiIbH7XZa7brHZpA2Azm8oX3WJdtXiGJE6yRSXgR9lwICj8bbqyXtOgqvMXV+W VoL41OxBaXUsg== Date: Tue, 20 Jul 2021 17:00:18 +0100 From: Mark Brown To: Miguel Ojeda Cc: Linus Walleij , Wedson Almeida Filho , Greg KH , Bartosz Golaszewski , Kees Cook , Jan Kara , James Bottomley , Julia Lawall , Laurent Pinchart , Roland Dreier , ksummit@lists.linux.dev, Viresh Kumar Subject: Re: [TECH TOPIC] Rust for Linux Message-ID: <20210720160018.GD5042@sirena.org.uk> References: Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yudcn1FV7Hsu/q59" Content-Disposition: inline In-Reply-To: X-Cookie: Revenge is a meal best served cold. User-Agent: Mutt/1.10.1 (2018-07-13) --yudcn1FV7Hsu/q59 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 20, 2021 at 03:21:45AM +0200, Miguel Ojeda wrote: > On Tue, Jul 20, 2021 at 12:16 AM Linus Walleij wrote: > > I think it's not a good idea to keep these wrappers in their own > > rust directory, they need to be distributed out into the kernel > > everywhere they are used. We have made this mistake before > > with OF (device tree) that started exactly like this in > > drivers/of/*, and now I have part of the OF GPIO handling > > and tests inside files in that directory as a consequence. > The `rust/kernel/*` folder currently contains all the "Rust > abstractions" that are shared by all the kernel, i.e. in the rest of > the kernel tree we have kernel modules that are users of the > abstractions. > The main reasons behind this approach are that it is the simplest one > and that it makes a clear distinction between abstractions and user > code. In fact, code inside `rust/` has some capabilities that we do > not allow for non-`rust/` code. For instance, `rust/*` code can use > the C bindings and has unrestricted access to Rust unstable features > (though we still carefully pick the ones we use, of course). This is > not the case for "normal" Rust kernel modules elsewhere. > Having said that, this is not set in stone or a hard requirement -- we > can definitely split things and move them elsewhere, e.g. having a > `gpio` crate in `drivers/gpio/`, for instance. We could still follow > special rules for "subsystem objects". It does feel like it'd be good to work out some system for ensuring that subsystem maintainers have sight of any Rust work that's going on for their subsystems rather than having that happen off in a corner without visibility. --yudcn1FV7Hsu/q59 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmD28xEACgkQJNaLcl1U h9CV1Af9Fye+jvSDKpmpsKm3F+R2rhFLuRCxgiuyLYDhmWI8qJh6YLsjp6Iw1sqD U9HOVbs05k4D1Q8nzTPZ+DwcECsuXKqGLhznCjtSSsO8zyD4s8XWAv5skHVfO5EQ yBg0hOLJPLEebkTtRcCiPn3Uu0Dg8x/BhlCe8t5xbcDff+APKZMl3CpNwnFruYyq CH+ttii6Ifcp7jMTOf+lqOSeXxaW+ZCm7y3j858ogDUwK+ZzekZSVXLUAo8lts/V mnRP2YmMNdYqY1iCOTf/96trPJHLANIgcYq1YR+l7h9SdKENv25UE0rh7Fp4iTzo sqqjWofdP6Tj2zQ5IBBimMtIugkLgw== =iJh+ -----END PGP SIGNATURE----- --yudcn1FV7Hsu/q59--