From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 860C919E7D0 for ; Wed, 21 May 2025 15:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747840156; cv=none; b=eCRIv2TdQOtJAFUwQBwVdWn5o6RwzE1izUqsAS/g2u9LAlOczRQ2LCTB2fCjuwB6ZgvtWCBP2bUHMw8mHdpgq75+WP7jMOCrQr9XepB388Hi42SA2UkuCGO530U7w+naAsU/ao+RGiFWRiSGAceQ6Gc/IaJlH0Ys5RTKLi+M4jQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747840156; c=relaxed/simple; bh=oSM7dC8BeF2n+l+fK5etAN8b2GMpufWdeSoyecVxaXw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HGtgIaAjBHgiUOOnXqkNWEMiiqKZTlDwIZuNO+QvvlqLlzPrEmnqDIUa0QWeVWVjzxKDIZNF21x73rdzHpAsa8UqQAzcJFnDn0Ru6aTjqIEHUU/a2R4ZWuppEgL440mVqmGpyYUQ05JBVaDzyttbXSgPKwMnVh/gwZVUNvdUjGM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UvpSBcVC; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UvpSBcVC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747840153; x=1779376153; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=oSM7dC8BeF2n+l+fK5etAN8b2GMpufWdeSoyecVxaXw=; b=UvpSBcVCVhs982l6xeWL2CptaIn1VF6Is3mHgfZsLKLqLuM3ZC2X/ge6 CT31JBbYRjqz/USO8tvFMex/gXrJh0+a2fTvxpkN7luZmEPQgf+eIPqfk KKq1elzJh0he5i7w7zqx4dw9zlYLQ5sAEGe5oIc+lYs52apIahInAHm82 QdppayLvy2prltutpVhJ0xxPPOjyGcSHAOLXsh5X6cOY9XxEwnAbztlTz keEN6tOQZeO+8WILsWRfPNTPQlxPhJPgyaNYSMYRfvLUCgHiXWk5YR5D6 zO5Yr+xxhpnVD+aXSMzyRsvBhOgw0frrxIUZE3U+5VvOfdMyS1EnIoVES Q==; X-CSE-ConnectionGUID: PkxUNjcXSWC7KlK2or7+cw== X-CSE-MsgGUID: mBtjmmKaQHSrSzh6/Zygag== X-IronPort-AV: E=McAfee;i="6700,10204,11440"; a="67381228" X-IronPort-AV: E=Sophos;i="6.15,303,1739865600"; d="scan'208";a="67381228" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2025 08:09:12 -0700 X-CSE-ConnectionGUID: DDhonru9RjKYKiuH43o3HQ== X-CSE-MsgGUID: WjSIjTrkRSaCGrey4pBgWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,303,1739865600"; d="scan'208";a="163388024" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by fmviesa002.fm.intel.com with ESMTP; 21 May 2025 08:09:10 -0700 Date: Wed, 21 May 2025 23:03:15 +0800 From: Xu Yilun To: Dan Williams Cc: linux-coco@lists.linux.dev, linux-pci@vger.kernel.org, gregkh@linuxfoundation.org, lukas@wunner.de, aneesh.kumar@kernel.org, suzuki.poulose@arm.com, sameo@rivosinc.com, aik@amd.com, jgg@nvidia.com, zhiw@nvidia.com Subject: Re: [PATCH v3 13/13] PCI/TSM: Add Guest TSM Support Message-ID: References: <20250516054732.2055093-1-dan.j.williams@intel.com> <20250516054732.2055093-14-dan.j.williams@intel.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250516054732.2055093-14-dan.j.williams@intel.com> > @@ -573,10 +690,13 @@ int pci_tsm_bind(struct pci_dev *pdev, struct kvm *kvm, u64 tdi_id) > return -EBUSY; > } > > - tdi = tsm_ops->bind(pdev, pf0_dev, kvm, tdi_id); > + tdi = tsm_ops->bind(pdev, dsm_dev, kvm, tdi_id); > if (!tdi) > return -ENXIO; > > + tdi->pdev = pdev; > + tdi->dsm_dev = dsm_dev; > + tdi->kvm = kvm; I think it is still better that platform TSM drivers assign these fields in ->bind(), just as pci_tsm_ops.probe() do. It is inconveniente that struct pci_tdi is not initialized, then these parameters have to be passed again and again between functions. Thanks, Yilun > pdev->tsm->tdi = tdi;