From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from www.hansjkoch.de (www.hansjkoch.de [178.63.77.200]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AC98CB7090 for ; Tue, 18 Oct 2011 04:19:34 +1100 (EST) Date: Mon, 17 Oct 2011 19:18:59 +0200 From: "Hans J. Koch" To: Kumar Gala Subject: Re: [PATCH] uio: Support 36-bit physical addresses on 32-bit systems Message-ID: <20111017171859.GB13919@local> References: <1318521058-15662-1-git-send-email-galak@kernel.crashing.org> <20111014183144.GD28556@local> <4D73F261-3795-4F71-9921-568C1B9F06E0@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <4D73F261-3795-4F71-9921-568C1B9F06E0@kernel.crashing.org> Cc: linuxppc-dev@ozlabs.org, "Hans J. Koch" , Kai Jiang , linux-kernel@vger.kernel.org, gregkh@suse.de List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Oct 17, 2011 at 11:00:55AM -0500, Kumar Gala wrote: > > On Oct 14, 2011, at 1:31 PM, Hans J. Koch wrote: > > > On Thu, Oct 13, 2011 at 10:50:58AM -0500, Kumar Gala wrote: > >> From: Kai Jiang > >> > >> To support >32-bit physical addresses for UIO_MEM_PHYS type we need to > >> extend the width of 'addr' in struct uio_mem. Numerous platforms like > >> embedded PPC, ARM, and X86 have support for systems with larger physical > >> address than logical. > >> > >> Since 'addr' may contain a physical, logical, or virtual address the > >> easiest solution is to just change the type to 'phys_addr_t' which > >> should always be greater than or equal to the sizeof(void *) such that > >> it can properly hold any of the address types. > >> > >> For physical address we can support up to a 44-bit physical address on a > >> typical 32-bit system as we utilize remap_pfn_range() for the mapping of > >> the memory region and pfn's are represnted by shifting the address by > >> the page size (typically 4k). > >> > >> Signed-off-by: Kai Jiang > >> Signed-off-by: Minghuan Lian > >> Signed-off-by: Kumar Gala > > > > Signed-off-by: "Hans J. Koch" > > > > That looks good to me. There's an unnecessary cast (see below), but I fixed that > > on the way. > > > > Greg, please pull this from branch uio-for-gregkh from > > > > git://hansjkoch.de/git/linux-hjk > > > > Thanks, > > Hans > > I think removing that cast is wrong: > > drivers/uio/uio.c: In function 'uio_vma_fault': > drivers/uio/uio.c:637:26: warning: cast to pointer from integer of different size Hmm, on what platform did you see this? I tested on 32bit-x86 and didn't get any warnings. Hans From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932076Ab1JQRTd (ORCPT ); Mon, 17 Oct 2011 13:19:33 -0400 Received: from www.hansjkoch.de ([178.63.77.200]:49580 "EHLO www.hansjkoch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753531Ab1JQRTc (ORCPT ); Mon, 17 Oct 2011 13:19:32 -0400 Date: Mon, 17 Oct 2011 19:18:59 +0200 From: "Hans J. Koch" To: Kumar Gala Cc: "Hans J. Koch" , linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, gregkh@suse.de, Kai Jiang Subject: Re: [PATCH] uio: Support 36-bit physical addresses on 32-bit systems Message-ID: <20111017171859.GB13919@local> References: <1318521058-15662-1-git-send-email-galak@kernel.crashing.org> <20111014183144.GD28556@local> <4D73F261-3795-4F71-9921-568C1B9F06E0@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D73F261-3795-4F71-9921-568C1B9F06E0@kernel.crashing.org> 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 On Mon, Oct 17, 2011 at 11:00:55AM -0500, Kumar Gala wrote: > > On Oct 14, 2011, at 1:31 PM, Hans J. Koch wrote: > > > On Thu, Oct 13, 2011 at 10:50:58AM -0500, Kumar Gala wrote: > >> From: Kai Jiang > >> > >> To support >32-bit physical addresses for UIO_MEM_PHYS type we need to > >> extend the width of 'addr' in struct uio_mem. Numerous platforms like > >> embedded PPC, ARM, and X86 have support for systems with larger physical > >> address than logical. > >> > >> Since 'addr' may contain a physical, logical, or virtual address the > >> easiest solution is to just change the type to 'phys_addr_t' which > >> should always be greater than or equal to the sizeof(void *) such that > >> it can properly hold any of the address types. > >> > >> For physical address we can support up to a 44-bit physical address on a > >> typical 32-bit system as we utilize remap_pfn_range() for the mapping of > >> the memory region and pfn's are represnted by shifting the address by > >> the page size (typically 4k). > >> > >> Signed-off-by: Kai Jiang > >> Signed-off-by: Minghuan Lian > >> Signed-off-by: Kumar Gala > > > > Signed-off-by: "Hans J. Koch" > > > > That looks good to me. There's an unnecessary cast (see below), but I fixed that > > on the way. > > > > Greg, please pull this from branch uio-for-gregkh from > > > > git://hansjkoch.de/git/linux-hjk > > > > Thanks, > > Hans > > I think removing that cast is wrong: > > drivers/uio/uio.c: In function 'uio_vma_fault': > drivers/uio/uio.c:637:26: warning: cast to pointer from integer of different size Hmm, on what platform did you see this? I tested on 32bit-x86 and didn't get any warnings. Hans