qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Eric Auger <eric.auger@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S . Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [PATCH 0/4] intel_iommu: Reset vIOMMU after all the rest of devices
Date: Fri, 19 Jan 2024 18:46:28 +0800	[thread overview]
Message-ID: <ZapTBEwAZOgX3jMa@x1n> (raw)
In-Reply-To: <2cad020f-73b4-48ac-87ab-6ed965fe4cf5@redhat.com>

On Wed, Jan 17, 2024 at 11:29:08AM +0100, Eric Auger wrote:
> Hi Peter,

Hi, Eric,

Thanks for the reviews!

> 
> On 1/17/24 10:15, peterx@redhat.com wrote:
> > From: Peter Xu <peterx@redhat.com>
> >
> > There're issue reported that when syetem_reset the VM with an intel iommu
> system_reset
> > device and MT2892 PF(mlx5_core driver), the host kernel throws DMAR error.
> >
> >   https://issues.redhat.com/browse/RHEL-7188
> >
> > Alex quickly spot a possible issue on ordering of device resets.
> >
> > It's verified by our QE team then that it is indeed the root cause of the
> > problem.  Consider when vIOMMU is reset before a VFIO device in a system
> > reset: the device can be doing DMAs even if the vIOMMU is gone; in this
> > specific context it means the shadow mapping can already be completely
> > destroyed.  Host will see these DMAs as malicious and report.
> That's curious we did not get this earlier?

I sincerely don't know.  It could be that we just didn't test much on
system resets. Or, we could have overlooked the host dmesgs; after all the
error messages can be benign from functional pov.

> >
> > To fix it, we'll need to make sure all devices under the vIOMMU device
> > hierachy will be reset before the vIOMMU itself.  There's plenty of trick
> > inside, one can get those by reading the last patch.
> Not sure what you meant here ;-)

I meant "how to make sure all the vIOMMU managed devices will be reset
before the vIOMMU" is tricky on the implementation.  I didn't reference any
of those in the cover letter, because I think I stated mostly in patch 4, I
want to reference that patch for the details.  Since I think it's very
tricky, I left that major comment in the code to persist.

Thanks,

-- 
Peter Xu



  reply	other threads:[~2024-01-19 10:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17  9:15 [PATCH 0/4] intel_iommu: Reset vIOMMU after all the rest of devices peterx
2024-01-17  9:15 ` [PATCH 1/4] reset: qemu_register_reset_one() peterx
2024-01-17 10:29   ` Eric Auger
2024-01-17  9:15 ` [PATCH 2/4] reset: Allow multiple stages of system resets peterx
2024-01-17 10:28   ` Eric Auger
2024-01-17 13:58     ` Cédric Le Goater
2024-01-17 17:46   ` Peter Maydell
2024-01-18 15:53     ` Philippe Mathieu-Daudé
2024-01-18 16:15       ` Peter Maydell
2024-01-19 11:10       ` Peter Xu
2024-01-17  9:15 ` [PATCH 3/4] intel_iommu: Tear down address spaces before IOMMU reset peterx
2024-01-17 10:29   ` Eric Auger
2024-01-18  8:09   ` Philippe Mathieu-Daudé
2024-01-17  9:15 ` [PATCH 4/4] intel_iommu: Reset vIOMMU at the last stage of system reset peterx
2024-01-17 10:38   ` Eric Auger
2024-01-17 10:29 ` [PATCH 0/4] intel_iommu: Reset vIOMMU after all the rest of devices Eric Auger
2024-01-19 10:46   ` Peter Xu [this message]
2025-01-23  9:16 ` Eric Auger
2025-01-23 17:57   ` Peter Xu
2025-01-23 18:02     ` Eric Auger
2025-01-29 18:22     ` Eric Auger

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=ZapTBEwAZOgX3jMa@x1n \
    --to=peterx@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).