• Yang Zhang's avatar
    KVM: Mapping IOMMU pages after updating memslot · e0230e13
    Yang Zhang authored
    
    
    In kvm_iommu_map_pages(), we need to know the page size via call
    kvm_host_page_size(). And it will check whether the target slot
    is valid before return the right page size.
    Currently, we will map the iommu pages when creating a new slot.
    But we call kvm_iommu_map_pages() during preparing the new slot.
    At that time, the new slot is not visible by domain(still in preparing).
    So we cannot get the right page size from kvm_host_page_size() and
    this will break the IOMMU super page logic.
    The solution is to map the iommu pages after we insert the new slot
    into domain.
    Signed-off-by: default avatarYang Zhang <yang.z.zhang@Intel.com>
    Tested-by: default avatarPatrick Lu <patrick.lu@intel.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    e0230e13