public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Kevin Tian <kevin.tian@intel.com>
Cc: baolu.lu@linux.intel.com, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] iommu/vt-d: Use ida to manage domain id
Date: Thu, 24 Apr 2025 16:16:33 +0800	[thread overview]
Message-ID: <79da4184-f5b6-461d-a5fa-f07124b37521@linux.intel.com> (raw)
In-Reply-To: <20250423031020.2189546-2-baolu.lu@linux.intel.com>

On 4/23/2025 11:10 AM, Lu Baolu wrote:
> @@ -2042,7 +1998,7 @@ static int copy_context_table(struct intel_iommu *iommu,
>   
>   		did = context_domain_id(&ce);
>   		if (did >= 0 && did < cap_ndoms(iommu->cap))
> -			set_bit(did, iommu->domain_ids);
> +			ida_alloc_range(&iommu->domain_ida, did, did + 1, GFP_KERNEL);

ida allocation range is inclusive, thus here it should be,

ida_alloc_range(&iommu->domain_ida, did, did, GFP_KERNEL);

>   
>   		set_context_copied(iommu, bus, devfn);
>   		new_ce[idx] = ce;

Thanks,
baolu

  parent reply	other threads:[~2025-04-24  8:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23  3:10 [PATCH 0/3] iommu/vt-d: Use ida for domain ID management Lu Baolu
2025-04-23  3:10 ` [PATCH 1/3] iommu/vt-d: Use ida to manage domain id Lu Baolu
2025-04-24  7:37   ` Tian, Kevin
2025-04-24  9:01     ` Baolu Lu
2025-04-24  8:16   ` Baolu Lu [this message]
2025-04-23  3:10 ` [PATCH 2/3] iommu/vt-d: Replace spin_lock with mutex to protect domain ida Lu Baolu
2025-04-24  7:38   ` Tian, Kevin
2025-04-23  3:10 ` [PATCH 3/3] iommu/vt-d: Simplify domain_attach_iommu() Lu Baolu
2025-04-24  7:46   ` Tian, Kevin
2025-04-24  9:22     ` Baolu Lu
2025-04-24 13:37       ` Jason Gunthorpe
2025-04-24 14:47         ` Baolu Lu
2025-04-25 18:49   ` Dan Williams
2025-04-27  5:10     ` Baolu Lu

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=79da4184-f5b6-461d-a5fa-f07124b37521@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /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