[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastr
From: |
Benjamin Herrenschmidt |
Subject: |
Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure |
Date: |
Tue, 15 May 2012 12:32:46 +1000 |
On Mon, 2012-05-14 at 21:03 -0500, Anthony Liguori wrote:
> So the CPU thread runs in lock-step with the I/O thread. Dropping the CPU
> thread lock to let the I/O thread run is a dangerous thing to do in a place
> like
> this.
>
> Also, I think you'd effectively block the CPU until pending DMA operations
> complete? This could be many, many, milliseconds, no? That's going to make
> guests very upset.
Do you see any other option ?
IE. When the guest invalidates iommu translations, it must have a way to
synchronize with anything that may have used such translations. IE. It
must have a way to guarantee that
- The translation is no longer used
- Any physical address obtained as a result of looking at
the translation table/tree/... is no longer used
This is true regardless of the iommu model. For the PAPR TCE model, we
need to provide such synchronization whenever we clear a TCE entry, but
if I was to emulate the HW iommu of a G5 for example, I would have to
provide similar guarantees in my emulation of MMIO accesses to the iommu
TLB invalidate register.
This is a problem with devices using the map/unmap calls. This is going
to be even more of a problem as we start being more threaded (which from
discussions I've read here or there seem to be the goal) since
synchronizing with the IO thread isn't going to be enough.
As long as the actual data transfer through the iommu is under control
of the iommu code, then the iommu implementation can use whatever
locking it needs to ensure this synchronization.
But map/unmap defeats that.
David's approach may not be the best long term, but provided it's not
totally broken (I don't know qemu locking well enough to judge how
dangerous it is) then it might be a "good enough" first step until we
come up with something better ?
The normal case will be that no map exist, ie, it will almost always be
a guest programming error to remove an iommu mapping while a device is
actively using it, so having this case be slow is probably a non-issue.
Cheers,
Ben.
- [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions, (continued)
- [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions, Benjamin Herrenschmidt, 2012/05/10
- [Qemu-devel] [PATCH 05/13] iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers, Benjamin Herrenschmidt, 2012/05/10
- [Qemu-devel] [PATCH 06/13] ide/ahci: Use universal DMA helper functions, Benjamin Herrenschmidt, 2012/05/10
- [Qemu-devel] [PATCH 07/13] usb: Convert usb_packet_{map, unmap} to universal DMA helpers, Benjamin Herrenschmidt, 2012/05/10
- [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions, Benjamin Herrenschmidt, 2012/05/10
- [Qemu-devel] [PATCH 09/13] iommu: Add facility to cancel in-use dma memory maps, Benjamin Herrenschmidt, 2012/05/10
- [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Benjamin Herrenschmidt, 2012/05/10
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Anthony Liguori, 2012/05/14
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, David Gibson, 2012/05/14
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Anthony Liguori, 2012/05/14
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure,
Benjamin Herrenschmidt <=
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Anthony Liguori, 2012/05/14
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Benjamin Herrenschmidt, 2012/05/14
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Anthony Liguori, 2012/05/15
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Benjamin Herrenschmidt, 2012/05/15
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Anthony Liguori, 2012/05/15
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Benjamin Herrenschmidt, 2012/05/15
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Anthony Liguori, 2012/05/15
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Benjamin Herrenschmidt, 2012/05/15
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Anthony Liguori, 2012/05/15
- Re: [Qemu-devel] [PATCH 08/13] iommu: Introduce IOMMU emulation infrastructure, Benjamin Herrenschmidt, 2012/05/15