[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1460dd28-7441-4bbf-8b48-ab215c195425@intel.com>
Date: Thu, 5 Feb 2026 09:58:16 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: lirongqing <lirongqing@...du.com>, Jarkko Sakkinen <jarkko@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>, Thomas Gleixner
<tglx@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, x86@...nel.org,
"H . Peter Anvin" <hpa@...or.com>, linux-sgx@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/sgx: Fix SRCU list traversal
On 2/4/26 17:53, lirongqing wrote:
> Replace list_for_each_entry_rcu() with list_for_each_entry_srcu()
> when traversing the encl->mm_list protected by SRCU. This ensures
> proper synchronization annotation and avoids potential lockdep
> warnings about incorrect RCU usage.
Does lockdep trip on this today?
> The list is protected by encl->srcu, not RCU, so the SRCU-specific
> iterator with srcu_read_lock_held() annotation is required.
>From a quick look, list_for_each_entry_rcu() still seems *really* common
under SRCU. It also looks like list_for_each_entry_srcu() is a
relatively recent (2020) addition to the kernel.
So, this wasn't a bug when the SGX code went in, but started causing a
problem at some point? Did lockdep add some RCU warnings or something
that made this necessary?
The patch seems logical and all. I just feel like I'm missing the bigger
picture.
Powered by blists - more mailing lists