public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] iommu/vt-d: Restore previous domain::aperture_end calculation
Date: Fri, 21 Nov 2025 09:39:57 +0800	[thread overview]
Message-ID: <e5376ae5-20f8-4e49-a912-7412361c66fd@linux.intel.com> (raw)
In-Reply-To: <20251120130045.GB153257@nvidia.com>

On 11/20/25 21:00, Jason Gunthorpe wrote:
> On Thu, Nov 20, 2025 at 03:25:24PM +0800, Lu Baolu wrote:
>> --- a/drivers/iommu/intel/iommu.c
>> +++ b/drivers/iommu/intel/iommu.c
>> @@ -2817,6 +2817,16 @@ intel_iommu_domain_alloc_first_stage(struct device *dev,
>>   		cfg.common.hw_max_vasz_lg2 = 57;
>>   	else
>>   		cfg.common.hw_max_vasz_lg2 = 48;
>> +
>> +	/*
>> +	 * Spec 3.6 First-Stage Translation:
>> +	 *
>> +	 * Software must limit addresses to less than the minimum of MGAW
>> +	 * and the lower canonical address width implied by FSPM (i.e.,
>> +	 * 47-bit when FSPM is 4-level and 56-bit when FSPM is 5-level).
>> +	 */
>> +	cfg.common.hw_max_vasz_lg2 = min(cap_mgaw(iommu->cap),
>> +					 cfg.common.hw_max_vasz_lg2);
>>   	cfg.common.hw_max_oasz_lg2 = 52;
>>   	cfg.common.features = BIT(PT_FEAT_SIGN_EXTEND) |
>>   			      BIT(PT_FEAT_FLUSH_RANGE);
> This is missing the hunk for paging_domain_compatible_first_stage(), I
> think that is important!

Yes. I want to make that a separate patch as that will be Cc'd to stable
and backported further than this one. We should have such a
compatibility check even without the generic iopt conversion, right?

Thanks,
baolu

  reply	other threads:[~2025-11-21  1:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20  7:25 [PATCH 1/1] iommu/vt-d: Restore previous domain::aperture_end calculation Lu Baolu
2025-11-20 10:35 ` Joerg Roedel
2025-11-20 13:00 ` Jason Gunthorpe
2025-11-21  1:39   ` Baolu Lu [this message]
2025-11-21  7:30     ` Tian, Kevin

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=e5376ae5-20f8-4e49-a912-7412361c66fd@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.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 \
    /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