[prev in list] [next in list] [prev in thread] [next in thread]
List: uclinux-dev
Subject: [uClinux-dev] [stevel@netspectrum.com: Re: [PATCH 4/4] MTD: Fix a
From: Jun Sun <jsun () netspectrum ! com>
Date: 2008-09-27 4:12:00
Message-ID: 20080927041200.GA14242 () srv ! junsun ! net
[Download RAW message or body]
*argh* Can whoever maintain the list please add Steve to the mailing list?
Sent on Steve's behalf.
Jun
----- Forwarded message from Steve Longerbeam <stevel@netspectrum.com> -----
Date: Fri, 26 Sep 2008 16:15:12 -0700
From: Steve Longerbeam <stevel@netspectrum.com>
To: David Howells <dhowells@redhat.com>
CC: Jun Sun <jsun@junsun.net>, dwmw2@infradead.org, uclinux-dev@uclinux.org
Subject: Re: [PATCH 4/4] MTD: Fix a bad dependency in the Blackfin code
Jun Sun wrote:
>We applied an older version of this patch to 2.6.21 kernel (2007 distro)
>
>http://mailman.uclinux.org/pipermail/uclinux-dev/2007-February/042088.html
>
>Steve found out that an additional patch is needed to make userland XIP
>work. See the attachement.
>
>So userland XIP on 2.6 is finally a reality! :) Thanks to David and all
>others
>who replied.
>
>
I still have some issues with the behavior of nommu.c:determine_vm_flags().
It seems that in the case of a private mapping over a directly-mappable
backing store, the only requirement is that it be read-only. Is that
correct?
If so, that check was already made in validate_mmap_request()
(BDI_CAP_MAP_DIRECT is cleared if requesting a read/write mapping). So
if we get to the "private file mapping for a directly mappable backing
store" case in determine_vm_flags(), we know at this point that it is
also a read-only mapping.
And if the backing store is capable of being directly mapped, it will
also be readable, so the vm_flags meet the capabilities of the backing
store in that case. So attached is another patch that implements this idea.
Steve
----- End forwarded message -----
["linux-2.6.x.davidh.2.patch" (text/plain)]
diff -Nuar -X /home/stevel/dontdiff linux-2.6.x.davidh/drivers/mtd/mtdchar.c \
linux-2.6.x/drivers/mtd/mtdchar.c
--- linux-2.6.x.davidh/drivers/mtd/mtdchar.c 2008-09-26 15:59:01.000000000 -0700
+++ linux-2.6.x/drivers/mtd/mtdchar.c 2008-09-24 18:50:36.000000000 -0700
@@ -10,6 +10,7 @@
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
+#include <linux/mm.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sched.h>
diff -Nuar -X /home/stevel/dontdiff linux-2.6.x.davidh/mm/nommu.c \
linux-2.6.x/mm/nommu.c
--- linux-2.6.x.davidh/mm/nommu.c 2008-09-26 15:57:05.000000000 -0700
+++ linux-2.6.x/mm/nommu.c 2008-09-26 15:55:52.000000000 -0700
@@ -673,8 +673,12 @@
* romfs/cramfs */
if (flags & MAP_SHARED)
vm_flags |= VM_MAYSHARE | VM_SHARED;
- else if ((((vm_flags & capabilities) ^ vm_flags) & BDI_CAP_VMFLAGS) == 0)
+ else {
+ /* we already know this private mapping is read-only
+ * from the validate_mmap_request() checks above, so
+ * we can allow it */
vm_flags |= VM_MAYSHARE;
+ }
}
/* refuse to let anyone share private mappings with this process if
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic