From mboxrd@z Thu Jan 1 00:00:00 1970 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 66A2643151; Mon, 30 Jun 2025 19:02:45 +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=1751310165; cv=none; b=gg7C4QpgIlrq3hUupYscOMWQzLkkjLH+SXqQOXqfWQ8dXyMh/5zPs/VpqVnNKndFvutszahCVpDLm0VOujGQcsH+WI9S/OHeLQuZTkAroG3WjwVVowS3ppupYWNVnF8wXtN6iQYNgDBty8gy5QyQCfqg7UnXtCVyommiZGnKaH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751310165; c=relaxed/simple; bh=3ZviabXAPMdMjrA9k+SYU8j0EE5YIyw3lU8BHpP0Ee0=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=kltGd0qbsVyrtcp0cWVoUfWrRyw2wiJ/Gq3GGQZgGCc9gxJvSV2ZfHtuhuOHHbHCKKl8OLNTTraeKpg0zlcwfebBbNK9brUPl6S0u4flE83jpr7qybWlUuETfadB8lWmOYrgmygTWXQ4TmwuPWzDNOfI2OR5AGIaX4qVCozhYIA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y3HRpiCM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y3HRpiCM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EAC7C4CEE3; Mon, 30 Jun 2025 19:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751310164; bh=3ZviabXAPMdMjrA9k+SYU8j0EE5YIyw3lU8BHpP0Ee0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y3HRpiCMZeaha7LTlG3YTPJUXrhyvdpEgyTeZwt1v87WQe+xdqXfnC1jXlNNv2Jla bP2vX8MvmfsagwTgAAySOB3xpDGaGl5h78M3HGhQrQ4Z+wlN0fkmnTEbny1+i0i2xj 0cnNnSDrn+PzjX7/i3SFrcbqD/7VYgFsSRTUfmFWx9d+i7oSmjSokW4BOkHQb+Xs2c QNAbGed9RpQPSxXNUtES/EztOB3+v22I3aSdZB42jLbZv/7hL+CP4bSdJAqRGH+1B9 aJUdnbowWXoCkoI+yjdcl7+MoS48WqSUZF4KBHZk3V9MKd3n+J2Y9CivoqqCtfMq1f no5Wiy5fsinsA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 30 Jun 2025 21:02:37 +0200 Message-Id: From: "Benno Lossin" To: "Andreas Hindborg" Cc: "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Alice Ryhl" , "Masahiro Yamada" , "Nathan Chancellor" , "Luis Chamberlain" , "Danilo Krummrich" , "Nicolas Schier" , "Trevor Gross" , "Adam Bratschi-Kaye" , , , , "Petr Pavlu" , "Sami Tolvanen" , "Daniel Gomez" , "Simona Vetter" , "Greg KH" , "Fiona Behrens" , "Daniel Almeida" , Subject: Re: [PATCH v13 2/6] rust: introduce module_param module X-Mailer: aerc 0.20.1 References: <20250612-module-params-v3-v13-0-bc219cd1a3f8@kernel.org> <20250612-module-params-v3-v13-2-bc219cd1a3f8@kernel.org> <87ikkq648o.fsf@kernel.org> <877c126bce.fsf@kernel.org> <87v7om4jhq.fsf@kernel.org> <878qlh4aj1.fsf@kernel.org> <87plepzke5.fsf@kernel.org> <87wm8txysl.fsf@kernel.org> <9G3W1seaM7elcwWXaeoaa2nfpFYCf-AmBdvZhACGP13KGUtTPVMwGNYdTQsdtp8ru7GIP3-UYTzXscC1MRUKrg==@protonmail.internalid> <87h5zxxtdw.fsf@kernel.org> In-Reply-To: <87h5zxxtdw.fsf@kernel.org> On Mon Jun 30, 2025 at 3:15 PM CEST, Andreas Hindborg wrote: > "Benno Lossin" writes: >> On Mon Jun 30, 2025 at 1:18 PM CEST, Andreas Hindborg wrote: >>> "Benno Lossin" writes: >>>> (no idea if the orderings are correct, I always have to think way to >>>> much about that... especially since our atomics seem to only take one >>>> ordering in compare_exchange?) >>>> >>>>> As far as I can tell, atomics may not land in v6.17, so this series >>>>> will probably not be ready for merge until v6.18 at the earliest. >>>> >>>> Yeah, sorry about that :( >>> >>> Actually, perhaps we could aim at merging this code without this >>> synchronization? >> >> I won't remember this issue in a few weeks and I fear that it will just >> get buried. In fact, I already had to re-read now what the actual issue >> was... >> >>> The lack of synchronization is only a problem if we >>> support custom parsing. This patch set does not allow custom parsing >>> code, so it does not suffer this issue. >> >> ... In doing that, I saw my original example of UB: >> >> module! { >> // ... >> params: { >> my_param: i64 { >> default: 0, >> description: "", >> }, >> }, >> } >> >> static BAD: &'static i64 =3D module_parameters::my_param.get(); >> >> That can happen without custom parsing, so it's still a problem... > > Ah, got it. Thanks. On second thought, we *could* just make the accessor function `unsafe`. Of course with a pinky promise to make the implementation safe once atomics land. But I think if it helps you get your driver faster along, then we should do it. --- Cheers, Benno