mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-26 22:25:12 -07:00
intel_iommu: dma read/write draining support
Support DMA read/write draining should be easy for existing VT-d
emulation since the emulation itself does not have any request queue
there so we don't need to do anything to flush the un-commited queue.
What we need to do is to declare the support.
These capabilities are required to pass Windows SVVP test program. It
is verified that when with parameters "x-aw-bits=48,caching-mode=off"
we can pass the Windows SVVP test with this patch applied. Otherwise
we'll fail with:
IOMMU[0] - DWD (DMA write draining) not supported
IOMMU[0] - DWD (DMA read draining) not supported
Segment 0 has no DMA remapping capable IOMMU units
However since these bits are not declared support for QEMU<=3.1, we'll
need a compatibility bit for it and we turn this on by default only
for QEMU>=4.0.
Please refer to VT-d spec 6.5.4 for more information.
CC: Yu Wang <wyu@redhat.com>
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1654550
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
095955b24d
commit
ccc23bb08a
4 changed files with 13 additions and 0 deletions
|
|
@ -245,6 +245,7 @@ struct IntelIOMMUState {
|
|||
OnOffAuto intr_eim; /* Toggle for EIM cabability */
|
||||
bool buggy_eim; /* Force buggy EIM unless eim=off */
|
||||
uint8_t aw_bits; /* Host/IOVA address width (in bits) */
|
||||
bool dma_drain; /* Whether DMA r/w draining enabled */
|
||||
|
||||
/*
|
||||
* Protects IOMMU states in general. Currently it protects the
|
||||
|
|
|
|||
|
|
@ -296,6 +296,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
|
|||
|
||||
#define PC_COMPAT_3_1 \
|
||||
HW_COMPAT_3_1 \
|
||||
{\
|
||||
.driver = "intel-iommu",\
|
||||
.property = "dma-drain",\
|
||||
.value = "off",\
|
||||
},
|
||||
|
||||
#define PC_COMPAT_3_0 \
|
||||
HW_COMPAT_3_0 \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue