Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.176 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796404866; b=P9l2Zu2PnQCuolkyaYs68s2X+8RpZ/Mu2SLowSgT7xOpX8i1/eM6qR8hlsh3wYSZoaWr P/YknEpReR3dq4jgajsf5BRCJTlhcqta8paHGLBqBvUpDwoUKWsdAwcsoYSk0ZzZoGIaR GlUFQqGGkW+lbHIX9C1Wxs7t0FwQ7ASVLaRRxcwFVDQLAYlgxcNgqmOsOv2EwkQgMC9Ve f6tJuOSZk3ofN9a0rlYBF+ZZSYZSKqKRM6wLRZ/XcHud+eKdollD3D38Qq4r7rUewcpry AEaLGRq1abmsi0tG9iLoDTQFwsX0OP533TrMSytSeQn8pKpWw8VmwFmE4cRYvupVG6w== 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=g2sk9XjjGSutiHi5WjRHsbestUHYIuW3e2lHJdPZbOof/8UReD++bJobRFpzPtNg4TmT 9nnMSb6T3p+Jx9ZC32OpFjd1hzaYiRtQ+mx6FlvBoShllZL3uGpN9BOoo//EAx6k8iv8F XRolokr49PRFAEBbwHs2VLbsHlj0lpPxNUf15OBGHf6rbtetR/td3BCkNGrWsuEKirs4I Vfg/ZnJYp3jv7eSKvagbR9CRuhlL+p3FAb2W1UsnpFsUpj+SbFZeJQgHJLC1lGt5CvWeb 4U5Ftkmjh9iP/x6SZ2vAJZE2Lh96L8i2cRLs5ZATUtZ5/vJXbQJqzQHD2RC888Fxplw== 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.176 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (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 4739C606A32C for ; Fri, 4 Dec 2026 17:21:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4739C606A32C 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-f176.google.com with SMTP id 5614622812f47-57ed36fe5eeso668650b6e.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=IL2xNHOMxUZeYa5a3LQAy28Uy4mNqkKSGrZh0jhzpGxeKCwIv20jq7IJ45xmI3zBSP 3DHnAaQNJw0cfaHCEVH218PPGlawJUAU0g3dSceslm/EHKPy0vCQ9bUtdXPX8Pp6jBgF 5Iuvs9ItoALOX+ddUjX1z7ySKcG5cwSW+9l+G3svWfzgl/bKWj1tD6jPxKrpSG3mSI2s zCRVPvoM6Nk6zuGxPqACsrNm4vPZsKIJUi/nzE7xYVfL2B/3eb7wCPKhuWlgkY/1kfZ6 XurhxExlqa0rNr5XYcIWl5DnQKFjgJKk/YcmeWKOMKwC1WW1whv1k6L05eh7Qs5XPPVB 8nmA== X-Forwarded-Encrypted: i=1; AL+hErFGqb1PknfaJt3nXDt2ViRB0TccPwEPFznfaJerQCvfke0quogyUeKQv8wR5KuyroILn7M=@vger.kernel.org X-Gm-Message-State: APuU4Z/q/IZKO4/15aj9Xc/xlkbmf5Io2yJtyMJ6OW07pZd3sSBkYXEs 4F761o4jAUEra8IJ0B3ojSaN1w2RBnmiGDCgVojAFr9vRmxzhx9kS0TbML2hRuIqZsA= X-Gm-Gg: AZFdTZevoF+sMI4yMYgdA5RuvsVRuhsgKrmBgE3tFF4hg14+OjA9JocwUFF/5TUoiuu Ps+wmGbHZEuKSdebTx2tME20OUimKdIY5Bp1h4G9L+COamh8kuYsNiwbtg4CD89qf7L4RzS8Ian ULZim89yB6kVNdz3kpQ7HIO8+yvEQp0Yfg8J2a/xUxQAmpQ7PCXPFRE/4MtDyTXOq/1UORIHTSY bw65C76uwJev9KmqObYfC5M6xhWqW5yizmJT4vjcehgcO3muIXnlMf/O6GzsDI5jgB41UkozU9F QaZ9/7lssCDI9b4WzRGgGtAzqwI1Gm4gON7mATYgj+WTIJ7kUcJdmmoZnb62DvqVBda3xba3/aX kbj0dy3wrACf9rH8AOqYpVBJoAx9g2d9UuX3LHB5otEeYi+LhEs769c175UcZx+9m6mar58e6r0 Hzdruq+/TgSWa2e8CRMySv1Ni787pQvhMHsT7aYNb3826jMMAKByOEkJJYrE43IAsAd+NiI8/sZ eWXubyFHiIRNMmtrxwkCLh4zhHGD+I3FdgpI7Nw0qKmIXGNPoRbc8boncVvvmlXCM9lpHUvb6Xa Zw== 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: kvm@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