From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796404866; b=DirSg0Yq7PcmNxIyIRBa+k2pCZ0U5jTQytmWmLQqQbjZr44UDxWiaXfg9/8eXFIDi179 gYHWtiw/XiJlgUlmiYj/Uvw9u/IoWFufUK90ruKLR/t7iVwnP9KXqbcFWSdg3nthEbCPH RUQDSf+2cyyjxa/B5qsZ9dKQdwSU9s+3zY7/2xLJgYiCGwj/A7Lk3jP+GZE6ZYew4doXR IEDmGoGsZ8YplyQoaT3cC+2kyzWsKai3ixv/3fgVsMOHKwFAJ7/eWI8TWY9IP17WZjD2K aFuhSN/m675e4Y4k5E9YVf2GEeLB6OaDr4OgH/W3WXp62rqEHUCGxOUQrjiDz3eC01w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796404866; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=SgTdisw4weFFU/SSoSfjlYvmRDI0fwmEGIQGk60hXDA=; b=JkD+BpCzx7Ojo+Oz7CuKpa47MgqWlZWAMEwu8498XxYl+cm14VxVfZ3sl/oK7ls9iOyx JWcQcC1ax+GaaY8/ZfeuweaxlquPJvH5x8L3P3HkJT1etNx+Unf3lwTVeao8yUDuP7vNe yksWO5izqXDK2G9iZNHxHXBjrxVwI3N1ZGCYaKQVCXPwq2nV6AITaai2FDvtb4AFPYAil yDGi3RkAh6/AnOVVorf1SIy7sFj+b9v/G5Z0ssT3RfEyjG2SAcXQsQ+df5Cbs6CvKFC5c 8B1Uj6SubYwSYuwICQPKe7DJuSSD+3jH/VSnRF/NKKU2BhjiHGxcYxBKeYo1gzG8vfA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=gVMbjoJi; arc=none smtp.remote-ip=209.85.167.182 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5190A606A330 for ; Fri, 4 Dec 2026 17:21:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5190A606A330 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.a=rsa-sha256 header.s=google header.b=gVMbjoJi Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-57e47de950fso740261b6e.0 for ; Fri, 04 Dec 2026 09:21:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1796404865; x=1797009665; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=SgTdisw4weFFU/SSoSfjlYvmRDI0fwmEGIQGk60hXDA=; b=gVMbjoJiaei1pmZEHL9sWTcXCM7wfnTvv1VqqoGecO7yJHYu3K0z2Ubw+sTTUEOjt4 rXp9QEaR09zile3HkpUv3mN4K5+o9MRvsuC2qZ24c1VAEU+PojGwaC2mv8ZdFaMhhbBi wf8dMFWSvqPvXqdsxrJJitBB5vHXF2iSDHpfD9SVF3UzoaNujswBYPRHtuAjmiX0sLp4 NSywXN9LiMR5h+U9YGZjF18aBgmWB0B/f2zjxSyA12uiu4rbA5swrJwOusYAXNRa2rdI djnU3mdK1N8cMECzb9L6Hfg1Or1lbnAbsoVuzAhBE+aYCe05uo4gZvOSuGrZnbBZY+HE in7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796404865; x=1797009665; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=SgTdisw4weFFU/SSoSfjlYvmRDI0fwmEGIQGk60hXDA=; b=mMaBCGf+jMoqI8d0nOuLFOWDKKnBZ8qw71iOSTSOhufMGxKsQO7ZCbBsVbCU6u0PMN K4EpeKFsZjYHYvkq1FLfsZfj9J8SLeMAnSUoZjdsh5YoNdComZJBD0ASwvVQ+EWTQfFK +ZQZKRIRcF2KknC5tLsCzMm767nxVvgbzNkxRKlYosYPHSgv8jzoiXlqsh31NexoYWP3 fQ4QWPyCzyFIbBRJ7YetlefDnwr4TzNinVvK4d3NgaFZyu3G+MHfclHwGp3Woh3a41iQ BZ4dBpcV/3fAvi4uO3eoK4cKa0dqCTHMcm+BABv1uEVT0sd9KrZmk5uDgHgEK5LiA9mt nx7Q== X-Forwarded-Encrypted: i=1; AL+hErGAuXS99Dxl/pGTtj4V6lCyosD7KsQiq+TfkBn5s2hznqsLR+ZNOgBJs6UQ0w9JCMLQCIPDeIMOe34obI8=@vger.kernel.org X-Gm-Message-State: APuU4Z+72OB47BDHQygpFIOYGTXPWhZqUvdTEwGLEd9nbkuxQWqVhyt8 ESNZV5/7gqtA/LYTxoq69C/Zzmo6sDpF2YqL7U5o2/r1bb1NurgFvpPt67wyoAMFNPw= X-Gm-Gg: AZFdTZejCoLgVsUEq5L9npbDT7H8jQHW6KcxXo04r7Ikesf3GMX2FeYQhvuR6YvGiZX tX75Kt9Ei2hCdC20qvBdZ6eSx2xCoVBgmepdR0fDIuSDg5qi2CtlSkp5VPZJVfmOfDqWTMSFpyI 0mwxiuG+7cZMa9p3tYgh6RqodokoCSU5M+KNsKFaQ6lCu0qOnZfkFQTDfRUcG9mdYWudqpBvAfS mtl+x89ChxFQXUByMv8j8B45RokbH1ClgV0jpTpAzrcyQFtgDlpwbtJ3UJlqzKEjw3V7/Jky4Gp gtBoDM9qOJ1ZjWeUrcIasfuw3PyncpoHkcL0JL/gO++bMUkC3UB4bUKh32Oj3aIBMUEXCeHjsGx fyp4bsDJtWNx8JnBO2VShOe4tF5tmFxGEGDn6D0C7QK8ZJz+wINIu33OkrfkCL9kZt41/B8EFf7 auaynlgxzv9iBCqySUdZTBfePRa8W+nHRTy4wK96Ff19OJQ2S5tpqq7BS2Obt00mEYiF0PzJUKk LPCVM3DCEx+dpr54R1rkUf9tbmP77dxYYmxfNAN1rmeOaozKz2S13uICODWYE3GRiBuEqrSxAg0 jA== X-Received: by 2002:a05:6808:1a1e:b0:577:2888:47a6 with SMTP id 5614622812f47-57f209213a0mr2240341b6e.66.1796404865168; Fri, 04 Dec 2026 09:21:05 -0800 (PST) Received: from ziepe.ca ([130.41.10.206]) by smtp.gmail.com with ESMTPSA id 5614622812f47-57f1f6a839csm2003312b6e.9.2026.12.04.09.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 09:21:04 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xZWxy-00000009m4R-2C5O; Fri, 04 Dec 2026 13:21:02 -0400 Date: Fri, 4 Dec 2026 13:21:02 -0400 From: Jason Gunthorpe To: "Aneesh Kumar K.V" Cc: Jiri Pirko , linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, david.quigley@intel.com, lukas@wunner.de, ksinyuk@kernel.org, rodrigo.vivi@intel.com, cedric.xing@intel.com, sameo@meta.com, drdeeglaze@gmail.com, James.Bottomley@hansenpartnership.com, aik@amd.com, jpiotrowski@nvidia.com, qinkun@google.com, pgonda@google.com, jic23@kernel.org, alistair.francis@wdc.com, ankita@nvidia.com, suzuki.poulose@arm.com, kas@kernel.org, rick.p.edgecombe@intel.com, elena.reshetova@intel.com, dave.hansen@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, peter.fang@intel.com, jarkko@kernel.org, zohar@linux.ibm.com, yeoreum.yun@arm.com, dave.jiang@intel.com, nik.borisov@suse.com, sergii.dmytruk@3mdeb.com Subject: Re: [PATCH RFC v2 3/9] attestation: Prepare provider and instance core Message-ID: <20261204172102.GJ1074888@ziepe.ca> References: <20261113160838.2512652-1-jiri@resnulli.us> <20261113160838.2512652-4-jiri@resnulli.us> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Dec 04, 2026 at 01:27:41PM +0530, Aneesh Kumar K.V wrote: > Could we also avoid taking ctlv->registration_lock in ctlv_device_add() > and ctlv_publish()? TSM drivers may call attestation_register() while > holding their own locks. For CCA, registration holds pci_tsm_rwsem, so > taking registration_lock here introduces this dependency: > > pci_tsm_rwsem -> ctlv->registration_lock > > CTLV operations hold registration_lock while invoking callbacks, and > those callbacks may need to acquire pci_tsm_rwsem, creating the reverse > dependency. > > I think we should preserve this lock ordering: > > ctlv->registration_lock -> pci_tsm_rwsem > > and avoid taking registration_lock during ctlv_publish() and > ctlv_device_add(). That doesn't seem like tsm is using its locks right. Lets not create another rtnl_lock :\ Jason