Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751988AbbD3AHK (ORCPT ); Wed, 29 Apr 2015 20:07:10 -0400 Received: from mail-by2on0075.outbound.protection.outlook.com ([207.46.100.75]:38309 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751252AbbD3AHH convert rfc822-to-8bit (ORCPT ); Wed, 29 Apr 2015 20:07:07 -0400 From: "Daney, David" To: Ido Shamay , David Daney , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "David S. Miller" CC: Roland Dreier , Sean Hefty , "Hal Rosenstock" , Amir Vadai , "Or Gerlitz" , Yishai Hadas , "Matan Barak" , Majd Dibbiny , "Jack Morgenstein" , Moni Shoua , Eugenia Emantayev , Saeed Mahameed , Yuval Atias , Maor Gottlieb , David Daney Subject: RE: [PATCH RFC] net/mlx4: Remove improper usage of dma_alloc_coherent(). Thread-Topic: [PATCH RFC] net/mlx4: Remove improper usage of dma_alloc_coherent(). Thread-Index: AQHQcL2GTa/qJarHcUSpHCGmwboAcJ1B9MQAgAf6XQCAGjzRAIAApP/w Date: Thu, 30 Apr 2015 00:07:05 +0000 Message-ID: References: <1428361229-31542-1-git-send-email-ddaney.cavm@gmail.com> <55243362.5040207@dev.mellanox.co.il> <552AE4A4.30005@dev.mellanox.co.il> <5540E71E.2050200@dev.mellanox.co.il> In-Reply-To: <5540E71E.2050200@dev.mellanox.co.il> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dev.mellanox.co.il; dkim=none (message not signed) header.d=none; x-originating-ip: [12.108.191.226] x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1717; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN3PR0701MB1717;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1717; x-forefront-prvs: 056297E276 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(164054003)(51704005)(479174004)(46102003)(33656002)(40100003)(122556002)(74316001)(50986999)(54356999)(76176999)(92566002)(86362001)(102836002)(62966003)(93886004)(2950100001)(76576001)(2501003)(2900100001)(77156002)(66066001)(99286002)(19580405001)(5001770100001)(106116001)(2656002)(19580395003)(2201001)(87936001)(5001960100002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1717;H:BN3PR0701MB1719.namprd07.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2015 00:07:05.2135 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2252 Lines: 51 First of all, let me apologize for top posting, but it is currently my only option. I have been away from my office for the last couple of weeks, I was going to re-send on Monday, May 4. If you would like to do it before then, please go ahead and do that. Thanks, David Daney -----Original Message----- From: Ido Shamay [mailto:idos@dev.mellanox.co.il] Sent: Wednesday, April 29, 2015 7:14 AM To: David Daney; linux-kernel@vger.kernel.org; netdev@vger.kernel.org; linux-rdma@vger.kernel.org; David S. Miller Cc: Roland Dreier; Sean Hefty; Hal Rosenstock; Amir Vadai; Or Gerlitz; Yishai Hadas; Matan Barak; Majd Dibbiny; Jack Morgenstein; Moni Shoua; Eugenia Emantayev; Saeed Mahameed; Yuval Atias; Maor Gottlieb; David Daney Subject: Re: [PATCH RFC] net/mlx4: Remove improper usage of dma_alloc_coherent(). On 4/13/2015 12:33 AM, Ido Shamay wrote: > On 4/7/2015 10:43 PM, Ido Shamay wrote: >> On 4/7/2015 2:00 AM, David Daney wrote: >>> From: David Daney >>> >>> The dma_alloc_coherent() function returns a virtual address which >>> can be used for coherent access to the underlying memory. On some >>> architectures, like arm64, undefined behavior results if this memory >>> is also accessed via virtual mappings that are not coherent. Because >>> of their undefined nature, operations like virt_to_page() return >>> garbage when passed virtual addresses obtained from >>> dma_alloc_coherent(). Any subsequent mappings via vmap() of the >>> garbage page values are unusable and result in bad things like bus >>> errors (synchronous aborts in ARM64 speak). >>> >>> The MLX4 driver contains code that does the equivalent of: >>> >>> vmap(virt_to_page(dma_alloc_coherent)) >>> >>> This results in an OOPs when the device is opened. >>> >>> To fix this... >>> >>> Always use result of dma_alloc_coherent() directly. > Acked-by: Ido Shamay Thanks David, this is good > for us Hi David, Are you resending this patch or you want us to do that? -- 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/