From: Jan Beulich <jbeulich@suse.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Jason Andryuk <jason.andryuk@amd.com>,
Teddy Astie <teddy.astie@vates.tech>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH 2/2] iommu/amd-vi: do not zero IOMMU MMIO region
Date: Wed, 6 May 2026 10:28:52 +0200 [thread overview]
Message-ID: <0035d666-2ad3-44d8-a2a8-e612dfd10503@suse.com> (raw)
In-Reply-To: <20260506073719.40075-3-roger.pau@citrix.com>
On 06.05.2026 09:37, Roger Pau Monne wrote:
> @@ -1381,6 +1372,11 @@ static int __init amd_iommu_prepare_one(struct amd_iommu *iommu)
> if ( amd_iommu_max_paging_mode < amd_iommu_min_paging_mode )
> return -ERANGE;
>
> + /* Read current control register and forcefully disable the IOMMU. */
> + iommu->ctrl.raw = readq(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
> + disable_iommu(iommu, true);
Don't you also need to pre-fill iommu->features? And with that field's use in
disable_iommu(), won't we be at risk of leaving stuff enabled which we are
entirely unaware of? Even if we fully cleared the control register (which
would eliminate the need to fetch features), down the road a 2nd control
register could appear. Has it become clear which register(s) or bit(s) it
really is that are causing the observed issue? IOW is there truly something
we may not clear? Or is it maybe that memset() really isn't suitable for use
against MMIO, especially after having switched to use of REP MOVSB when ERMS
is available?
Jan
next prev parent reply other threads:[~2026-05-06 8:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 7:37 [PATCH 0/2] iommu/amd-vi: remove zeroing of MMIO region Roger Pau Monne
2026-05-06 7:37 ` [PATCH 1/2] iommu/amd-vi: allow disable_iommu() against non-initialized IOMMUs Roger Pau Monne
2026-05-06 8:19 ` Jan Beulich
2026-05-06 7:37 ` [PATCH 2/2] iommu/amd-vi: do not zero IOMMU MMIO region Roger Pau Monne
2026-05-06 8:20 ` Andrew Cooper
2026-05-06 8:32 ` Jan Beulich
2026-05-06 9:02 ` Andrew Cooper
2026-05-06 9:27 ` Jan Beulich
2026-05-06 8:58 ` Roger Pau Monné
2026-05-06 9:41 ` Andrew Cooper
2026-05-06 8:28 ` Jan Beulich [this message]
2026-05-06 8:43 ` Roger Pau Monné
2026-05-06 9:17 ` Jan Beulich
2026-05-06 9:20 ` Roger Pau Monné
2026-05-06 9:28 ` Jan Beulich
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=0035d666-2ad3-44d8-a2a8-e612dfd10503@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=jason.andryuk@amd.com \
--cc=roger.pau@citrix.com \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.