From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0954F1E89C for ; Mon, 6 Apr 2026 22:34:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775514872; cv=none; b=I/Ph3X1adw+NOc2M5VyUxcEsbLqBgjy14oBaRumOxI5YrPjQ7RGFSAlrsPikZG45U5kPTRFN6oWXJPb+O84sBirQ1TUTAsJUfaUev4LrqcWQKR3RQiiHkWdQgzkkwAOmD0h9l90uQztGpmspFkq1O6CKKcwLql5uf5llEH4iKFU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775514872; c=relaxed/simple; bh=WFzGTZsHMRrTZNHScHgxIGlWO4YJHCzfNsyWW6bAa0g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GFchBa6rLdkVwQ2a8+/yt7GhRFvWTPNU2WD4xeJfRRkWGOQ9teutK+644MPwC4yuliUiO60N9oDf59VB+wTGnCQQBf9OYJgbbtD18K9E2phD6XWsf0cVWXl4TDdQ1FBZM6FynzXKzmW0jyJhmXZgQZjzNwhgKrJVExpNrNuu/1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=YSRTfdmn; arc=none smtp.client-ip=209.85.222.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="YSRTfdmn" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-8cfc3ca1922so530690785a.1 for ; Mon, 06 Apr 2026 15:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1775514870; x=1776119670; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0zUHeg6fURLNHDdB8I0M/mJi+OaPPUAu5+ZEMzIxATo=; b=YSRTfdmnrMCJRvajaSzETN9qzyr59D+F139hJZjlEfO5Tr8WT1S7wCPibje+yI2EJR C6BwWwH1dvPrFLeVOfkcXg54a7WojhOzwEp2gKJDMhxssJuzTir6f22mH+pz5GuZ9zQh 0eWMubUbMojWmODCdrgxLn+A1fbkaF1claWLNc6Xq4kq+5mwMuzGhTLRbpabbgFBGTmi uqU44ZdZMEyfPg9O1Nc2E4lXUNzc728pG0Gl5m/xUHRKWUr2vnjoGpEC2pBuff9tV91J Ldcf9QwjjbfXA3yxjTDho8AXtp4AaoGTWSAcat8FEdLdri3+i+5/3KwzvdzmuCZEpn4O roHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775514870; x=1776119670; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0zUHeg6fURLNHDdB8I0M/mJi+OaPPUAu5+ZEMzIxATo=; b=FfmORIZ/OEQJx4eE+WcPo+nZksbQZXicoaCTjd3tpwrtP1ODUWlIpN/fJ+kJUgP92f hmXUgHkgOcjXW5aTFO6TCPkkiq2y9f779avjCGyUzuuh3W0KWZ9H5gg92qCHy/yEdIK5 bNXS5brTwrREFGHAcj4UkXd9JMGKquffbNzpdkEBfD3nOT48Ult0GI5bVEr8P+CMIi8K qhGaSBeVFogPNX4CKs+0SHc3j3+EVc2UtQ+YPqU7G25QmSKgHlpH1V8b0jbzBEQSru8+ nxRrkMUUp2+gobb0OVqYWbZIPgChgB+EL7gxR5XI6hiQIRAztUZ/jp3eJpumWgTIm+ht FZgg== X-Forwarded-Encrypted: i=1; AJvYcCUafMn+tdFO33/1LMu98WlSJkFLufW0fwNb+kxNFV8KDE/xQrt0558Ej1ONaqL2C7MNTT3awAyZoLbj9lE=@vger.kernel.org X-Gm-Message-State: AOJu0YwOmfyt0/O5VsUgmd71YIJbSqzf0qlNtCM/1e44reewwLejpats Mt5qm4BcxcdibVy1GlwT4uIwWDk2PWPE576XW5w2uEEaaJIZjB15lFSRH/RxMnT9EAo= X-Gm-Gg: AeBDietYwoLMNqNWURLVMNJdYlXoCCHe8TNBjRMaSYRHDkfz88yydQjbVYuz9j+SJrB xjxBd52gDFPiOGeflS5AYEplgfMVhk9EZT23ewLU2K1Bcf/GCu/Lq1jSEw55LdNOmDvDr4Jp6/M 9irn6k3nAINPLVoGY17//TwpFF7mOHtvKrKK/4PgXoN9oVSAku1dEtPISthyPAwbI1rieTrMmX3 z0Hke+EFsyi7sOGxMi4kLhRSunMhoxJSwtKqt25s/MItVmg6X4E8vYLiMYKcK4KVo3L86gyVht3 MBzQf36dPchSLOxMaYBy0psHboWZpQKxtq95pxb5TDxTtgaJ9MO6Y2vQMDr6i2PO6YjFF8ZLnoP MOIXMTH1VkBdjuGkypQsr04bHCPAThEc5IFsI0dDBVS6X/3QQRxIwtBE/hhLkscTQvmcdLur+hs 04bFavCiM5RWrQje/lnAapSUC4qbrG23TEAGUygeLyHi0d4HpAsuu/FFKAt3r4AE1sqXlFAw== X-Received: by 2002:a05:620a:4096:b0:8cd:9584:6340 with SMTP id af79cd13be357-8d3042ce1bemr2183566385a.43.1775514869776; Mon, 06 Apr 2026 15:34:29 -0700 (PDT) Received: from ziepe.ca (mctnnbsa70w-159-2-73-22.dhcp-dynamic.fibreop.nb.bellaliant.net. [159.2.73.22]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d6339bc438sm600898385a.26.2026.04.06.15.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2026 15:34:29 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1w9sWa-0000000E5Cx-1DNj; Mon, 06 Apr 2026 19:34:28 -0300 Date: Mon, 6 Apr 2026 19:34:28 -0300 From: Jason Gunthorpe To: Raghavendra Rao Ananta Cc: Alex Williamson , David Matlack , Vipin Sharma , Josh Hilke , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [RFC] Observed lockdep circular dependency in SR-IOV paths Message-ID: <20260406223428.GK2551565@ziepe.ca> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Mar 31, 2026 at 10:23:06AM -0700, Raghavendra Rao Ananta wrote: > Hi Alex, > > While running the vfio_pci_sriov_uapi_test [1] on a CONFIG_LOCKDEP > enabled kernel (7.0-rc1), we observed the following lockdep circular > locking dependency warning: This loos more like a class issue, the locks used by the VF driver are different than the locks used by the PF driver, and even though the devsets are shared a devset should never have both the PF and VF. Maybe shifting memory_lock into a different lock class for VFs is enough. However, I think it is a bad idea to hold the memory_lock while probing a device, I'd prefer to revisit f4162eb1e2fc ("vfio/pci: Change the PF power state to D0 before enabling VFs") and change it's logic to rely on a private flag instead of pci_num_vf() Then we don't need to hold the lock any longer than just setting the flag. Jason