intel_iommu: allow dev-iotlb context entry conditionally
commitf80c98740e8da9fa0e4056f174ca66a3afb1d15b
authorPeter Xu <peterx@redhat.com>
Fri, 19 May 2017 03:19:46 +0000 (19 11:19 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 25 May 2017 18:25:27 +0000 (25 21:25 +0300)
treeee0f0f81e661cef62aa44cdf9a508506210dcae4
parent5a38cb5940f71254e7dcc4bce7ffca8c2102f0ec
intel_iommu: allow dev-iotlb context entry conditionally

When device-iotlb is not specified, we should fail this check. A new
function vtd_ce_type_check() is introduced.

While I'm at it, clean up the vtd_dev_to_context_entry() a bit - replace
many "else if" usage into direct if check. That'll make the logic more
clear.

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>
Reviewed-by: Jason Wang <jasowang@redhat.com>
hw/i386/intel_iommu.c