intel-iommu: drop VTDBus
authorJason Wang <jasowang@redhat.com>
Fri, 28 Oct 2022 06:14:34 +0000 (14:14 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 7 Nov 2022 19:08:17 +0000 (14:08 -0500)
commitda8d439c8048f685e0333ae468b7520b82925e75
treec1eea1f132efe47af5d7afa0f675c41d46c4061e
parentfb1d084b4488aef990b5bafab08ecc20197fd749
intel-iommu: drop VTDBus

We introduce VTDBus structure as an intermediate step for searching
the address space. This works well with SID based matching/lookup. But
when we want to support SID plus PASID based address space lookup,
this intermediate steps turns out to be a burden. So the patch simply
drops the VTDBus structure and use the PCIBus and devfn as the key for
the g_hash_table(). This simplifies the codes and the future PASID
extension.

To prevent being slower for past vtd_find_as_from_bus_num() callers, a
vtd_as cache indexed by the bus number is introduced to store the last
recent search result of a vtd_as belongs to a specific bus.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20221028061436.30093-3-jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Yi Liu <yi.l.liu@intel.com>
hw/i386/intel_iommu.c
include/hw/i386/intel_iommu.h