intel_iommu: vtd_slpt_level_shift check level
This helps in debugging incorrect level passed in. Reviewed-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
6c441e1d61
commit
7e58326ad7
@ -168,6 +168,7 @@ static gboolean vtd_hash_remove_by_domain(gpointer key, gpointer value,
|
|||||||
/* The shift of an addr for a certain level of paging structure */
|
/* The shift of an addr for a certain level of paging structure */
|
||||||
static inline uint32_t vtd_slpt_level_shift(uint32_t level)
|
static inline uint32_t vtd_slpt_level_shift(uint32_t level)
|
||||||
{
|
{
|
||||||
|
assert(level != 0);
|
||||||
return VTD_PAGE_SHIFT_4K + (level - 1) * VTD_SL_LEVEL_BITS;
|
return VTD_PAGE_SHIFT_4K + (level - 1) * VTD_SL_LEVEL_BITS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user