Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3122022lqp; Mon, 25 Mar 2024 22:57:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6Wrs+wokqLe6N0CTUqcuJBKgh199Tg80lyaqDYz5NTJXPAH36BLs686zFCD3ZAzWoW2OqbgCsqJT+V9rv1xYnJnfWGhSVyA3EKcot1Q== X-Google-Smtp-Source: AGHT+IEjroTShx2RigZrdHVmNE9LFc9AEcg6dkx1yNZhROXLiXaNRMES1SUzPBXkr9psUcFftZza X-Received: by 2002:a05:622a:138b:b0:42f:4520:2fd1 with SMTP id o11-20020a05622a138b00b0042f45202fd1mr10889667qtk.27.1711432638604; Mon, 25 Mar 2024 22:57:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711432638; cv=pass; d=google.com; s=arc-20160816; b=xAuusxcJg0NCH67RCZYS0bigcxUX8u+I32vjcdlECo66A4zO8eF2ZGQNQJASmYKRUU 57bcB9wuJVfuMPyHhEmatKsLv1aBfY+TC9EK0qagpgLPv9oVM2M/XWpTdx113C6JuHuG LQwvPo4NidAUosK24lW9RExNYliZ7VcyT8oP9Pb6t+yGznB3tXE3rnj3do7+DFAkLR51 F0s1YmJ8WSHcoNPH164R1OL8x7hQplRl4sB+lc+TYh1iceSQrNcoD8MH9DY4dVnBQsoi 9O5ytdauwpdnWUmYH/O2JQ7bRC7E4b38oXFq1cap8UwOBHIXTtgthCDzTl5pjby9U2SA Srpw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=PPkjY6tTJjq9XlGXu2wl3SzG0jXY288ke/okKd5Kw2o=; fh=0/9vuWqiON65XjSAfJlcQ0lFnQTCdu9qiZNbbwOS9LQ=; b=B2/wxts9Yy7dB2LUUMlKOQSHyMmJBTCz8CqdML0ezrYTmZpL9eEm9+1rF+JVTeLZ0j 7OU8UwUTZax4RomIjETrikEacnBGyT/P7X4M/gfs1kO9Z6/kF9pH4rTFegrjxYLq6X1b WiZX1Hvn/1jj1VMoLeYmgGzCNl8b/WqFRMJGrEkCRN5CkUpu9idldpPIPxAgIDQT5Wvz qYbQ/NbbFCVHlb7usBTFAf5/g1AXZEHDVhcK6I7YWvoPyKcjF8BWcGrDHwbUhHQ4GQwW OMhjlZw3eQBiJ52g8jIX+RiFc1VXFu24QAhvlL/KHHMR1UushSrLSfYisiCSYPbJvMN3 MJEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=DwQRSX7x; arc=pass (i=1 spf=pass spfdomain=umich.edu dkim=pass dkdomain=umich.edu dmarc=pass fromdomain=umich.edu); spf=pass (google.com: domain of linux-kernel+bounces-118387-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118387-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ge5-20020a05622a5c8500b004309f7128edsi7257922qtb.439.2024.03.25.22.57.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 22:57:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118387-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=DwQRSX7x; arc=pass (i=1 spf=pass spfdomain=umich.edu dkim=pass dkdomain=umich.edu dmarc=pass fromdomain=umich.edu); spf=pass (google.com: domain of linux-kernel+bounces-118387-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118387-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 58B5C1C30F07 for ; Tue, 26 Mar 2024 05:57:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF37C12B146; Tue, 26 Mar 2024 05:57:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=umich.edu header.i=@umich.edu header.b="DwQRSX7x" Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (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 1560012AAC9 for ; Tue, 26 Mar 2024 05:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711432623; cv=none; b=HDl7lneJCnX6eJX4eSg5mgUrHtkVv9x0rLs+twwmWWRSQlIXJfFIHzOB8rqiJilsnt4+2ZDQsoWNfFGCHg+Mlu74hqRO8XwSrkcGrGlA2SRQ6y8m0BS2txlahHS/aYfUYLYewCv2MyiYPyS3Rrtyr/MiSJzUSXncCX9O0lx6uDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711432623; c=relaxed/simple; bh=ND9Y2sxlabnYJnhIIV0KvAzdrK9FLJxwJWh3pj7SGmo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NwcvvDAn/qqXY6qIm8Wom+NVDN3UiDZ1FFmISgQMbAHGg9e1Ac/UXoWr6XE5DW0ts31IZyBcpdc2g7mg6qh9IEYZAu6chqAdadd+zR9STd82dvTJXUm0bXrdSREI+mbGWFtV2JZfoaJ8H4CKfSE2xad3ypEPg+dDmENcYi2ZyMA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=umich.edu; spf=pass smtp.mailfrom=umich.edu; dkim=pass (2048-bit key) header.d=umich.edu header.i=@umich.edu header.b=DwQRSX7x; arc=none smtp.client-ip=209.85.219.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=umich.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=umich.edu Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-dc6dcd9124bso4915639276.1 for ; Mon, 25 Mar 2024 22:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; t=1711432620; x=1712037420; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PPkjY6tTJjq9XlGXu2wl3SzG0jXY288ke/okKd5Kw2o=; b=DwQRSX7xXn0tiE7O/iVzvcILfAA5V+It8QlyxT+GeYMvSYtObXDUYJfIC0sJ4lbv9k Trw5xlTNzUjYovObDw/DDLw4ybvqd/gNC3ZCzpyFxYLSP1cLkQM1sqR78bZPPqg2ECr3 pd9vvGgT+U+ZO3BHwiMYa+few2d+6Ai3cR29A4AzYy+BU86eQSAzjtGup+7kYoi3Hq+j EExhVbzSq0roJ8/CfD2Rob3cBZyA1jje1QdRKEKDm92X/TJte/qplh/WlAn6b75vt9A8 gdWUQYFVAe8ukaSRtmN1nXAhQqrYPZwkPn7Lu1/HPd4tOWO264NF1OXno3nJrWAjf/0p x0Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711432620; x=1712037420; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PPkjY6tTJjq9XlGXu2wl3SzG0jXY288ke/okKd5Kw2o=; b=mQVbWgCLCtN6Ro97oI/2B+aQ1+CC5fyKEFSdkYE7mgBRGwgFZUrX9ZdBEb+CN7ICRj adRedOV5X4uksxZ1RjaqXb9wWh33A7djd2lmCs017ea/OqkVplc7pwf2m4uB4tICEzaS RFaIuC7E99attaEi7q9DnO14o4jGxYGEOPTKkesKtpogUpl+YixuyEqr+RFPJ/s4leVh oHwiIiSJlhGFqdO07JHZBlFdHwpuz5pby4QNQYiBcDsk7U4xLTRPbeDnMiP6K48Hw30r CkdEsOAoHL0GZEK95Es28JcxDb5YpfzIJtwXgvs04q7CGt3SQvJUg/o7ue92qYjYaCcH CILw== X-Forwarded-Encrypted: i=1; AJvYcCUnQh/x5oCjALBJD0/C8RIRsMnA3q7Qt3RuT1QKYpmaCouMLfcOROAlaPpHehKDgYrN3WY9J7jPiSwZxVUFk+pyqHxHZxPbQa2tHTNC X-Gm-Message-State: AOJu0YxqHCS1uyeEAkPrmF6ZBAwnQ4+qcP7bhiaBEfiXrn3b/dJKWsjl d0RyAWgGrByyFTT5Y9Y2/Og3rK+NLPS4ZiEYJb2FzHKZm57NLLqy97fcNh18+X2dow2ybR2uHK9 626EvJuv6deAu4L8yxYZZur1rbMDVvT9YeaOljA== X-Received: by 2002:a25:2fd2:0:b0:dc2:398b:fa08 with SMTP id v201-20020a252fd2000000b00dc2398bfa08mr6083186ybv.31.1711432619981; Mon, 25 Mar 2024 22:56:59 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240322233838.868874-1-boqun.feng@gmail.com> <20240322233838.868874-2-boqun.feng@gmail.com> <068a5983-8216-48a5-9eb5-784a42026836@lunn.ch> <497668ec-c2d5-4cb4-9c2d-8e6f7129a42e@lunn.ch> In-Reply-To: <497668ec-c2d5-4cb4-9c2d-8e6f7129a42e@lunn.ch> From: Trevor Gross Date: Tue, 26 Mar 2024 01:56:48 -0400 Message-ID: Subject: Re: [WIP 1/3] rust: Introduce atomic module To: Andrew Lunn Cc: Alice Ryhl , Boqun Feng , 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 , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Mar 23, 2024 at 10:10=E2=80=AFAM Andrew Lunn wrote= : > > > Is it possible to somehow poison rusts own atomics? I would not be > > > 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. > > > > We could try to get a flag added to the Rust standard library that > > removes the core::sync::atomic module entirely, then pass that flag. > > Just looking down the road a bit, are there other features in the > standard library which are not applicable to Linux kernel space? > Ideally we want a solution not just for atomics but a generic solution > which can disable a collection of features? Maybe one by one? Clippy is an easy way to do this via the disallowed_* lints. disallowed_types [1] would be applicable here to forbid `core::atomic::Atomic*`. I don't think KCI currently checks clippy, but we probably want that at some point. - Trevor [1]: https://rust-lang.github.io/rust-clippy/master/index.html#/disallowed_= types > And i assume somebody will try to use Rust in uboot/barebox. It > probably has similar requirements to the Linux kernel? But what about > Zephyr? Or VxWorks? Darwin? > > Andrew >