From: Baolu Lu <baolu.lu@linux.intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Cc: baolu.lu@linux.intel.com, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
"Liu, Yi L" <yi.l.liu@intel.com>,
"Pan, Jacob jun" <jacob.jun.pan@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 4/7] iommu/vt-d: Fold dmar_remove_one_dev_info() into its caller
Date: Wed, 16 Nov 2022 16:02:46 +0800 [thread overview]
Message-ID: <ebace32b-be36-5c9f-579b-211cad75df02@linux.intel.com> (raw)
In-Reply-To: <BL1PR11MB5271F0D4E91A3F6179216ADA8C079@BL1PR11MB5271.namprd11.prod.outlook.com>
On 2022/11/16 13:35, Tian, Kevin wrote:
>> From: Baolu Lu<baolu.lu@linux.intel.com>
>> Sent: Wednesday, November 16, 2022 12:36 PM
>>
>> On 11/16/22 11:53 AM, Tian, Kevin wrote:
>>>> From: Lu Baolu<baolu.lu@linux.intel.com>
>>>> Sent: Monday, November 14, 2022 9:41 AM
>>>> @@ -4562,7 +4538,10 @@ static void intel_iommu_release_device(struct
>>>> device *dev)
>>>> {
>>>> struct device_domain_info *info = dev_iommu_priv_get(dev);
>>>>
>>>> - dmar_remove_one_dev_info(dev);
>>>> + iommu_disable_pci_caps(info);
>>>> + domain_context_clear(info);
>>>> + device_block_translation(dev);
>>> clear context after blocking translation.
>> Unfortunately domain_context_clear() needs reference to info->domain
>> (for domain id when flushing cache), which is cleared in
>> device_block_translation().
>>
> this sounds an ordering problem. clearing context should be after
> blocking translation in concept.
At present, when the default domain is attached to the device, we first
populate the pasid table entry, and then populate the device context
entry. Above code is just the reverse operation.
Can you see any practical problems caused by this sequence? If so, it
seems that we should carefully consider whether such problems already
exist.
Best regards,
baolu
next prev parent reply other threads:[~2022-11-16 8:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 1:40 [PATCH v3 0/7] iommu/vt-d: Some cleanups Lu Baolu
2022-11-14 1:40 ` [PATCH v3 1/7] iommu/vt-d: Allocate pasid table in device probe path Lu Baolu
2022-11-14 1:40 ` [PATCH v3 2/7] iommu/vt-d: Add device_block_translation() helper Lu Baolu
2022-11-16 3:49 ` Tian, Kevin
2022-11-14 1:40 ` [PATCH v3 3/7] iommu/vt-d: Add blocking domain support Lu Baolu
2022-11-16 3:51 ` Tian, Kevin
2022-11-14 1:40 ` [PATCH v3 4/7] iommu/vt-d: Fold dmar_remove_one_dev_info() into its caller Lu Baolu
2022-11-16 3:53 ` Tian, Kevin
2022-11-16 4:36 ` Baolu Lu
2022-11-16 5:35 ` Tian, Kevin
2022-11-16 8:02 ` Baolu Lu [this message]
2022-11-16 9:15 ` Tian, Kevin
2022-11-16 12:08 ` Baolu Lu
2022-11-14 1:40 ` [PATCH v3 5/7] iommu/vt-d: Rename domain_add_dev_info() Lu Baolu
2022-11-16 3:53 ` Tian, Kevin
2022-11-14 1:40 ` [PATCH v3 6/7] iommu/vt-d: Remove unnecessary domain_context_mapped() Lu Baolu
2022-11-14 1:40 ` [PATCH v3 7/7] iommu/vt-d: Use real field for indication of first level Lu Baolu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ebace32b-be36-5c9f-579b-211cad75df02@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jacob.jun.pan@intel.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=yi.l.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox