From nobody Tue Mar 3 05:22:16 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 AC09433B6DA for ; Mon, 2 Mar 2026 23:22:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772493737; cv=none; b=oJ8a050GoB0egxpgzIPOW2kJkgDHhIZAGBhtjkXEwsFiEffBiQGSYshi7/6rgLFqiX74/ZsuXBVLxxk122c9kHqtGDwvkXYRHJKyvwHNRNzc5UHQtXD+K1px/Wb/I4NhPvohaIcU7z/Xuij9bCxo4UxwAQBNKrobFrwMWknXves= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772493737; c=relaxed/simple; bh=bvCr0Saitthxj2ep+wh5L/uK1km7wUmINqCqZdFngSs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tGrOIxdUwlw0M+18SuslLKVjZUKcbiamSjBuTVfOmFQkoe0dXLeJkSDWSYRE+4x9GDB9yvFkJCZFVByuuGjCnPvmszwqksM9lHedpg4H/lgAxILziVkBUDb28AonjPvfADpFxRN4ajwY7uVFP775h7XOehWYJYXZS84DXIKYCUQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=E4NKFZvj; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="E4NKFZvj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772493735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cw1104JwFhpiodp1jbnaW3D6iNV0JBRJeYkCVp6AF2w=; b=E4NKFZvjlm5bBefTs8bP6bJQbRmpvveikVuo3Ep/Psvtr30yyqtiwsPyfg/VOWx8/2eNW9 NvkNFnHwV4NK1tqpxeJKpv7KOD4fFi66rGqOdrmC+EFCiNapfvdfWEmKvwMigS+kMhDyOZ VcXRSSpd+ug8wuWjJ+N3PJ/Vo6O+zQ0= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-5A9awEesNkyHbHOJqxfVgg-1; Mon, 02 Mar 2026 18:22:11 -0500 X-MC-Unique: 5A9awEesNkyHbHOJqxfVgg-1 X-Mimecast-MFC-AGG-ID: 5A9awEesNkyHbHOJqxfVgg_1772493729 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2D2BF195609D; Mon, 2 Mar 2026 23:22:09 +0000 (UTC) Received: from GoldenWind.lan (unknown [10.22.90.7]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DF9A01800296; Mon, 2 Mar 2026 23:22:05 +0000 (UTC) From: Lyude Paul To: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner Cc: Boqun Feng , Daniel Almeida , Miguel Ojeda , Alex Gaynor , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Andrew Morton , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long Subject: [PATCH v19 2/5] rust: helper: Add spin_{un,}lock_irq_{enable,disable}() helpers Date: Mon, 2 Mar 2026 18:16:45 -0500 Message-ID: <20260302232154.861916-3-lyude@redhat.com> In-Reply-To: <20260302232154.861916-1-lyude@redhat.com> References: <20260302232154.861916-1-lyude@redhat.com> 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 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" From: Boqun Feng spin_lock_irq_disable() and spin_unlock_irq_enable() are inline functions, to use them in Rust, helpers are introduced. This is for interrupt disabling lock abstraction in Rust. Signed-off-by: Boqun Feng Reviewed-by: Andreas Hindborg Reviewed-by: Gary Guo --- V18: * Add missing __rust_helper annotations rust/helpers/spinlock.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c index 4d13062cf253e..d53400c150227 100644 --- a/rust/helpers/spinlock.c +++ b/rust/helpers/spinlock.c @@ -36,3 +36,18 @@ __rust_helper void rust_helper_spin_assert_is_held(spinl= ock_t *lock) { lockdep_assert_held(lock); } + +__rust_helper void rust_helper_spin_lock_irq_disable(spinlock_t *lock) +{ + spin_lock_irq_disable(lock); +} + +__rust_helper void rust_helper_spin_unlock_irq_enable(spinlock_t *lock) +{ + spin_unlock_irq_enable(lock); +} + +__rust_helper int rust_helper_spin_trylock_irq_disable(spinlock_t *lock) +{ + return spin_trylock_irq_disable(lock); +} --=20 2.53.0