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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1C20C32771 for ; Wed, 21 Sep 2022 14:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbiIUOTx (ORCPT ); Wed, 21 Sep 2022 10:19:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbiIUOTs (ORCPT ); Wed, 21 Sep 2022 10:19:48 -0400 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05FC6101F3; Wed, 21 Sep 2022 07:19:44 -0700 (PDT) Received: by mail-qt1-x82d.google.com with SMTP id f26so4141784qto.11; Wed, 21 Sep 2022 07:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:from:to:cc:subject:date; bh=T4MRIg2amNPk0okRjieG1Oas8X2+PWIKZP+dt1BOYDM=; b=ax3vK7A0nQGNEl+2IzvUxm5YxtqY18wTTmzis0YY7UzXCQKkrdvAxEqSr3N2chScn6 3wckYD+lnepynBeAPfgkYvLMS15cq91myqV1sJSVU6d7j+/oTtg7PQalnWxMJKNMo9Ca kYbUf/iHNdem9CcYQxXFscD43n9VVn029QhAkDNOO1Lj9yqwFrpAYI0OHJk+CunWAfy6 cHU9bQSH87w7YMisS4+Eoe4aQC4w6n5ZlWm50lAElbRGZQJZnOH2flDNtWlOG0C/l3Lo vCuF2ELz7wuMaqT/DCzIgsN7ZQF/ADvC1CEePrjYrNX5IMN8+XRWO5IinL80syhcVC7d wQrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:x-gm-message-state:from:to:cc:subject:date; bh=T4MRIg2amNPk0okRjieG1Oas8X2+PWIKZP+dt1BOYDM=; b=Y5XoP5w6kVrUtvgp8AkEx4PwZd5M6JCND3Nq6x8iJq73ktNvSQlNRNHqQvwcn42k0b ++Zn1gk02mf/i7898lnW1THEwXZBXoISL64Tw56qFjzlFq5imf+mZC3zHelrQCfH6GUq /d0iiiQzSdgm6SVElhtPoxhQmx1FBFuhkBMzB4kv6gXR+IhRLxwowFwupWN9IdtWCfUh 9ZNOCE82sc18JwvWvBlrMWCDLr2mDyrKUWUHhTeYis0K2uzJubcex3hPBCJOB3AT2OyR heF7VliRuQoskqS0fX1uCLQSGiY3wr/7cSvR+cWkpfBhXgwlu5zVf9y0HGyYRP8t+7zM 7hZg== X-Gm-Message-State: ACrzQf0LTMpIV0uI8Rnca2xPbiagQubJlp7XvJgSQiFf7V6en4nGTH7H yAVNeNFZwMbSMoFWltpdc8U= X-Google-Smtp-Source: AMsMyM5NlAkPbsiylhafIJTvP01gEn00rCmob8ynWjS6qTsX71vjvh2xisYRg7gT3DcXeAK0TjUTOA== X-Received: by 2002:a05:622a:60f:b0:35b:b737:bcbe with SMTP id z15-20020a05622a060f00b0035bb737bcbemr23985839qta.149.1663769983741; Wed, 21 Sep 2022 07:19:43 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id u22-20020a05620a431600b006b929a56a2bsm1977010qko.3.2022.09.21.07.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 07:19:42 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id DC7F627C0054; Wed, 21 Sep 2022 10:19:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 21 Sep 2022 10:19:41 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefuddgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpeeuohhq uhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrf grthhtvghrnhepvefghfeuveekudetgfevudeuudejfeeltdfhgfehgeekkeeigfdukefh gfegleefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieelvdeghedt ieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtghomhesfh higihmvgdrnhgrmhgv X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Sep 2022 10:19:39 -0400 (EDT) Date: Wed, 21 Sep 2022 07:19:16 -0700 From: Boqun Feng To: comex Cc: Gary Guo , "Eric W. Biederman" , Linus Torvalds , Alex Gaynor , Wedson Almeida Filho , Matthew Wilcox , Kees Cook , Miguel Ojeda , Konstantin Shelekhin , ojeda@kernel.org, ark.email@gmail.com, bjorn3_gh@protonmail.com, bobo1239@web.de, bonifaido@gmail.com, davidgow@google.com, dev@niklasmohrin.de, dsosnowski@dsosnowski.pl, foxhlchen@gmail.com, geofft@ldpreload.com, gregkh@linuxfoundation.org, jarkko@kernel.org, john.m.baublitz@gmail.com, leseulartichaut@gmail.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, me@kloenk.de, milan@mdaverde.com, mjmouse9999@gmail.com, patches@lists.linux.dev, rust-for-linux@vger.kernel.org, thesven73@gmail.com, viktor@v-gar.de, Andreas Hindborg Subject: Re: [PATCH v9 12/27] rust: add `kernel` crate Message-ID: References: <87a66uxcpc.fsf@email.froward.int.ebiederm.org> <20220920233947.0000345c@garyguo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 21, 2022 at 02:42:18AM -0400, comex wrote: > > > > On Sep 20, 2022, at 6:39 PM, Gary Guo wrote: > > > > It should be noted however, atomic context is not something that a > > token can represent. You can only use tokens to restrict what you *can* > > do, but not what you *can't* do. There is no negative reasoning with > > tokens, you can't create a function that can only be called when you > > don't have token. > > On the other hand, it ought to be feasible to implement that kind of > ’negative reasoning' as a custom lint. It might not work as well as > something built into the language, but it should work decently well, > and could serve as a prototype for a future built-in feature. Interesting, do you have an example somewhere? Regards, Boqun