From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A6C2C54E64 for ; Sat, 23 Mar 2024 00:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k77sa4oJVYwNTpFgE8AnWUucpzYBEErvEF3ELLwSNeE=; b=027+2psTiW93+5 CCCXd2UYqiH9dT9wFYm3tfj88d39nBPaC8zzD+JmRfK9SWGeYV4f5xDNQ3hqyp3dy4ylY4jUI7Ba0 oQnWfbcNamlhMeO7IWLZZFFGjj1ev1rz14p4oEBx4W7e46POF7SEV9tWC+g2NASkVxKtoqI/FY3ZR Ay0/mb2Q/55/NnwqxvgmoD9wZTxtKGFhcu9APh0K9UgQ/LxEdT/moSkqgtNkK13XAMCoZQ4u47sd1 NVozzgU9Na13erzEBeBLj4H6JnsofyAPVRfHv2BgqZFBJWqTgfo1aH0ZU7X2nGMA/Qvj2lyS/sUSV jNAA/wpnpNzZ02QmPcYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnorN-00000008z5h-0wDN; Sat, 23 Mar 2024 00:03:41 +0000 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnorK-00000008z4x-1fCs for linux-arm-kernel@lists.infradead.org; Sat, 23 Mar 2024 00:03:39 +0000 Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-430ad286ab8so15888331cf.1 for ; Fri, 22 Mar 2024 17:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711152217; x=1711757017; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=eASLODvGo3GX2Oyfss7PQQhJkyATkdZhH8YczVO2EXo=; b=NXQXs3RVWmhEjtiHl1Q+vTFYhUeSDoZ8SPhuZhyddNoIKw4fGZVS8Iz3xGtNiwmFFK 9hGVXrdxOjf7Hn6rYGqOMNa66VViicHgUQxqv0/cyJEdwGa7DXjtJ7+6tHqDu0l4G2Wx y6+W6hggqzH0lrjX4NLu2Fw1W6dBPqA0VMN+Skm6POZzEPCT6YXCZ7aE74i3iKB07IO1 Mfb/kX+uttI771ZasJR+17mPzA/BnkQNlIetJ3qFhwhZsvHcsheuZ6+Mh8e6FT865c4h /MTIciBHAIG6Cc2DckFlhB4ClM7JdlFBY1nyCncOztR353V+hQuQplMvU4FRz3B41OTZ 85bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711152217; x=1711757017; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eASLODvGo3GX2Oyfss7PQQhJkyATkdZhH8YczVO2EXo=; b=kKFq6rIvtsTf0FV3F8jEP9mfBIfhZ2JShJI1L8WXmCMjtjK426VyEENAFl8GBUFnRa j7+6tBLdUF4wHB23J5BLrsc7XspM4OUxQhsPGwlmYPTNgfsMGeu9YPiDGQ9KIoCj2KMd 92oqCokx8VyRmBnEMdwEqjXEw2n2T72SKUOBc8Q924KnZHmSEk1MXHIynS0p5PXS86Zu 07MwS2ZYkOwxcw26HZMgJz0K8HOOg4lyiQqdnqNGL9nGinSCAjSlVvKBJlsYaXCPLZbG WRypEkR2FhZ+rwl2j28iLhLtTvHqO3dn4k5OcbLeXcf9lGpUEnC0YWCIIK4hCPTgxLFE 1yPw== X-Forwarded-Encrypted: i=1; AJvYcCVVb6L7ml6y5HgF6PKjPbjqH4xKljv4XArE3rBfoUfy4crdL5eP4LTHdu/Ouv8KBLmxxWhowI3N//VyC45PUN3tLdPxghmaq1ik9Nbi8/bENq6dFFo= X-Gm-Message-State: AOJu0Yxwlu3/7NvoE/GsIc3HOj+V9zxuop5bI/cabjxDGSG0njjrF8Yg VxKsAMqB4Chq42Lo/xINn9mJyyO8TDKUV9ofjfoXUsYlee+bFXn6 X-Google-Smtp-Source: AGHT+IHjbUwCnlotNrzEjDqfeNUUku72up8XO+hTXKKrIOT7ksYTxuCesrZTrHymVkrnW/ZbtgJbZw== X-Received: by 2002:a05:622a:14c:b0:431:24c5:9dd0 with SMTP id v12-20020a05622a014c00b0043124c59dd0mr1180573qtw.29.1711152216768; Fri, 22 Mar 2024 17:03:36 -0700 (PDT) Received: from fauth1-smtp.messagingengine.com (fauth1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id d2-20020ac84e22000000b00430cacfe532sm298900qtw.79.2024.03.22.17.03.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 17:03:36 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfauth.nyi.internal (Postfix) with ESMTP id 5901B1200043; Fri, 22 Mar 2024 20:03:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 22 Mar 2024 20:03:35 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddtfedgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeehudfgudffffetuedtvdehueevledvhfelleeivedtgeeuhfegueeviedu ffeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 22 Mar 2024 20:03:33 -0400 (EDT) Date: Fri, 22 Mar 2024 17:03:11 -0700 From: Boqun Feng To: Andrew Lunn Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, llvm@lists.linux.dev, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Joel Fernandes , Nathan Chancellor , Nick Desaulniers , kent.overstreet@gmail.com, Greg Kroah-Hartman , elver@google.com, Mark Rutland , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , torvalds@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [WIP 1/3] rust: Introduce atomic module Message-ID: References: <20240322233838.868874-1-boqun.feng@gmail.com> <20240322233838.868874-2-boqun.feng@gmail.com> <068a5983-8216-48a5-9eb5-784a42026836@lunn.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <068a5983-8216-48a5-9eb5-784a42026836@lunn.ch> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240322_170338_639112_2205CEB4 X-CRM114-Status: GOOD ( 17.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Mar 23, 2024 at 12:52:08AM +0100, Andrew Lunn wrote: > > +//! These primitives should have the same semantics as their C counterparts, for precise definitions > > +//! of the semantics, please refer to tools/memory-model. Note that Linux Kernel Memory > > +//! (Consistency) Model is the only model for Rust development in kernel right now, please avoid to > > +//! use Rust's own atomics. > > Is it possible to somehow poison rusts own atomics? I would not be I can continue to look an elegant way, now since we compile our own `core` crate (where Rust atomic library locates), we can certain do a sed trick to exclude the atomic code from Rust. It's pretty hacky, but maybe others know how to teach linter to help. Regards, Boqun > too surprised if somebody with good Rust knowledge but new to the > kernel tries using Rusts atomics. Either getting the compiler to fail > the build, or it throws an Opps on first invocation would be good. > > Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel