From: Jason Gunthorpe <jgg@ziepe.ca>
To: Ankit Soni <Ankit.Soni@amd.com>
Cc: iommu@lists.linux.dev, vasant.hegde@amd.com,
suravee.suthikulpanit@amd.com, joro@8bytes.org, will@kernel.org,
robin.murphy@arm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/amd: Adhere to IVINFO[VASIZE] for address limits
Date: Mon, 2 Mar 2026 19:57:15 -0400 [thread overview]
Message-ID: <20260302235715.GY44359@ziepe.ca> (raw)
In-Reply-To: <cf1a1e3d96c3571ac5caa528caa84751d40be1bc.1772208939.git.Ankit.Soni@amd.com>
On Fri, Feb 27, 2026 at 04:58:04PM +0000, Ankit Soni wrote:
> +static u8 ivinfo_vasize_bits(void)
> +{
> + u8 vasize;
> +
> + vasize = FIELD_GET(IOMMU_IVINFO_VASIZE, amd_iommu_ivinfo);
> +
> + /*
> + * IVINFO[VASIZE] encodes the log2 of the maximum virtual address
> + * processed by the IOMMU.
> + */
> + switch (vasize) {
> + case 32:
> + case 40:
> + case 48:
> + case 64:
> + return vasize;
> + default:
> + pr_warn_once("IVRS: IVINFO[VASIZE]=0x%x is invalid, defaulting to 64‑bit VA\n",
> + vasize);
> + return 64;
Why check and limit it like this?
> - cfg.common.hw_max_vasz_lg2 =
> - min(64, (amd_iommu_hpt_level - 1) * 9 + 21);
> + cfg.common.hw_max_vasz_lg2 = amd_iommu_hpt_vasize;
This has no restriction, you can send it whatever size you want.
Shouldn't the v2 side respect this too? If there is some reason why
not it would be good to include it in a comment.
Jason
next prev parent reply other threads:[~2026-03-02 23:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 16:58 [PATCH] iommu/amd: Adhere to IVINFO[VASIZE] for address limits Ankit Soni
2026-02-28 10:56 ` kernel test robot
2026-03-02 23:57 ` Jason Gunthorpe [this message]
2026-03-03 11:47 ` Ankit Soni
2026-03-03 12:05 ` Jason Gunthorpe
2026-03-03 17:11 ` Ankit Soni
2026-03-03 18:17 ` Jason Gunthorpe
2026-03-05 13:51 ` Ankit Soni
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=20260302235715.GY44359@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=Ankit.Soni@amd.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=vasant.hegde@amd.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