Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp489573lqt; Thu, 6 Jun 2024 09:15:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLeJYVo0Q6AjEvaNcZbbJ17Q//3MDougVlcgAizg+4xIzukQOorZF8yaB6l0Y5QlH61H1ZYjMn4M1Js8peSXhitGGRwYAgLmo4eLByWA== X-Google-Smtp-Source: AGHT+IEPZ4beLVq9h2EaO3spoKlmGWgoHF842EjMOl3No/aUDdglHGl7MxYt6p07g3Ws8YFjUlnc X-Received: by 2002:a17:902:c947:b0:1f6:2964:179e with SMTP id d9443c01a7336-1f6d02ecf6emr915625ad.23.1717690513697; Thu, 06 Jun 2024 09:15:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717690513; cv=pass; d=google.com; s=arc-20160816; b=DVx3YfqSBjllUoM3kgtCWlfQr5oS0edGwWHwTE4AziIXLB+rTvajofFL/isDqCx+xe EwGJgNicn0mq4WsZKmpD24/Rej5H4bg2phBQiQOui7E2YQ7I4Rd+xJv902T3maa+0Yx3 hsypC5JsaHkCr4dJTCMPzzHXmc6x3S0Zu+3g2BoM/uxWXu4e59yhNBIxGaSHqRWmAdsK oJbFgKbBIYe9rGmKKFYh6MT4Z9Suiz1EiY8qaWn+9g8UdwAe/jF+OSnfQfJI39kQQ7R8 Ef7MqzN+dWL9hjtCvLEnW+IlKMfyheYfXeXfgCPKpwh2e37tAJPeJYHIj0BUea+oILtE XtPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=TGOtDX/hVqo6cbw8vNdA3nnFqPx9qtlv7rQ5ID5AYkY=; fh=XE3UDgawnS36jgWQ1qqJG17ClqW+gUU7X1MwxvWftWE=; b=xQOB7WrBeplQ+PJlo3OZlmf+17Qe5MYQpDFIPM1aNCynPqIORqOQa+i6dQVe8Yv3N7 X57E/cmphytjd2M4zSSqVB/3MW+VJKCnqbPWOdwofoOypR4KLTyVWR2X6dKSLzY0f11C pubNgTg5as8w5hlFzBDziiTmS0sL91RZNM1dmT5Q94PUNP70ooCy2lSO0StWI/SEAqwi MVshZY0DOsAcxdfqucnbJGBAN888V7xBb00D9Nu/F1lT+pa9/+iGZeW4ekwKfhNfJoN5 w310ziiEoM+9FNUTpS4gBw9Af26Sq86rptuVPNBfdiniQU/jZaLigblivMCp7u89mbJy RMQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=OFP0rCXe; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-204587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd81c904si13020325ad.532.2024.06.06.09.15.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 09:15:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=OFP0rCXe; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-204587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BE436B28F8A for ; Thu, 6 Jun 2024 15:37:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A42F1974F3; Thu, 6 Jun 2024 15:37:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="OFP0rCXe" Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) (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 A515D1E507; Thu, 6 Jun 2024 15:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.114.26.122 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717688250; cv=none; b=pdy3dUQD72u3MCHx+GpjVSBw7kNUUwTTkBQJzfZaDLzVNPSomG2SxUOe5kW21vOdwSUrOytahlncIgg/51QmoBJDwYnIg805EqIhlcrx+zEAiCaF6aVqbu3zs7w0OjeMl78XxIkyqxF9C+ysof5pC4FT1RKZsFVIp4Hs7nhCfSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717688250; c=relaxed/simple; bh=sERLUi3uEU0Qc9/KrbcfY5lJQfKzvFrkjGp5BDt0QXI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MFWs/hfXiQZTFlvjodjFHNBBlQ5k9q6shZ2LnBbUOT/jyIDdHfKIrm9Kv0ZAVw+o55tfRSWDJ6R8vJunYrgX6gDkMuqpvLe/8q/6zG/8ix8HX6BBQP41/kCugF6P6xUFlqT9J+lxItjnOAItrHdA9Z1aZzAQZceei9Z8rNr/jw0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=OFP0rCXe; arc=none smtp.client-ip=167.114.26.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1717688241; bh=sERLUi3uEU0Qc9/KrbcfY5lJQfKzvFrkjGp5BDt0QXI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=OFP0rCXeZm7bkwYrqyCIbIaVZQEJeqlhiY+6svO8CIRGmigXQu+Rhwh1QrwidlnSQ XGtlZ+KcLwx9ZA3/aNWZ68wlOdph45Z6tg/59oLXiIKsD3cluTup8zupcPs6JDXGlo 09hd9dfVI6w6z/FCXAVmVbDLGmmbeEHc0K+qaKPqbrGdFxleN65lUCEXemHhKNiqcg iZISPQ4VZ4LAVKx4Y/W0dRHkYjgmuw72eppevBkGeWY0tl4a5ZUXPeT/8rkHJNrlQb YWQQ91+QCy4C9zg6toM9zODJfPg3eXR5cSjwRb893gtF6DbD8oYxMlZpWNHjiNTKch 3oZIQRoj7QmZQ== Received: from [172.16.0.134] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4Vw7k917bXz12pf; Thu, 6 Jun 2024 11:37:21 -0400 (EDT) Message-ID: Date: Thu, 6 Jun 2024 11:38:10 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] rust: add static_key_false To: Alice Ryhl , Steven Rostedt , Masami Hiramatsu , Peter Zijlstra , Josh Poimboeuf , Jason Baron , Ard Biesheuvel , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg Cc: linux-trace-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240606-tracepoint-v1-0-6551627bf51b@google.com> <20240606-tracepoint-v1-2-6551627bf51b@google.com> From: Mathieu Desnoyers Content-Language: en-US In-Reply-To: <20240606-tracepoint-v1-2-6551627bf51b@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024-06-06 11:05, Alice Ryhl wrote: > Add just enough support for static key so that we can use it from > tracepoints. Tracepoints rely on `static_key_false` even though it is > deprecated, so we add the same functionality to Rust. > > Signed-off-by: Alice Ryhl > --- > rust/kernel/lib.rs | 1 + > rust/kernel/static_key.rs | 87 +++++++++++++++++++++++++++++++++++++++++++++++ > scripts/Makefile.build | 2 +- > 3 files changed, 89 insertions(+), 1 deletion(-) > > diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs > index d534b1178955..22e1fedd0774 100644 > --- a/rust/kernel/lib.rs > +++ b/rust/kernel/lib.rs > @@ -39,6 +39,7 @@ > pub mod print; > mod static_assert; > pub mod static_call; > +pub mod static_key; > #[doc(hidden)] > pub mod std_vendor; > pub mod str; > diff --git a/rust/kernel/static_key.rs b/rust/kernel/static_key.rs > new file mode 100644 > index 000000000000..6c3dbe14c98a > --- /dev/null > +++ b/rust/kernel/static_key.rs > @@ -0,0 +1,87 @@ > +// SPDX-License-Identifier: GPL-2.0 This static key code is something that can be generally useful both in kernel and user-space. Is there anything that would prevent licensing this under MIT right away instead so it could eventually be re-used more broadly in userspace as well ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com