vhost, pc: fixes
The following changes since commit e839001d5bb6c84932e2d82bd383477b2023f407:
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging (2017-03-30 15:28:19 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to 0d876080a394993a8dea494ebf2d806dc0983107:
tests/acpi: don't pack a structure (2017-03-30 19:12:44 +0300)
----------------------------------------------------------------
vhost, pc: fixes
More fixes for 2.9. Region caching is still causing issues around reset, but we seem to be getting there.
----------------------------------------------------------------
Jason Wang (1):
vhost: generalize iommu memory region
Michael S. Tsirkin (1):
tests/acpi: don't pack a structure
include/hw/virtio/vhost.h | 11 +++++++ tests/acpi-utils.h | 2 +- hw/virtio/vhost.c | 84 ++++++++++++++++++++++++++++++++++++----------- 3 files changed, 76 insertions(+), 21 deletions(-)
[Qemu-devel] [PULL 1/2] vhost: generalize iommu memory region
From: Jason Wang <[email protected]>
We assumes the iommu_ops were attached to the root region of address space. This may not be true for all kinds of IOMMU implementation and especially after commit 3716d5902d74 ("pci: introduce a bus master container"). So fix this by not assuming as->root has iommu_ops, instead depending on the regions reported by memory listener through:
- register a memory listener to dma_as
- during region_add, if it's a region of IOMMU, register a specific IOMMU notifier, and store all notifiers in a list.
- during region_del, compare and delete the IOMMU notifier from the list
This is also a must for making vhost device IOTLB works for all types of IOMMUs. Note, since we register one notifier during each .region_add, the IOTLB may be flushed more than one times, this is suboptimal and could be optimized in the future.
--- include/hw/virtio/vhost.h | 11 +++++++ hw/virtio/vhost.c | 84 ++++++++++++++++++++++++++++++++++++----------- 2 files changed, 75 insertions(+), 20 deletions(-)
include/hw/virtio/vhost.h +11 -0
@@ -37,10 +37,20 @@ struct vhost_log {vhost_log_chunk_t *log; }; +struct vhost_dev ; +struct vhost_iommu { +struct vhost_dev *hdev; +MemoryRegion *mr; +hwaddr iommu_offset; +IOMMUNotifier n; +QLIST_ENTRY (vhost_iommu) iommu_next; +}; +struct vhost_memory ;struct vhost_dev {VirtIODevice *vdev;MemoryListener memory_listener; +MemoryListener iommu_listener;struct vhost_memory *mem;int n_mem_sections;MemoryRegionSection *mem_sections;
@@ -64,6 +74,7 @@ struct vhost_dev {void *opaque;struct vhost_log *log;QLIST_ENTRY (vhost_dev) entry; + QLIST_HEAD(, vhost_iommu) iommu_list;IOMMUNotifier n; };
hw/virtio/vhost.c +64 -20
121 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 2/2] tests/acpi: don't pack a structure
In reply to Michael S. TsirkinThere's no reason to pack structures where we don't care about size or padding, this applies to AcpiStdTable in tests/acpi-utils.h.
OTOH bios-tables-test happens to be passing the address of a field in this struct to a function that expects a pointer to normally aligned data which results in a SIGBUS on architectures like SPARC that have strict alignment requirements.
--- tests/acpi-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/acpi-utils.h +1 -1
@@ -26,7 +26,7 @@ typedef struct {gsize asl_len;gchar *asl_file;bool tmp_files_retain;/* do not delete the temp asl/aml */ -}QEMU_PACKED AcpiSdtTable; +} AcpiSdtTable;#define ACPI_READ_FIELD (field, addr) \ do { \
Signature · 1 line
MST
Peter Maydell
AppliedQuoted 24 lines · Michael S. Tsirkin
The following changes since commit
e839001d5bb6c84932e2d82bd383477b2023f407:Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging (2017-03-30 15:28:19 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
0d876080a394993a8dea494ebf2d806dc0983107:tests/acpi: don't pack a structure (2017-03-30 19:12:44 +0300)
----------------------------------------------------------------
vhost, pc: fixesMore fixes for 2.9. Region caching is still causing issues around reset, but we seem to be getting there.
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Jason Wang (1):
vhost: generalize iommu memory region
Quoted 7 lines
Michael S. Tsirkin (1):
tests/acpi: don't pack a structureinclude/hw/virtio/vhost.h | 11 +++++++ tests/acpi-utils.h | 2 +- hw/virtio/vhost.c | 84 ++++++++++++++++++++++++++++++++++++----------- 3 files changed, 76 insertions(+), 21 deletions(-)
Applied, thanks.
-- PMM