From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (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 B44E732AAD6 for ; Mon, 8 Jun 2026 16:16:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935382; cv=none; b=X+sIuaMwK5nhnxhuLQN7lkTJnMgLQUN1H7JfnHxR4tH9f/IHdPlL8qs/FK0RDMTkqJgnw3q4mMUH11wwoK5EB4KR2hSVTVa8EORFw2Ezzxd3ISyyeDp/8d1CsMpn30zxpveqB6oo3XUumoyGaseLhjxISg4nvtvpiOLDwgeraXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780935382; c=relaxed/simple; bh=LuAuDPS2cefO9msY2v5Pfkr1UDB1Mok0w0xGu74ON4s=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lAHFoowH6aVIisc14I6663pHYu0mNbFvqwoOYlZhsb7ErVGm+HwINnFa4W9FyHjM9A2AM6HO0wlJdw2/iDTpOzCLc5JT+9tFH84EnolDOrb/9w2nIzHrTcZKsdNTMtpbKzsahG6mig6I5E6wRJVMUF5p3AOPvs2Tt9SdAmnfYtM= 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.178 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-f178.google.com with SMTP id 00721157ae682-7e053987001so44135857b3.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=XQ4uZ4VbuMMj0xqgpY4ue53SOlS6cR0bdYo2xCqv6Lo3b78Pe8y6yi38EWPhYAjl6h 7/FxLJ4PGsOV2KfyEZqNPcsPu1Ex2m/TZg0sdkn3T3lmycJfotY9W5u2ax2Jy1k4tNd/ KgLInao9HuV8EpoxPLp+V21YTi4mau/TgBlgBBaabiFfvjmY2pvG+CcgOZloKoN3bCTW oESkOZ3AIaBoTG497vp+I5GHLvWny/eooWIgKZQiVqjiTEH1fGeZnh1NgyAXYEM8A6/f wbnobUmwCkYf1Kbj5n24aXA8V+8Pbagnd4fFY7ElkoNbZDO9sceT58inzJuOP4gKMdVg xuBw== X-Forwarded-Encrypted: i=1; AFNElJ+O7yNijihuQl190J6E+5apvAtemGtc/otOWWwK8H8jLr6KEekZMPwpDYAEG6wfwq4piLAaQ/RLzgew7Eo=@vger.kernel.org X-Gm-Message-State: AOJu0YyNssxtIOCiWJIJQm/ddUIVgmXPPtmT8mKKH+A35gWiDpHEpujd H4XPGiHU8Lt5Hh5OfD1gQbCldSyc3JVaLOzYnDK9NmPqxbnS+2iPdhDX X-Gm-Gg: Acq92OH5uFwVM31OMX3LpipmV2OSaFk42ZTzMQGDnXajEBUJbm3zUSG+OO4ga9WVT40 EyYRl5tIb7XtP3HwUk6zP8jI+itYXjvsL4TvEWbIqVwzUyYeoHO3hvoGtv7b9W1VVIrRh41rm93 4YwBx4878IN8dKPw635wowGjGbyoXMD0DPWe5QcBnUQ+JqYPxhjRqt+qdFfy2sAphokLMy29YwX XGuCR+vdkYaChgX+wowqlUXs71u+N1uG2dnVMFpPkEM//URDic/ea4vKdURO6zVAiHRSYWHUVaG Wv1Bn1dtxhiY98aexa23GjxQEFlKpGNUhougVxVM8CzoobdGzUo4bRTP3/8rdN2NC8v3GJEI+Bu smuILUBb3tgXTxZmwCLpSnC5LxjMe1UnDrhDWtVPKk1+fGugxw5Fn644I8HAPZRNZkROvA1kMWX 3hq9vJUXYDDFuHUmR9q5A0DpLjhmOy 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: 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: <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