intel-iommu: add context-cache to cache context-entry
commitd92fa2dc6e42e8bd8470e69d85141176f98feaea
authorLe Tan <tamlokveer@gmail.com>
Sat, 16 Aug 2014 05:55:43 +0000 (16 13:55 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 28 Aug 2014 21:10:22 +0000 (28 23:10 +0200)
tree87c67411431636b6dd9cc73604940f5f1b83ae82
parented7b8fbcfb888716c850c8f908f5b5329de46d7c
intel-iommu: add context-cache to cache context-entry

Add context-cache to cache context-entry encountered on a page-walk. Each
VTDAddressSpace has a member of VTDContextCacheEntry which represents an entry
in the context-cache. Since devices with different bus_num and devfn have their
respective VTDAddressSpace, this will be a good way to reference the cached
entries.
Each VTDContextCacheEntry will have a context_cache_gen and the cached entry
is valid only when context_cache_gen equals IntelIOMMUState.context_cache_gen.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/intel_iommu.c
hw/i386/intel_iommu_internal.h
hw/pci-host/q35.c
include/hw/i386/intel_iommu.h