Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932178AbbDMJTu (ORCPT ); Mon, 13 Apr 2015 05:19:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43308 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753681AbbDMJTq (ORCPT ); Mon, 13 Apr 2015 05:19:46 -0400 Date: Mon, 13 Apr 2015 17:19:38 +0800 From: Honggang LI To: Eli Cohen Cc: "netdev@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [linux-next PATCH] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures Message-ID: <20150413091937.GA23372@honli.nay.redhat.com> References: <1428836751-23037-1-git-send-email-honli@redhat.com> <20150413003333.GA17193@honli.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1481 Lines: 38 On Mon, Apr 13, 2015 at 06:47:11AM +0000, Eli Cohen wrote: > 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. > I will resent the patch. > > > > > > @@ -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 > small. Sorry. It was a typo. It should be MLX5_U64_4K_PAGE_MASK. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/