From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796404866; b=baT3Vnmz6t9IVv0DTuIWIyZwWKxNSUr0iY5dn27ND2nI77d9Qpv9wNWtz4XcwnEqT4dR dX4+0HOev0f4SMuVzs/fepGm3aQVmU4T8DDpTpReY1AqEDCd1hHz2g/IqebnigzhapMzt HMjg20LGctUxoEmFuxnuCWb2pFpSu7GYyQ73HmoTCT7YhUvR+BjatQ61LCDNE/EdnsTx6 kLd017SclBIsjbiJngQ2uHzoslrpHY6Bim8lA5HIbpCcrXpxQmQt8hksdosWHX0SW033B Cmo4xm6CAzkAzZOaajbY/ALCMiKpBjWQslFRUlDsYlfqKcbQaaUv4WBsaz/syWHehfw== 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=TJuz3HMdlCZIKcWhjAzOpmZhBA5fTTjlm7LIoK8/UCh7hkDXYrkKHQ3maQx/U9XI2qVd rtn+0jcNIlSiXQTG8xvNkQD6ya1K1Vdr81C60pjRzRBFC/f8oJZ7dyoqY64NG68cjS/QJ CRH8UqPDpPHYpcsixBT+9I4RfCcbQHfWWl8IdD1bnf5fog51KyocoQfWYarpv1BVANTST 6Vs1J8qALZvETiFTzRHGRrpGczyrtPCavhBQ4Y6Kspi1ein6syZKinp3Xghl9WbVMJZva sspoMxtXNn1aeuR0gZEg33drN0+y+1uLzGfh47jQhwWnEnUmk9ktUKvkOGjNgefoG/A== 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.175 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 432C3606A322 for ; Fri, 4 Dec 2026 17:21:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 432C3606A322 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-f175.google.com with SMTP id 5614622812f47-57ed36fe5eeso668647b6e.3 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=J3YJlMELIvNFKZZJ6fuQwRkqL5DzaxHNBsOiAmuh9ZGWGX2FP+ldp182fy+E9aBeNT T6pYy6mJeqSCNeI6HpGFozzhS3+h0ZbvFWi3qMFMrDybEkMot5ixE4gvaAvq/Yf2OPNo lSirae/DKvlMQj03DROoESMqXVcfq25lbP70DohILG+K1dMn2y84viWZQMjOMT8wH0v2 e/9yrbicP73CPJVa/6b0vGAlU1VYSyNb0Or77O21aAbkGWxnuZMqUeIxsobJjhF8Yv6X RacnNNHwmqNR972J+h0ckiN5jl4kWdJmKwWxuSdvCC+/iJWUsX3sxCcr6XyU+9i4jTcm dPCw== X-Forwarded-Encrypted: i=1; AL+hErGuvFWHzomlU27tMqW60yD2ZceCOgBmwhOefEU2T/4rnYNkZ9T9nAtfvNm/z/8PebMwocJ++88J4mE=@vger.kernel.org X-Gm-Message-State: APuU4Z+M+VrkGy2M4htUCc0PMm0hF90GmzAR02na3D2FFTzQWJadE0bR GOAHl8YCF52YjVYB1terdVrT3NdOTSuw1+w/Y5s2mA3V0aShi52HKnWENuwB02s06Mc= X-Gm-Gg: AZFdTZdzv+B0QMNXcPcVHi4s1QXD4LqVz1XD5L8ZnGifkbn4Kq2k+vwewoyZd2EUw1+ PUUc0odg1EWKQdS3hbYIxp4LqtUmJgKwyh6lhCutiGhECFcJ+WsTfXcJ8sXzsVuzTqIVoZUQXNV HIwpYBYVZVfq6KJVCLejAihcicrhTfaxQFYxyZj45V/ZHJM98ElCZR+jBFy9iHEGQdQeJZo9CZ6 bL3WB1RtwEyczpfaROFhCzSo2tpOedKOLw5zeGJ+UZhJiM7s7AgNnUegfLSL+kkiS+S8B8VyZFf 55vfaEW3cAvs4gKQ4XLNYMf/m0wpCStcXineywwHoPoOTZnmhCeCAXVCgfETiwUZ1bbch9OttIz l6ModjtWbClQmht4rYJgB/dKwBYxr46OQvXirGMAxi0CIEx+tIhIsStkmVn7h+zW9lFVBNhvT69 zPPJ41pI56W4Qi5YHgQuTxy7rVZMsslOmqkc2r5VzE/CCB1KbVwU9259FIZPZ2YmLyz6w9JcGjN SmJ3ZEdgdYz+N6mv/FYqdguPp9MVi6GTft/wtDmmiYM2sHCstjKs1wDMuFcv653NDv5CJG6aZeg Cw== 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-api@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