mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kumar Gala <galak@kernel.crashing.org>
To: "Hans J. Koch" <hjk@linutronix.de>
Cc: Greg KH <gregkh@suse.de>,
	"linux-kernel@vger.kernel.org List"
	<linux-kernel@vger.kernel.org>
Subject: Re: UIO support for >32-bit physical addresses on 32-bit platforms
Date: Tue, 23 Feb 2010 16:52:56 -0600	[thread overview]
Message-ID: <100F3ED0-597E-4F4F-83CC-CC8505E3563F@kernel.crashing.org> (raw)
In-Reply-To: <20100223194946.GA1941@local>


On Feb 23, 2010, at 1:49 PM, Hans J. Koch wrote:

> On Tue, Feb 23, 2010 at 07:01:41AM -0800, Greg KH wrote:
>> On Tue, Feb 23, 2010 at 08:54:16AM -0600, Kumar Gala wrote:
>>> Hans, Greg,
>>> 
>>> We are looking at using UIO for some driver work and noticed it
>>> assumes the address for MMIO regions is an 'unsigned long'.  This is a
>>> problem for the platforms we have in which we support a 36-bit
>>> physical address in a 32-bit machine.
>>> 
>>> Should we just change addr/size in struct uio_mem to u64 always?
> 
> No, if I didn't miss something important, it's not feasible IMHO.
> 
>>> At
>>> first I was thinking phys_addr_t but realized the addr could be PHYS,
>>> LOGICAL, or VIRTUAL.
>> 
>> I think that would work out fine, Hans, any ideas if this would cause
>> any problems with existing code or not?
> 
> It won't work. This is not a UIO problem. UIO just passes addr to other
> system functions, and all of them use "unsigned long" for these addresses.
> You'd have to change the whole memory management code.
> 
> Note that members vm_start and vm_end in struct vm_area_struct are
> also unsigned long. Having an u64 in the UIO core doesn't help at all.

This already works for mmap since we pass down a PFN and not an address to remap_pfn_range.  While we can handle any physical address size we can handle one up to 44 bits on most architectures which is well beyond the 36-bit physical address case I'm dealing with on PPC.

> Memory above the 4G border can only be accessed through himem mechanisms
> or be mapped to an address below that border in lowlevel arch code.
> 
> In most cases, I'd say it's bad board design to have memory-mapped hardware
> above the 4G border on a 32-bit machine.

While I might agree with you its a reality on a number of embedded processors and I know three different PowerPC based embedded families that have 36-bit physical addressing to allow for >4G of DDR and thus IO ends up being above the 4G physical boundary and we already support these in the kernel.

- k

  reply	other threads:[~2010-02-23 22:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-23 14:54 Kumar Gala
2010-02-23 15:01 ` Greg KH
2010-02-23 19:49   ` Hans J. Koch
2010-02-23 22:52     ` Kumar Gala [this message]
2010-02-23 23:39       ` Hans J. Koch
2010-02-24  3:24         ` Kumar Gala
2010-02-24 13:47           ` Hans J. Koch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=100F3ED0-597E-4F4F-83CC-CC8505E3563F@kernel.crashing.org \
    --to=galak@kernel.crashing.org \
    --cc=gregkh@suse.de \
    --cc=hjk@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome