Gavin Maltby wrote: > Hi, > > On 08/09/07 22:46, Joachim Worringen wrote: > [cut] >> Why does map_len have to be page-aligned? devmap(9E) doesn't mention >> this (says it has to be <= the mmap() len), and the example there does >> no alignment, too. Also, I tried and returned ptob(btopr((len)), but >> it did not fix the problem (and violated the maplen <= len constraint >> - but ptob(btop((len)) wouldn't make sense, either). > > A page is the smallest currency unit for the MMU which polices page > mappings - you can't expose less than a page from kernel to userland > since once the page is loaded into the TLB after the intial pagefault > in userland you won't trap again for as long as it remains loaded - > so you have no way to stop userland accessing other bits of the page. > > Perhaps devmap(9E) does not mention that, but it is alluded to in > pages such as ddi_umem_alloc(9F) and devmap_umem_setup(9F).
Thanks - I assumed that the (obviosly) necessary alignments are done someplace else and did not want to just change the specified lenght w/o "approval" by the man page. Also, devmap_umem_setup(9F) does *not* fail if the koff+len range is *not* page aligned, but silently aligns it itself. I see some inconsisteny here, and feel it would not harm to mention these alignment requirements in devmap(9F) as well. The big advantage of Solaris are the clearly defined interfaces, so they should be documented as clearly. I filed a RFE. Joachim -- Joachim Worringen, Software Architect, Dolphin Interconnect Solutions phone ++49/(0)228/324 08 17 - http://www.dolphinics.com _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
