de38ed3007
virtio-iommu: avoid memleak in the unrealize
...
req_vq/event_vq forgot to free in unrealize. Fix that.
And also do clean 's->as_by_busptr' hash table in unrealize to fix another leak.
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com >
Acked-by: Eric Auger <eric.auger@redhat.com >
Message-Id: <20200328005705.29898-3-pannengyuan@huawei.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-03-29 09:52:13 -04:00
bd0ab8702f
virtio-iommu: Support migration
...
Add Migration support. We rely on recently added gtree and qlist
migration. We only migrate the domain gtree. The endpoint gtree
is re-constructed in a post-load operation.
Signed-off-by: Eric Auger <eric.auger@redhat.com >
Acked-by: Peter Xu <peterx@redhat.com >
Reviewed-by: Juan Quintela <quintela@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Message-Id: <20200214132745.23392-8-eric.auger@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-02-27 03:46:10 -05:00
a7c1da8adc
virtio-iommu: Implement fault reporting
...
The event queue allows to report asynchronous errors.
The translate function now injects faults when relevant.
Signed-off-by: Eric Auger <eric.auger@redhat.com >
Reviewed-by: Peter Xu <peterx@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Message-Id: <20200214132745.23392-7-eric.auger@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-02-27 03:46:10 -05:00
ed8449b30b
virtio-iommu: Implement translate
...
This patch implements the translate callback
Signed-off-by: Eric Auger <eric.auger@redhat.com >
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Message-Id: <20200214132745.23392-6-eric.auger@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-02-27 03:46:10 -05:00
fe2cacae24
virtio-iommu: Implement map/unmap
...
This patch implements virtio_iommu_map/unmap.
Signed-off-by: Eric Auger <eric.auger@redhat.com >
Reviewed-by: Peter Xu <peterx@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Message-Id: <20200214132745.23392-5-eric.auger@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-02-27 03:46:10 -05:00
cfb42188b2
virtio-iommu: Implement attach/detach command
...
This patch implements the endpoint attach/detach to/from
a domain.
Domain and endpoint internal datatypes are introduced.
Both are stored in RB trees. The domain owns a list of
endpoints attached to it. Also helpers to get/put
end points and domains are introduced.
As for the IOMMU memory regions, a callback is called on
PCI bus enumeration that initializes for a given device
on the bus hierarchy an IOMMU memory region. The PCI bus
hierarchy is stored locally in IOMMUPciBus and IOMMUDevice
objects.
At the time of the enumeration, the bus number may not be
computed yet.
So operations that will need to retrieve the IOMMUdevice
and its IOMMU memory region from the bus number and devfn,
once the bus number is garanteed to be frozen, use an array
of IOMMUPciBus, lazily populated.
Signed-off-by: Eric Auger <eric.auger@redhat.com >
Reviewed-by: Peter Xu <peterx@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Message-Id: <20200214132745.23392-4-eric.auger@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-02-27 03:46:10 -05:00
5442b854ea
virtio-iommu: Decode the command payload
...
This patch adds the command payload decoding and
introduces the functions that will do the actual
command handling. Those functions are not yet implemented.
Signed-off-by: Eric Auger <eric.auger@redhat.com >
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org >
Reviewed-by: Peter Xu <peterx@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Message-Id: <20200214132745.23392-3-eric.auger@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-02-27 03:46:10 -05:00
22c37a10f3
virtio-iommu: Add skeleton
...
This patchs adds the skeleton for the virtio-iommu device.
Signed-off-by: Eric Auger <eric.auger@redhat.com >
Reviewed-by: Peter Xu <peterx@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Message-Id: <20200214132745.23392-2-eric.auger@redhat.com >
Reviewed-by: Michael S. Tsirkin <mst@redhat.com >
Signed-off-by: Michael S. Tsirkin <mst@redhat.com >
2020-02-27 03:46:10 -05:00