Re: [PATCH 1/4] rust: sizes: add SZ_4G constant

Alexandre Courbot
2026-04-17T03:18:51Z

Hi Alvin,

On Fri Apr 17, 2026 at 10:05 AM JST, Alvin Sun wrote:
> Add SZ_4G constant defined as SZ_2G * 2. This constant will be used by
> the Tyr driver for calculating user and kernel VA layout.
>
> Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
> ---
> rust/kernel/sizes.rs | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/rust/kernel/sizes.rs b/rust/kernel/sizes.rs
> index 661e680d93306..872f5bb181ecf 100644
> --- a/rust/kernel/sizes.rs
> +++ b/rust/kernel/sizes.rs
> @@ -48,3 +48,5 @@
> pub const SZ_1G: usize = bindings::SZ_1G as usize;
> /// 0x80000000
> pub const SZ_2G: usize = bindings::SZ_2G as usize;
> +/// 0x100000000
> +pub const SZ_4G: usize = SZ_2G * 2;

Note that the way size constants are defined has changed in `master` -
you will probably want to update this patch accordingly.

Also there is a `SZ_4G` define in `include/linux/sizes.h`; I am not sure
why it is not in the bindings, but we should probably add it and get our
value from that.

Finally, maybe I missed something but the new value doesn't appear to be
used by this series?