On Wed, Nov 14, 2018 at 02:04:42PM +0800, Yu Zhang wrote: > Currently, vIOMMU is using the value of IOVA address width, instead of > the host address width(HAW) to calculate the number of reserved bits in > data structures such as root entries, context entries, and entries of > DMA paging structures etc. > > However values of IOVA address width and of the HAW may not equal. For > example, a 48-bit IOVA can only be mapped to host addresses no wider than > 46 bits. Using 48, instead of 46 to calculate the reserved bit may result > in an invalid IOVA being accepted. > > To fix this, a new field - haw_bits is introduced in struct IntelIOMMUState, > whose value is initialized based on the maximum physical address set to > guest CPU. Also, definitions such as VTD_HOST_AW_39/48BIT etc. are renamed > to clarify. > > Signed-off-by: Yu Zhang <yu.c.zh...@linux.intel.com>
Reviewed-by: Peter Xu <pet...@redhat.com> -- Peter Xu