|
@@ -2069,7 +2069,7 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
|
|
|
* than default. Unnecessary for PT mode.
|
|
* than default. Unnecessary for PT mode.
|
|
|
*/
|
|
*/
|
|
|
if (translation != CONTEXT_TT_PASS_THROUGH) {
|
|
if (translation != CONTEXT_TT_PASS_THROUGH) {
|
|
|
- for (agaw = domain->agaw; agaw != iommu->agaw; agaw--) {
|
|
|
|
|
|
|
+ for (agaw = domain->agaw; agaw > iommu->agaw; agaw--) {
|
|
|
ret = -ENOMEM;
|
|
ret = -ENOMEM;
|
|
|
pgd = phys_to_virt(dma_pte_addr(pgd));
|
|
pgd = phys_to_virt(dma_pte_addr(pgd));
|
|
|
if (!dma_pte_present(pgd))
|
|
if (!dma_pte_present(pgd))
|
|
@@ -2083,7 +2083,7 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
|
|
|
translation = CONTEXT_TT_MULTI_LEVEL;
|
|
translation = CONTEXT_TT_MULTI_LEVEL;
|
|
|
|
|
|
|
|
context_set_address_root(context, virt_to_phys(pgd));
|
|
context_set_address_root(context, virt_to_phys(pgd));
|
|
|
- context_set_address_width(context, iommu->agaw);
|
|
|
|
|
|
|
+ context_set_address_width(context, agaw);
|
|
|
} else {
|
|
} else {
|
|
|
/*
|
|
/*
|
|
|
* In pass through mode, AW must be programmed to
|
|
* In pass through mode, AW must be programmed to
|