From: Yi Liu <yi.l.liu@intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
Baolu Lu <baolu.lu@linux.intel.com>,
"joro@8bytes.org" <joro@8bytes.org>
Cc: "chao.p.peng@linux.intel.com" <chao.p.peng@linux.intel.com>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Subject: Re: [PATCH] iommu/vt-d: Fix qi_batch NULL pointer with nested parent domain
Date: Wed, 11 Dec 2024 17:29:17 +0800 [thread overview]
Message-ID: <6233f996-6b7c-4c5e-be92-8523d4c16193@intel.com> (raw)
In-Reply-To: <BN9PR11MB52761F40C3A1923B78478C0D8C3E2@BN9PR11MB5276.namprd11.prod.outlook.com>
On 2024/12/11 16:32, Tian, Kevin wrote:
>> From: Liu, Yi L <yi.l.liu@intel.com>
>> Sent: Monday, December 9, 2024 11:07 AM
>>
>> On 2024/12/9 09:39, Baolu Lu wrote:
>>> +/* domain->qi_batch will be freed in iommu_free_domain() path. */
>>> +static int domain_qi_batch_alloc(struct dmar_domain *domain)
>>> +{
>>> + unsigned long flags;
>>> + int ret = 0;
>>> +
>>> + spin_lock_irqsave(&domain->cache_lock, flags);
>>
>> I'm wondering if there is any difference using the domain->lock v.s. using
>> the domain->cache_lock. The RID attach path acquires/releases the
>> domain->lock first, and then the domain->cache_lock. While the PASID path
>> does the reverse order. Although neither of the two paths hold the locks
>> for a long duration (no A-B-B-A locking issue), it still means when a
>> domain is shared between RID and PASID path, the domain->qi_batch check
>> is
>> not in the same phase of the two paths.
>>
>
> why is there different order between RID vs. PASID attach?
I think they should be consolidated to follow the same order to have
better readability although there is no actual problem for now.
--
Regards,
Yi Liu
next prev parent reply other threads:[~2024-12-11 9:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-07 12:03 [PATCH] iommu/vt-d: Fix qi_batch NULL pointer with nested parent domain Yi Liu
2024-12-09 1:39 ` Baolu Lu
2024-12-09 3:07 ` Yi Liu
2024-12-09 3:05 ` Baolu Lu
2024-12-11 8:32 ` Tian, Kevin
2024-12-11 9:29 ` Yi Liu [this message]
2024-12-09 3:10 ` Yi Liu
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=6233f996-6b7c-4c5e-be92-8523d4c16193@intel.com \
--to=yi.l.liu@intel.com \
--cc=baolu.lu@linux.intel.com \
--cc=chao.p.peng@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kevin.tian@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