diff options
author | Lee Roberts <lee.roberts@hpe.com> | 2018-03-24 22:46:19 -0600 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-03-26 11:23:26 +0000 |
commit | 1b8e8252b074e1981d09a53c1a5da19dc35541c9 (patch) | |
tree | d5c6be8144e6aae8455570c4f4533857e4402310 /src/vlib/linux | |
parent | 487f5474fea738174e1cfe68fe70a2eaf58c5ce2 (diff) |
Correct address calculation for VPP-1168
Use (u64) cast to ensure proper address calculations.
Change-Id: Ifbbe66072eb94bfe33ac04eaa4416abceeb7245e
Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
Diffstat (limited to 'src/vlib/linux')
-rw-r--r-- | src/vlib/linux/physmem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vlib/linux/physmem.c b/src/vlib/linux/physmem.c index 161dbf5c0c7..6f5ef7e1c5a 100644 --- a/src/vlib/linux/physmem.c +++ b/src/vlib/linux/physmem.c @@ -154,7 +154,8 @@ unix_physmem_region_iommu_register (vlib_physmem_region_t * pr) vec_foreach_index (i, pr->page_table) { - dma_map.vaddr = pointer_to_uword (pr->mem) + (i << pr->log2_page_size); + dma_map.vaddr = + pointer_to_uword (pr->mem) + ((u64) i << pr->log2_page_size); dma_map.size = 1 << pr->log2_page_size; dma_map.iova = pr->page_table[i]; if (ioctl (fd, VFIO_IOMMU_MAP_DMA, &dma_map) != 0) @@ -221,7 +222,7 @@ unix_physmem_region_alloc (vlib_main_t * vm, char *name, u32 size, int i; for (i = 0; i < pr->n_pages; i++) { - void *ptr = pr->mem + (i << pr->log2_page_size); + void *ptr = pr->mem + ((u64) i << pr->log2_page_size); int node; move_pages (0, 1, &ptr, 0, &node, 0); if (numa_node != node) |