From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAE85C072A2 for ; Thu, 16 Nov 2023 03:28:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344910AbjKPD2R (ORCPT ); Wed, 15 Nov 2023 22:28:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235701AbjKPD2P (ORCPT ); Wed, 15 Nov 2023 22:28:15 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93FE9D44 for ; Wed, 15 Nov 2023 19:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700105291; x=1731641291; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=DhK1ix88G1Yi7MN02s45jcyCSJlvBkl/JOoMUxCCVrc=; b=IW5watGy1x+DTzxKxB1E8b2WyfFfuEdj7IZ1TFY2pAMa6UExksMY/aJd nm5kDgTzgvLGlG/KZZxO9l9LYGosb27gvZpNwrU6hFU0eOJ1+yOWBb0FN RVW86ltcpc5Mc9pp24seqr893zLAU40ON50hrQqHaftgbtUASGnywFkj0 I+uO5S34QLop50f97vilWVxleAmifYX/2S5JNOVtok+MxEjTIZ39jToYr gLteiJyTsTMJnsmsLfbpb37TL0zApAEQAOLfTsQvod81fu7oR+Z4pOH85 ceC0P3wa+uPrvB7ULvP4hHAo2EFgALiC8Z/5NiUB+CcVWR4ggMya4wcOA A==; X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="4132673" X-IronPort-AV: E=Sophos;i="6.03,307,1694761200"; d="scan'208";a="4132673" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2023 19:28:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="765180519" X-IronPort-AV: E=Sophos;i="6.03,307,1694761200"; d="scan'208";a="765180519" Received: from allen-box.sh.intel.com (HELO [10.239.159.127]) ([10.239.159.127]) by orsmga002.jf.intel.com with ESMTP; 15 Nov 2023 19:28:08 -0800 Message-ID: <053e89dd-8de9-43f3-8530-1f65181efd46@linux.intel.com> Date: Thu, 16 Nov 2023 11:23:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: baolu.lu@linux.intel.com, "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/4] iommu/vt-d: Introduce dev_to_iommu() To: "Tian, Kevin" , Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe References: <20231116015048.29675-1-baolu.lu@linux.intel.com> <20231116015048.29675-2-baolu.lu@linux.intel.com> Content-Language: en-US From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/16/23 11:19 AM, Tian, Kevin wrote: >> From: Lu Baolu >> Sent: Thursday, November 16, 2023 9:51 AM >> >> +static inline struct intel_iommu *dev_to_iommu(struct device *dev) >> +{ >> + /* >> + * Assume that valid per-device iommu structure must be installed >> + * if iommu_probe_device() has succeeded. This helper could only >> + * be used after device is probed. >> + */ >> + return ((struct device_domain_info *)dev_iommu_priv_get(dev))- >>> iommu; >> +} > > Not sure whether this helper is useful. This is only used by 2 out of 5 > post-probe users. Probably just open-coding in all 5 places is clearer. I thought it should get more users in the future development. Best regards, baolu