|
@@ -2094,7 +2094,7 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
|
|
|
sg_res = aligned_nrpages(sg->offset, sg->length);
|
|
|
sg->dma_address = ((dma_addr_t)iov_pfn << VTD_PAGE_SHIFT) + sg->offset;
|
|
|
sg->dma_length = sg->length;
|
|
|
- pteval = page_to_phys(sg_page(sg)) | prot;
|
|
|
+ pteval = (sg_phys(sg) & PAGE_MASK) | prot;
|
|
|
phys_pfn = pteval >> VTD_PAGE_SHIFT;
|
|
|
}
|
|
|
|
|
@@ -3620,7 +3620,7 @@ static int intel_nontranslate_map_sg(struct device *hddev,
|
|
|
|
|
|
for_each_sg(sglist, sg, nelems, i) {
|
|
|
BUG_ON(!sg_page(sg));
|
|
|
- sg->dma_address = page_to_phys(sg_page(sg)) + sg->offset;
|
|
|
+ sg->dma_address = sg_phys(sg);
|
|
|
sg->dma_length = sg->length;
|
|
|
}
|
|
|
return nelems;
|