From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 013.lax.mailroute.net (013.lax.mailroute.net [199.89.1.16]) (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 C8CEC2D5C83 for ; Wed, 25 Feb 2026 19:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772047637; cv=none; b=q2L8UiOHYWNp+g5Hb9SIabhwfvx9Fd1X+Zty0wOBuOYhhMFgYSwIw9jm6GukNRqTu0dqgW6NGleidEKhKG6xDzyzOSdlpm//8KaMld+YGIa2QgYBwNMk0AUkD4l1kNtx0+TR6yI+VRp1r20oPms5tZIdRmXqmZBsGjM5q3Rb5C8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772047637; c=relaxed/simple; bh=VaWv9wgeIHBt6o5hJJTSX2kQPPEJ9/uAqI1Up0laY88=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eRmq8EBNRDMAMa1uwuxPrP8YSUoHP9/1GzgCaNUw+wzuTNUaPrQAY7hHcuxcT0QL9moamXba3klIJpRGZ/e1Jh5Umz9T7vzswl4A1icbcQkos5lAg1oR9iF2IlO7TqJDxanFXCdGOYyiPYtjjrr6mD8TxFMJg8qFqQpIyBopKd0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=h9TfBmPF; arc=none smtp.client-ip=199.89.1.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="h9TfBmPF" Received: from localhost (localhost [127.0.0.1]) by 013.lax.mailroute.net (Postfix) with ESMTP id 4fLl373Hh1zlfpM9; Wed, 25 Feb 2026 19:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1772047632; x=1774639633; bh=ZfgDnaf5E45p2vThB9fCKW6/ /k3zghiBGjtQ+Gm4WAU=; b=h9TfBmPFsHnL9CMebqd6uUAMSr1clYARzRTb6PmS vVVNzTnPKSRXcKt9QTAVS/P3mc66QISeOxGMbNVXRExL4s2gh0erZcdRAejdRnfm Vfi+qXtDgvTocjO9g6m8HvrEUIPlUxQF5Cnx/l26hWKWlbQngZJqrK++77mc64iV ZSMvBPKv3KkuNeVE+K8o+eTjJIJVn2YCU3xhVYjvIIkqipgWuU3+N1TtKHmuHq+J OJZjn95b4BjTD6h2BEzdcjxCdaEDdXkkELEoAYSHEuyoAXfmt11Tz1dgKBConaS0 Y/jk3clsPOWE9T+s+hnZr28GvVrJnwEUOiYJgBbHRc4OIg== X-Virus-Scanned: by MailRoute Received: from 013.lax.mailroute.net ([127.0.0.1]) by localhost (013.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id EphYv68RcUuD; Wed, 25 Feb 2026 19:27:12 +0000 (UTC) Received: from [172.20.2.156] (unknown [4.28.11.157]) (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) (Authenticated sender: bvanassche@acm.org) by 013.lax.mailroute.net (Postfix) with ESMTPSA id 4fLl2z53Xlzlh1T5; Wed, 25 Feb 2026 19:27:07 +0000 (UTC) Message-ID: Date: Wed, 25 Feb 2026 11:27:03 -0800 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 v2 4/4] Revert "lockdep: Annotate lockdep assertions for context analysis" To: Marco Elver Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Waiman Long , linux-kernel@vger.kernel.org, Christoph Hellwig , Steven Rostedt , Nick Desaulniers , Nathan Chancellor , Kees Cook , Jann Horn References: <20260225183244.4035378-1-bvanassche@acm.org> <20260225183244.4035378-5-bvanassche@acm.org> Content-Language: en-US From: Bart Van Assche In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/25/26 10:40 AM, Marco Elver wrote: > On Wed, 25 Feb 2026 at 19:33, Bart Van Assche wrote: >> >> lockdep_assert_held() supports all data structures that have a member >> with the name dep_map. __assume_ctx_lock() only supports data structures >> that support lock context annotation. Remove __assume_ctx_lock() from >> lockdep_assert_held(). This patch fixes the following build errors if >> lock context analysis is enabled for the entire kernel tree: >> >> drivers/tty/tty_ldisc.c:451:2: error: call to '__assume_ctx_lock' is ambiguous >> 451 | lockdep_assert_held_write(&tty->ldisc_sem); >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> drivers/tty/tty_ldisc.c:451:2: error: call to '__assume_ctx_lock' is ambiguous >> 451 | lockdep_assert_held_write(&tty->ldisc_sem); >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > I think that's a hint that that we should just ld_semaphore a > first-class context_lock_struct. That will enable the analysis for all > ld_semaphore users. This seems to be sufficient to solve the build errors if patch 4/4 is dropped: diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index b5a5f32fdfd1..9be0a2c8bb40 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -192,6 +192,7 @@ struct kernfs_elem_attr { * accessible. Dereferencing elem or any other outer entity requires * active reference. */ +context_lock_struct(kernfs_node); struct kernfs_node { atomic_t count; atomic_t active; diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index c5cccc3fc1e8..2977873b84c5 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h @@ -14,6 +14,7 @@ struct tty_struct; /* * the semaphore definition */ +context_lock_struct(ld_semaphore); struct ld_semaphore { atomic_long_t count; raw_spinlock_t wait_lock; Bart.