[lkml]   [2015]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: [linux-next PATCH] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures
 On Mon, Apr 13, 2015 at 08:33:33AM +0800, Honggang LI wrote:
> Yes, replaced all of the PAGE_MASK in the file. Please see attched new
> patch.

I think you need to send the new patch inline in your email.

> >
> > @@ -241,7 +243,7 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr) static int alloc_system_page(struct mlx5_core_dev *dev, u16 func_id) {
> > struct page *page;
> > - u64 addr;
> > + u64 addr = 0; [Eli] Why is this required?
> For 32bit architectures, if CONFIG_ARCH_DMA_ADDR_T_64BIT disabled and
> physical memory is less than 4GB, dma_map_page will return an u32 integer
> less than 0xffff_ffff. And if addr had been initialized with random
> rubbish in the stack of alloc_system_page, the high four bytes is
> unpredictable. The new mask, MLX5_NUM_4K_IN_PAGE, will reserve the high
> four bytes. So, free_4k/find_fw_page will randomly failed.

Sorry, I still don't understand the issue here. MLX5_NUM_4K_IN_PAGE is
not a mask and will always get the correct value which is fairly

 \ /
  Last update: 2015-04-13 09:21    [W:0.067 / U:3.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site