From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0729326928 for ; Mon, 8 Jun 2026 16:16:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935381; cv=none; b=mh4v2BS+060wzFSHUncrVYnfl1mMa+i+PMwQYygCht+9vEVVBKCDWAw0Qy2aDE70zR86xikzqGUSTRvpSNokVwFLvrsVNt0BuIFNqyBHMdylviAj1Spnb2/4AWimtPADkouE7DozN5Z8ZXbM8IYFFeTb4dC+o1lWfL/+/OSaCZc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935381; c=relaxed/simple; bh=LuAuDPS2cefO9msY2v5Pfkr1UDB1Mok0w0xGu74ON4s=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uZ7K+kmJDURGFUMDq9GhoMJXlFUvc+5JAvoWKLtGSj6VPwO41akThtYaWOl/rhbZTAtd50R06sTdcBc4dqTVdu9mg0SFwiPcnH9f9O46JwBMzFR5WL6dS+wtguGA2P0oXlCGE8xs9xR1bzJDyLUQnSqWKOplNmkBBEBTYxKRsYk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LdaLvPH7; arc=none smtp.client-ip=209.85.128.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LdaLvPH7" Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-7f015f87fddso15369767b3.0 for ; Mon, 08 Jun 2026 09:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780935379; x=1781540179; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=ufh2a1IBnVjLV88sQqOB01oSzKTb2+dLoZi3jebbixU=; b=LdaLvPH7vlhsr4OQHhgQRtSGtKNxul3Q69hhAgFtLnE6ymGnpnz8UfSyOnOer96cmH JjOd8+m0Gunjy3AUkaFdVb8RTyXCaCN96m8NV7vYu+6GUj21DnFkvudRNGuXjUDX1Ehf fKXP9Q1yZASdhERFdHtEMoMweQYTWmIKznWgHApR6JpYcx3jwzqMSE3m5Y7EvgES/lT1 d+CgRHdjr4W2bPja8tKA0jESbm7X+nZFy933kvexaYlbHdZ7CiWo2eFgeF2mv9SS4/Vv w0fAxpwlKNBzA1jP4qDCPmUQyctW/YLPMorKYOVgtThaFa7eYyLDsNmTvLQXt2mJrNhp MkIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780935379; x=1781540179; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ufh2a1IBnVjLV88sQqOB01oSzKTb2+dLoZi3jebbixU=; b=W3JcKrO7QSt2Po1uaKuNpt7NFgEdut0xl9WlPTtv+VBm0Rs7/+Eh5k0HO7P5GeWZG7 lKYO4pUzJpufWwbrNvzFPb8Or3QZtT47h2UgHb2vuNjL84qWizGNl5ty3f51r9CC08zV qLVfGwYQEoGZV9SDKWGiir9iV4Zng5M3q4FZ6jv2dZjww4Bw2OKoACB9DdyO3OU59Fm0 /UC4Xu10iIR5xp/C8DiSCg/yRpCsxWEQZ5yPTE/WnivMy8AGyp6JX4Ht4eiucsU8j1At ZXCvQW6yzd5RIbSP16W+jF5vgNb8c1RJ9jTCMrQu83a4dntmHuyLWV8G3PwchJDDSTdT J/ng== X-Forwarded-Encrypted: i=1; AFNElJ8c395AKUbpb1tTVm12K0l2hvvgVNT0i4n/TyLD2zpWmNjhwPXMdjBiBt2rIfgEVL2VBZFDDrU5UoWV5F6miw==@vger.kernel.org X-Gm-Message-State: AOJu0YyHKvKCJszCBH04QG/srHGWF17eWz5qoj05oi0vpN4GnBtfScXJ ZkYJZve/YhQhfuZq0F9N6JyffeT8PjWFTQA3TN4UjrfJ9Ntdmg/siB7n X-Gm-Gg: Acq92OHZPYEsB5qPre5lwjyOvOhSGxPLFdnHdyh7aTrlEiruWVaizoQsb6EMfjogpJx HeYcNldYJl3tfUPZyFGHVSJWLs6wEF9CLecksIwGL0HCLM5hWSqLtqQJ19GCMTyZte5eHdbFDqn Ov7ZokMOVhz8ZZzUa6+TPd05nMolAtjbT1IpRHWN+phED+UNJPPvOaQIAN21yyhYVf5+qBoastO 5wApP1TIGa7DuPCZD7+76u/WGB8M1kc2GS9tLC5PHzRHro1B94v6cQVwXnHiPOV1XvDydXxv5SK BnnaxJE71gAopQrTpBDX+ib9/Mwe3ZX5IbZPaq+9UhO6vH3CF1ULyhvC7FsGFb7Zlg9wJWvYSKW HBTvCAX3QBsXqwCaJGNp6X0P3NnCuR0cqRw2SVDm13HSrq1xWbWhbAE1R3AOZ6UpCqZyjMwxvrh XpBe+Ens5DsHBVyTGqhItw39xBoIrq X-Received: by 2002:a05:690c:6612:b0:7bf:1433:8f92 with SMTP id 00721157ae682-7ed5028e59dmr109118667b3.7.1780935378548; Mon, 08 Jun 2026 09:16:18 -0700 (PDT) Received: from localhost ([50.221.107.122]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7efb9b99e2dsm21305947b3.20.2026.06.08.09.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 09:16:17 -0700 (PDT) From: Yury Norov X-Google-Original-From: Yury Norov Date: Mon, 8 Jun 2026 12:16:17 -0400 To: Alexandre Courbot Cc: Yury Norov , Miguel Ojeda , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , David Airlie , Simona Vetter , John Hubbard , Alistair Popple , Timur Tabi , Zhi Wang , Eliot Courtney , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, nova-gpu@lists.linux.dev, driver-core@lists.linux.dev, Joel Fernandes Subject: Re: [PATCH v5 0/3] rust: add `bitfield!` macro Message-ID: References: <20260606-bitfield-v5-0-b92188820914@nvidia.com> Precedence: bulk X-Mailing-List: rust-for-linux@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: <20260606-bitfield-v5-0-b92188820914@nvidia.com> On Sat, Jun 06, 2026 at 09:43:03PM +0900, Alexandre Courbot wrote: > This is the continuation of the `bitfield!` macro which started > alongside the `register!` one before being temporarily integrated into > it [1]. > > This series extracts `bitfield!` from `register!`, adds unit tests for > the new macro, and replaces the `register!` macro rules with the > extracted version. > > I have removed the `nova-core` patches, because the Blackwell support > that has been added this cycle (and thus not visible from `rust-next`) > introduces more uses of the Nova-local `bitfield!` macro that this > series intended to remove. If these new uses are not updated, then > `nova-core` won't build, thus to avoid conflicts and/or build breakages > I think it is preferable to merge them during the next cycle. > > This version is based on `rust-next`, with [2] applied. > > A tree with this branch and its dependencies is available at [3]. > > [1] https://lore.kernel.org/all/20260120-register-v1-0-723a1743b557@nvidia.com/ > [2] https://lore.kernel.org/all/20260417031531.315281-1-ynorov@nvidia.com/ > [3] https://github.com/Gnurou/linux/tree/b4/bitfield > > Signed-off-by: Alexandre Courbot Thanks for the work! Reviewed-by: Yury Norov > --- > Changes in v5: > - Squash the fixup patches into the one extracting the `bitfield!` macro. > - Remove the `nova-core` patches to avoid a conflict/build breakage on > -rc1. > - Improve the unit tests per Yury's feedback: > - Use a consistent test axis where each test focuses on a single thing. > - Rename members to generic name including range for readability. > - Add test exercising `try_with`. > - Add test checking that unallocated bits are left untouched. > - Link to v4: https://patch.msgid.link/20260527-bitfield-v4-0-e8821d4efbde@nvidia.com > > Changes in v4: > - Inline private bitfield accessor methods. > - Fully qualify types in `bitfield!` macro. > - Rename `RUST_KERNEL_BITFIELD_KUNIT_TEST` to `RUST_BITFIELD_KUNIT_TEST`. > - Link to v3: https://patch.msgid.link/20260501-bitfield-v3-0-aa1076c3337d@nvidia.com > > Changes in v3: > - Split patch 1 into the addition of the `bitfield!` macro and its use > in the `io` module. > - Mention reserved field names in `bitfield!`'s doccomment. > - Properly order fields in the KUnit test. > - Add a Kconfig option for building the KUnit tests. > - Document behavior on non-covered bits. > - Document support for signed fields and storage types (TL;DR: not > supported). > - Move `nova-core`'s `bitfield` module deletion into its own patch. > - Link to v2: https://patch.msgid.link/20260409-bitfield-v2-0-23ac400071cb@nvidia.com > > --- > Alexandre Courbot (2): > rust: extract `bitfield!` macro from `register!` > rust: io: use the `bitfield!` macro in `register!` > > Joel Fernandes (1): > rust: bitfield: Add KUnit tests for bitfield > > MAINTAINERS | 7 + > rust/kernel/Kconfig.test | 10 + > rust/kernel/bitfield.rs | 862 +++++++++++++++++++++++++++++++++++++++++++++ > rust/kernel/io/register.rs | 246 +------------ > rust/kernel/lib.rs | 1 + > 5 files changed, 882 insertions(+), 244 deletions(-) > --- > base-commit: 72d33b8bfeacbfdccf2cda4650e8e002def036f8 > change-id: 20260408-bitfield-6e18254f4fdc > prerequisite-message-id: 20260417031531.315281-1-ynorov@nvidia.com > prerequisite-patch-id: 403e34bb92b42d3f31ed972e11896d18902585e3 > prerequisite-patch-id: 42ae775aa6762a9e28ff31c5f69a0b65a7b40dcc > prerequisite-patch-id: 19b3e535962348f7627ede57ea829b34abda08c7 > > Best regards, > -- > Alexandre Courbot