Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3025360rdb; Wed, 15 Nov 2023 19:28:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6XG0BsFT2okEoww0LURLigpGgUBLdKnTmTeeuyUVjI2Fj+z5orKTTBdbOGyNsAW8KApBf X-Received: by 2002:a17:90a:1789:b0:27f:fcc8:9196 with SMTP id q9-20020a17090a178900b0027ffcc89196mr13492327pja.32.1700105339665; Wed, 15 Nov 2023 19:28:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700105339; cv=none; d=google.com; s=arc-20160816; b=QQ1LLSM30RYjPMWpRJD+iIRtRRMUZ5ZbxlkfKhzud2VbDm40au4R/PuU75pfr7wQoE hEHYfB+z6GwkTzDR3xuecMd7SoV83tk8QLIkaQKjqCCUlYbZSQAkEmEPUVcaGz2Ce1GU 4WcQ7LEtbbrEyDYLakOchQft36DRjoe5BEYZfPmN2RKMz2WeTarfl7MNuZBJjdkHT7NM MslgbYyDliYxijcvW6Ka5dNOonypUXUNBysfAOMQdO0GGKjFHT8uYUSDMaNu0LfO1cv7 RAJ7WhLUhQfmIJnCU/a5mJf/GgdOK7czA5kqX1mcM3zxufBYTAkUZhFtNnZCDI5fjhMR yclA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:to:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=5A4j7eNZt0TovMB8//woM/uLpmJYUMSZY1+9YpRUDto=; fh=TVibWF85LnPLzNJ9WuDZofsqNQ0017MGiYBvX2LAmps=; b=qwYusFdNIdwRm5NnhPV0shQrQMgv5UGlZtwPkaLN7lHomo0VMl9A5WUGWtezL086V1 aXZ1v382BnWo7IkepRpJW9rAziDZGVkpSG0d9fGMX8HBxwcTa+Z2wf9S0jdhuKUSpDwi FUcahoonmtoo7pCSFNAQMb6Wc9zdG8PXVKJDdXiw6DtmHdTCYZnJU3Cv+fkYG1+IwjI0 PR9HXlaRr/FJclWnFX235/v2Q+Y+merPvSPsyxmGVbTG7tu0mp/neR30fP7cBk6ukDjM RHcyVkeisjtENiCbadkP+pQVzBcNjjTcrBVkgCkt7iJZ8dFtz/ao9FjRVzgXE3zXYRdD 7Ubg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IW5watGy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id si9-20020a17090b528900b00280145d5114si1140546pjb.5.2023.11.15.19.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 19:28:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IW5watGy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D067E8129ACC; Wed, 15 Nov 2023 19:28:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344881AbjKPD2Q (ORCPT + 99 others); Wed, 15 Nov 2023 22:28:16 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 19:28:31 -0800 (PST) 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