Re: ioremap() address alignment problem

MOLNAR Ingo (mingo@chiara.csoma.elte.hu)
Fri, 18 Dec 1998 14:11:33 +0100 (CET)


On Fri, 18 Dec 1998, Martin Mares wrote:

> > When I do vremap(0xf420 1400), I get an error. So I try a range of addresses
> > around (from 0xf420 1000 to 0xf420 1000 + 5000), and it seems like vremap()
> > only works for page aligned addresses. Is it normal ?

> [Note to Alan: I think we should modify vremap() in 2.0 to handle
> this automatically since there are BIOSes which don't page-align
> base addresses (not a bug, only a rare feature) and it could bite
> even for usual devices.]

this will somewhat change the kernel's VM layout: if one driver maps
(0x1000-0x1800), then several other drivers map different addresses. Then
another driver comes and wants (0x1800-8000) to get mapped. We cannot use
the previous mapping (we wont even notice that there is an alias), and we
will re-map the range, duplicating the mapping to the same physical page.
While this should not cause any problems, it's a new property ... also,
it's a slight inefficiency, it's obviously better to have a single virtual
mapping to the same physical page. We cannot make the 'other' mapping
bigger, because get_vm_area() tightly packs pages, with only a single
virtual page inbetween. We could declare the hardware broken, but it's not
really broken per spec. It's not really a problem either, but it just
annoys me a bit that we cannot get it 100% right with a simple method ;)

-- mingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/