From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 5778A161901 for ; Mon, 16 Sep 2024 21:30:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726522253; cv=none; b=TRzwd1DB+MShUQp0n9pDpUUrP2pCDJmY0LlN4YGN4qxj/5ok/EjhXAXlG1Lm4kKlVNI3Mp1arM0DfkwlU/4u47s2VS/BRiOQZ+tfuNJA5NLgcC0ObBx6sppvGWOH7Iur2EYxc1cdBjZC86KhGK7NBIpFcF4kE0T86npGq9MhSwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726522253; c=relaxed/simple; bh=cvT8oPVXSFus+rxmyrqEkFmFSc/qpnaFm1iPgXd45AM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ab3/6y4jsev/fWSfQ1NlXey2oLJZpQRjp+FaeRJxwmoEZrkUbzT37xlnikcEjA6KkHpBw7dWf12BAc08CNnfzUM0KwnLQEnw7QmGw/ihkKZ4AXN+SCr9Dog1D2l657ONSr4svU3vGCI/LM44Y3UynUc8l548MiR6hb18z6kKeEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=RpSwa2Nc; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="RpSwa2Nc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726522250; 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; bh=pU3t4JrwYufwpS5HuhWn0DSSSe4d7X0QkwM0UPBPhlQ=; b=RpSwa2NcCZpQxRUG8157AgWsvBV11BTh5FHcQ0A9hOhwyYbEH0I+X0VfS2SvuB0+VhruO4 NstbIVI9PY/qGaP6w0PUh1R7rJFFWg1q/qGLgcOCAh27OGEYdmHUQySpN5mqJIEvwhDgm8 k5rspksfx1q2+7cndFnT4gDbw9mqkVE= 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-141-UMN2-4upPsy9x3QmFKNh0w-1; Mon, 16 Sep 2024 17:30:45 -0400 X-MC-Unique: UMN2-4upPsy9x3QmFKNh0w-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 1CD2F19560A3; Mon, 16 Sep 2024 21:30:42 +0000 (UTC) Received: from chopper.redhat.com (unknown [10.22.33.131]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1980E19560AA; Mon, 16 Sep 2024 21:30:34 +0000 (UTC) From: Lyude Paul To: rust-for-linux@vger.kernel.org Cc: Danilo Krummrich , airlied@redhat.com, Ingo Molnar , Will Deacon , Waiman Long , Peter Zijlstra , Thomas Gleixner , linux-kernel@vger.kernel.org, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross Subject: [PATCH v6 0/3] rust: Add irq abstraction, SpinLockIrq Date: Mon, 16 Sep 2024 17:28:03 -0400 Message-ID: <20240916213025.477225-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: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 This adds a simple interface for disabling and enabling CPUs, along with the ability to mark a function as expecting interrupts be disabled - along with adding bindings for spin_lock_irqsave/spin_lock_irqrestore(). Current example usecase (very much WIP driver) in rvkms: https://gitlab.freedesktop.org/lyudess/linux/-/commits/rvkms-example-08012024 specifically drivers/gpu/drm/rvkms/crtc.rs This series depends on https://lore.kernel.org/rust-for-linux/ZuKNszXSw-LbgW1e@boqun-archlinux/ Lyude Paul (3): rust: Introduce irq module rust: sync: Introduce lock::Backend::Context rust: sync: Add SpinLockIrq rust/helpers/helpers.c | 1 + rust/helpers/irq.c | 22 +++++++ rust/kernel/irq.rs | 96 +++++++++++++++++++++++++++ rust/kernel/lib.rs | 1 + rust/kernel/sync.rs | 2 +- rust/kernel/sync/lock.rs | 17 ++++- rust/kernel/sync/lock/mutex.rs | 1 + rust/kernel/sync/lock/spinlock.rs | 105 ++++++++++++++++++++++++++++++ 8 files changed, 242 insertions(+), 3 deletions(-) create mode 100644 rust/helpers/irq.c create mode 100644 rust/kernel/irq.rs base-commit: a2f11547052001bd448ccec81dd1e68409078fbb prerequisite-patch-id: 926565461e47df321ce1bed92894cc1f265896ef -- 2.46.0