|
@@ -3744,7 +3744,7 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus,
|
|
/* Unmap the whole range in the notifier's scope. */
|
|
/* Unmap the whole range in the notifier's scope. */
|
|
static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n)
|
|
static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n)
|
|
{
|
|
{
|
|
- hwaddr size, remain;
|
|
|
|
|
|
+ hwaddr total, remain;
|
|
hwaddr start = n->start;
|
|
hwaddr start = n->start;
|
|
hwaddr end = n->end;
|
|
hwaddr end = n->end;
|
|
IntelIOMMUState *s = as->iommu_state;
|
|
IntelIOMMUState *s = as->iommu_state;
|
|
@@ -3765,7 +3765,7 @@ static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n)
|
|
}
|
|
}
|
|
|
|
|
|
assert(start <= end);
|
|
assert(start <= end);
|
|
- size = remain = end - start + 1;
|
|
|
|
|
|
+ total = remain = end - start + 1;
|
|
|
|
|
|
while (remain >= VTD_PAGE_SIZE) {
|
|
while (remain >= VTD_PAGE_SIZE) {
|
|
IOMMUTLBEvent event;
|
|
IOMMUTLBEvent event;
|
|
@@ -3793,10 +3793,10 @@ static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n)
|
|
trace_vtd_as_unmap_whole(pci_bus_num(as->bus),
|
|
trace_vtd_as_unmap_whole(pci_bus_num(as->bus),
|
|
VTD_PCI_SLOT(as->devfn),
|
|
VTD_PCI_SLOT(as->devfn),
|
|
VTD_PCI_FUNC(as->devfn),
|
|
VTD_PCI_FUNC(as->devfn),
|
|
- n->start, size);
|
|
|
|
|
|
+ n->start, total);
|
|
|
|
|
|
map.iova = n->start;
|
|
map.iova = n->start;
|
|
- map.size = size - 1; /* Inclusive */
|
|
|
|
|
|
+ map.size = total - 1; /* Inclusive */
|
|
iova_tree_remove(as->iova_tree, map);
|
|
iova_tree_remove(as->iova_tree, map);
|
|
}
|
|
}
|
|
|
|
|