Re: [PATCH] NOMMU: Fix MAP_PRIVATE mmap() of objects where the data can be mapped directly

From: graff yang
Date: Fri Sep 25 2009 - 07:05:36 EST


On Fri, Sep 25, 2009 at 4:24 PM, David Howells <dhowells@xxxxxxxxxx> wrote:
> graff yang <graff.yang@xxxxxxxxx> wrote:
>
>> > + Â Â Â if (capabilities & BDI_CAP_MAP_DIRECT) {
>>
>> This will breaks many drivers, e.g. some frame-buffer drivers, on NOMMU
>> system. ÂBecause they don't have get_unmapped_area(). ÂThese drivers depend
>> on it's mmap() to return the frame-buffer base address.
>
> Then they won't work on NOMMU. ÂRead Documentation/nommu-mmap.txt:
>
> Â Â Â Â============================================
> Â Â Â ÂPROVIDING SHAREABLE CHARACTER DEVICE SUPPORT
> Â Â Â Â============================================
>
> Â Â Â ÂTo provide shareable character device support, a driver must provide a
> Â Â Â Âfile->f_op->get_unmapped_area() operation. The mmap() routines will
> Â Â Â Âcall this to get a proposed address for the mapping. This may return an
> Â Â Â Âerror if it doesn't wish to honour the mapping because it's too long,
> Â Â Â Âat a weird offset, under some unsupported combination of flags or
> Â Â Â Âwhatever.
>
> The chardev driver doesn't provide the virtual address through its mmap() fop
> in MMU-mode either - that's provided by do_mmap_pgoff().
>
> David
>
OK, I think do_mmap_pgoff() now looks nice with your patch. Merely,
at least the alsa/fb driver
will crash due to the vm_region changes.
The alsa guys are fixing this issue:
http://mailman.alsa-project.org/pipermail/alsa-devel/2009-March/015802.html

Is there any other things be affected?

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