Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753076AbbDMGrR (ORCPT ); Mon, 13 Apr 2015 02:47:17 -0400 Received: from mail-db3on0095.outbound.protection.outlook.com ([157.55.234.95]:17920 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751418AbbDMGrO convert rfc822-to-8bit (ORCPT ); Mon, 13 Apr 2015 02:47:14 -0400 From: Eli Cohen To: Honggang LI 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 Thread-Topic: [linux-next PATCH] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures Thread-Index: AQHQdRCqySYizaR760qJF6mzwdgJzJ1JdmsggACiZYCAAGhBoA== Date: Mon, 13 Apr 2015 06:47:11 +0000 Message-ID: References: <1428836751-23037-1-git-send-email-honli@redhat.com> <20150413003333.GA17193@honli.nay.redhat.com> In-Reply-To: <20150413003333.GA17193@honli.nay.redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.47.165.251] authentication-results: redhat.com; dkim=none (message not signed) header.d=none; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB4PR05MB445; x-microsoft-antispam-prvs: x-forefront-antispam-report: BMV:1;SFV:NSPM;SFS:(10009020)(6009001)(51704005)(24454002)(46102003)(110136001)(66066001)(2656002)(92566002)(62966003)(74316001)(77156002)(77096005)(102836002)(87936001)(76176999)(54356999)(50986999)(40100003)(33656002)(122556002)(86362001)(2950100001)(76576001)(106116001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB4PR05MB445;H:DB4PR05MB448.eurprd05.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:DB4PR05MB445;BCL:0;PCL:0;RULEID:;SRVR:DB4PR05MB445; x-forefront-prvs: 0545EFAC9A Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2015 06:47:11.6290 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR05MB445 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1284 Lines: 30 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 small. -- 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/