From: Jason Gunthorpe <jgg@ziepe.ca>
To: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Kevin Tian <kevin.tian@intel.com>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/6] iommu/vt-d: Setup scalable mode context entry in probe path
Date: Mon, 11 Dec 2023 13:38:26 -0400 [thread overview]
Message-ID: <20231211173826.GE1489931@ziepe.ca> (raw)
In-Reply-To: <20231205012203.244584-2-baolu.lu@linux.intel.com>
On Tue, Dec 05, 2023 at 09:21:58AM +0800, Lu Baolu wrote:
> +/*
> + * Get the PASID directory size for scalable mode context entry.
> + * Value of X in the PDTS field of a scalable mode context entry
> + * indicates PASID directory with 2^(X + 7) entries.
> + */
> +static unsigned long context_get_sm_pds(struct pasid_table *table)
> +{
> + unsigned long pds, max_pde;
> +
> + max_pde = table->max_pasid >> PASID_PDE_SHIFT;
> + pds = find_first_bit(&max_pde, MAX_NR_PASID_BITS);
> + if (pds < 7)
> + return 0;
> +
> + return pds - 7;
This seems like a convoluted way to write
max(ilog2(table-max_pasid) - 7,0)
?
Jason
next prev parent reply other threads:[~2023-12-11 17:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 1:21 [PATCH v2 0/6] iommu/vt-d: Convert to use static identity domain Lu Baolu
2023-12-05 1:21 ` [PATCH v2 1/6] iommu/vt-d: Setup scalable mode context entry in probe path Lu Baolu
2023-12-08 8:50 ` Tian, Kevin
2023-12-09 7:52 ` Baolu Lu
2023-12-11 4:06 ` Tian, Kevin
2023-12-11 17:38 ` Jason Gunthorpe [this message]
2023-12-12 5:34 ` Baolu Lu
2023-12-05 1:21 ` [PATCH v2 2/6] iommu/vt-d: Remove scalable mode context entry setup from attach_dev Lu Baolu
2023-12-08 8:56 ` Tian, Kevin
2023-12-09 7:57 ` Baolu Lu
2023-12-05 1:22 ` [PATCH v2 3/6] iommu/vt-d: Refactor domain_context_mapping_one() to be reusable Lu Baolu
2023-12-05 1:22 ` [PATCH v2 4/6] iommu/vt-d: Remove 1:1 mappings from identity domain Lu Baolu
2023-12-08 9:09 ` Tian, Kevin
2023-12-08 12:45 ` Baolu Lu
2023-12-11 3:58 ` Tian, Kevin
2023-12-12 6:20 ` Baolu Lu
2023-12-13 2:20 ` Tian, Kevin
2023-12-13 2:43 ` Baolu Lu
2023-12-13 3:04 ` Tian, Kevin
2023-12-13 3:02 ` Baolu Lu
2023-12-05 1:22 ` [PATCH v2 5/6] iommu/vt-d: Add support for static " Lu Baolu
2023-12-05 1:22 ` [PATCH v2 6/6] iommu/vt-d: Cleanup si_domain 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=20231211173826.GE1489931@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--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