Fix the truncation issue for phys addresses >32-bit while making PDE entry.
Bug
1410705
Change-Id: I0f7eaf34b9636ff95575a8ac8135019643244867
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/738111
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>
GVS: Gerrit_Virtual_Submit
else if (dma_get_attr(DMA_ATTR_WRITE_ONLY, (struct dma_attrs *)prot))
attrs &= ~_READABLE;
- pdir[pdn] = SMMU_ADDR_TO_PDN(pa) << 10 | attrs;
+ pdir[pdn] = pa >> SMMU_PDE_SHIFT | attrs;
trace_smmu_set_pte(as->asid, iova, pa, SZ_4M, attrs);
FLUSH_CPU_DCACHE(&pdir[pdn], as->pdir_page, sizeof pdir[pdn]);
bytes = PAGE_SIZE;
*npte = *count;
} else if (pdir[pdn]) {
- *pa = pdir[pdn] << SMMU_PDE_SHIFT;
+ *pa = (phys_addr_t)pdir[pdn] << SMMU_PDE_SHIFT;
*pa += iova & (SZ_4M - 1);
bytes = SZ_4M;
}