Re: [uClinux-dev] Re: [PATCH] NOMMU: implement access_remote_vm
2011/3/29 Greg Ungerer g...@snapgear.com: On 26/03/11 06:32, Mike Frysinger wrote: Recent vm changes brought in a new function which the core procfs code utilizes. So implement it for nommu systems too to avoid link failures. Signed-off-by: Mike Frysingervap...@gentoo.org Looks good. Acked-by: Greg Ungerer g...@uclinux.org It applys to my nuc700 arm7tdmi platform, thanks! Tested-by: Wan ZongShun mcuos@gmail.com --- mm/nommu.c | 52 +++- 1 files changed, 39 insertions(+), 13 deletions(-) diff --git a/mm/nommu.c b/mm/nommu.c index cb86e7d..c4c542c 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1971,21 +1971,10 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) } EXPORT_SYMBOL(filemap_fault); -/* - * Access another process' address space. - * - source/target buffer must be kernel space - */ -int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write) +static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, + unsigned long addr, void *buf, int len, int write) { struct vm_area_struct *vma; - struct mm_struct *mm; - - if (addr + len addr) - return 0; - - mm = get_task_mm(tsk); - if (!mm) - return 0; down_read(mm-mmap_sem); @@ -2010,6 +1999,43 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in } up_read(mm-mmap_sem); + + return len; +} + +/** + * @access_remote_vm - access another process' address space + * @mm: the mm_struct of the target address space + * @addr: start address to access + * @buf: source or destination buffer + * @len: number of bytes to transfer + * @write: whether the access is a write + * + * The caller must hold a reference on @mm. + */ +int access_remote_vm(struct mm_struct *mm, unsigned long addr, + void *buf, int len, int write) +{ + return __access_remote_vm(NULL, mm, addr, buf, len, write); +} + +/* + * Access another process' address space. + * - source/target buffer must be kernel space + */ +int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write) +{ + struct mm_struct *mm; + + if (addr + len addr) + return 0; + + mm = get_task_mm(tsk); + if (!mm) + return 0; + + len = __access_remote_vm(tsk, mm, addr, buf, len, write); + mmput(mm); return len; } -- Greg Ungerer -- Principal Engineer EMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com ___ 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 -- *linux-arm-kernel mailing list mail addr:linux-arm-ker...@lists.infradead.org you can subscribe by: http://lists.infradead.org/mailman/listinfo/linux-arm-kernel * linux-arm-NUC900 mailing list mail addr:nuc...@googlegroups.com main web: https://groups.google.com/group/NUC900 you can subscribe it by sending me mail: mcuos@gmail.com ___ 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
[uClinux-dev] Shared libraries + CVS
Hi guys. We're finally looking at doing some more uClinux dev after about 6 years of just maintenance work and I grabbed the latest uClinux dist (/20110210/) and found a build problem when I enable CONFIG_BINFMT_SHARED_FLAT when building for a m68knommu target, which we used to use on our old uClinux builds. I tracked the issue back to a change that's been made to uClibc between version 0.9.26 and 0.9.27 (so this problem would appear to affect every uClinux-dist since 2005?), where part of the makefile rules for building shared library code appears to have been removed, namely code including this from uClibc/Makefile: ifneq ($(SHARED_TARGET),) lib/main.o: $(ROOTDIR)/lib/libc/main.c $(CC) $(CFLAGS) $(ARCH_CFLAGS) -c -o $@ $(ROOTDIR)/lib/libc/main.c bogus $(SHARED_TARGET): lib/libc.a lib/main.o Makefile make -C $(ROOTDIR) relink $(CC) -nostartfiles -o $(SHARED_TARGET) $(ARCH_CFLAGS) -Wl,-elf2flt -nostdlib \ -Wl,-shared-lib-id,${LIBID} \ lib/main.o \ -Wl,--whole-archive,lib/libc.a,-lgcc,--no-whole-archive $(OBJCOPY) -L _GLOBAL_OFFSET_TABLE_ -L main -L __main -L _start \ -L __uClibc_main -L __uClibc_start_main -L lib_main \ -L _exit_dummy_ref \ -L __do_global_dtors -L __do_global_ctors \ -L __CTOR_LIST__ -L __DTOR_LIST__ \ -L _current_shared_library_a5_offset_ \ $(SHARED_TARGET).gdb $(LN) -sf $(SHARED_TARGET).gdb . endif So from what I can see, it would be impossible get uClinux-dist to build without hand-mods here. So I guess I'm just checking if: 1. Am I missing something? i.e. has something changed that I shouldn't be using this option for shared libraries anymore? 2. Does anyone know why this code was removed? There are other parts of the uClibc make system that seem to be pointless without it? And finally, uclinux.org CVS seems way out-of-date compared to the latest uClinux-dist releases, has the public source control gone away altogether, or just moved elsewhere? Thanks. Paul McGougan Senior Software Engineer Braintree Communications Pty Ltd -- This information together with any attachments is for the use of the intended recipient(s) only and may contain confidential and/or privileged information and is subject to copyright. If you have received this email in error please inform the sender as quickly as possible and delete this email and any copies of this information from your computer system network. If you are not the intended recipient of this email, you must not copy, distribute or take any action(s) that relies on this information. Any form of disclosure, modification, distribution and/or publication of this email is strictly prohibited. ___ 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
Re: [uClinux-dev] Shared libraries + CVS
On 1/04/2011 9:33 AM, Paul McGougan wrote: I tracked the issue back to a change that's been made to uClibc between version 0.9.26 and 0.9.27 (so this problem would appear to affect every uClinux-dist since 2005?), where part of the makefile rules for building shared library code appears to have been removed, namely code including this from uClibc/Makefile: So after some more checking I found that even though that makefile code was removed in the 0.9.27 branch of uClibc, I checked a later uClinux-dist (20070130) that includes uClibc 0.9.27 and the makefile rules appear in the uClinux-dist version of uClibc. So I guess the uClinux-dist guys added these rules back in themselves for the uClinux-dist version of uClibc? And if so, was this stopped in later uClinux-dist releases for a reason, or just by oversight? Regards, Paul McGougan Senior Software Engineer Braintree Communications Pty Ltd -- This information together with any attachments is for the use of the intended recipient(s) only and may contain confidential and/or privileged information and is subject to copyright. If you have received this email in error please inform the sender as quickly as possible and delete this email and any copies of this information from your computer system network. If you are not the intended recipient of this email, you must not copy, distribute or take any action(s) that relies on this information. Any form of disclosure, modification, distribution and/or publication of this email is strictly prohibited. ___ 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
Re: [uClinux-dev] Shared libraries + CVS
On Thu, Mar 31, 2011 at 7:33 PM, Paul McGougan wrote: And finally, uclinux.org CVS seems way out-of-date compared to the latest uClinux-dist releases, has the public source control gone away altogether, or just moved elsewhere? the public cvs has never really been a public cvs. more like when a new tarball is released, the contents were checked into cvs. it's a sham ! -mike ___ 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
Re: [uClinux-dev] Shared libraries + CVS
Jivin Mike Frysinger lays it down ... On Thu, Mar 31, 2011 at 7:33 PM, Paul McGougan wrote: And finally, uclinux.org CVS seems way out-of-date compared to the latest uClinux-dist releases, has the public source control gone away altogether, or just moved elsewhere? the public cvs has never really been a public cvs. more like when a new tarball is released, the contents were checked into cvs. it's a sham ! Thats right, it was never a public CVS for contributions, it was meant as a way to reduce peoples downloads by only getting what had changed. It also hasn't been updates for a long time and could be turned off IMO, Cheers, Davidm -- David McCullough, david_mccullo...@mcafee.com, Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org ___ 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
Re: [uClinux-dev] Shared libraries + CVS
Jivin Paul McGougan lays it down ... On 1/04/2011 9:33 AM, Paul McGougan wrote: I tracked the issue back to a change that's been made to uClibc between version 0.9.26 and 0.9.27 (so this problem would appear to affect every uClinux-dist since 2005?), where part of the makefile rules for building shared library code appears to have been removed, namely code including this from uClibc/Makefile: So after some more checking I found that even though that makefile code was removed in the 0.9.27 branch of uClibc, I checked a later uClinux-dist (20070130) that includes uClibc 0.9.27 and the makefile rules appear in the uClinux-dist version of uClibc. So I guess the uClinux-dist guys added these rules back in themselves for the uClinux-dist version of uClibc? And if so, was this stopped in later uClinux-dist releases for a reason, or just by oversight? It would have been lost as part of a merge of a newer uClibc, this stuff always seemed to be a moving target and caused pain during merges. My guess, it got lost by accident and no one picked up on it as it wasn't being used. Should be easy enoug to graft in what you had working/have found to get it back working again. Someone else would have to confirm because I haven't even looked sideways at this stuff forever, but I think shared lib support is/was broken in 2.6 ? Might be why it's gone unnoticed ? Cheers, Davidm -- David McCullough, david_mccullo...@mcafee.com, Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org ___ 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
Re: [uClinux-dev] Shared libraries + CVS
On Thu, Mar 31, 2011 at 8:10 PM, David McCullough wrote: Jivin Paul McGougan lays it down ... On 1/04/2011 9:33 AM, Paul McGougan wrote: I tracked the issue back to a change that's been made to uClibc between version 0.9.26 and 0.9.27 (so this problem would appear to affect every uClinux-dist since 2005?), where part of the makefile rules for building shared library code appears to have been removed, namely code including this from uClibc/Makefile: So after some more checking I found that even though that makefile code was removed in the 0.9.27 branch of uClibc, I checked a later uClinux-dist (20070130) that includes uClibc 0.9.27 and the makefile rules appear in the uClinux-dist version of uClibc. So I guess the uClinux-dist guys added these rules back in themselves for the uClinux-dist version of uClibc? And if so, was this stopped in later uClinux-dist releases for a reason, or just by oversight? It would have been lost as part of a merge of a newer uClibc, this stuff always seemed to be a moving target and caused pain during merges. My guess, it got lost by accident and no one picked up on it as it wasn't being used. Should be easy enoug to graft in what you had working/have found to get it back working again. Someone else would have to confirm because I haven't even looked sideways at this stuff forever, but I think shared lib support is/was broken in 2.6 ? Might be why it's gone unnoticed ? upstream uClibc has gained support for diff binary formats, so things like shared flat should work out of the box. i'm not saying that's a direct solution here, just that if it *doesnt* work, we'd like to know so we can get the fix merged. no need for uClinux-dist-specific build hacking anymore just for this stuff ... -mike ___ 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
Re: [uClinux-dev] Shared libraries + CVS
Hi David. Thanks for that. I thought that was probably just missed, but didn't want to waste time patching it back in, if it was fundamentally broken elsewhere. It should work under 2.6, our existing systems using uClinux are built using a heavily modified *very* old uClinux-dist with a 2.6 kernel and they are all using shared flat libraries. Guess I'd better get to it. Thanks again. Regards, On 1/04/2011 10:10 AM, David McCullough wrote: Jivin Paul McGougan lays it down ... On 1/04/2011 9:33 AM, Paul McGougan wrote: I tracked the issue back to a change that's been made to uClibc between version 0.9.26 and 0.9.27 (so this problem would appear to affect every uClinux-dist since 2005?), where part of the makefile rules for building shared library code appears to have been removed, namely code including this from uClibc/Makefile: So after some more checking I found that even though that makefile code was removed in the 0.9.27 branch of uClibc, I checked a later uClinux-dist (20070130) that includes uClibc 0.9.27 and the makefile rules appear in the uClinux-dist version of uClibc. So I guess the uClinux-dist guys added these rules back in themselves for the uClinux-dist version of uClibc? And if so, was this stopped in later uClinux-dist releases for a reason, or just by oversight? It would have been lost as part of a merge of a newer uClibc, this stuff always seemed to be a moving target and caused pain during merges. My guess, it got lost by accident and no one picked up on it as it wasn't being used. Should be easy enoug to graft in what you had working/have found to get it back working again. Someone else would have to confirm because I haven't even looked sideways at this stuff forever, but I think shared lib support is/was broken in 2.6 ? Might be why it's gone unnoticed ? Cheers, Davidm Paul McGougan Senior Software Engineer Braintree Communications Pty Ltd -- This information together with any attachments is for the use of the intended recipient(s) only and may contain confidential and/or privileged information and is subject to copyright. If you have received this email in error please inform the sender as quickly as possible and delete this email and any copies of this information from your computer system network. If you are not the intended recipient of this email, you must not copy, distribute or take any action(s) that relies on this information. Any form of disclosure, modification, distribution and/or publication of this email is strictly prohibited. ___ 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
Re: [uClinux-dev] Shared libraries + CVS
On 01/04/11 10:07, David McCullough wrote: Jivin Mike Frysinger lays it down ... On Thu, Mar 31, 2011 at 7:33 PM, Paul McGougan wrote: And finally, uclinux.org CVS seems way out-of-date compared to the latest uClinux-dist releases, has the public source control gone away altogether, or just moved elsewhere? the public cvs has never really been a public cvs. more like when a new tarball is released, the contents were checked into cvs. it's a sham ! Thats right, it was never a public CVS for contributions, it was meant as a way to reduce peoples downloads by only getting what had changed. It also hasn't been updates for a long time and could be turned off IMO, It should be killed. It is completely useless. Worse actually, it just confuses everyone... Rgeards Greg Greg Ungerer -- Principal EngineerEMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com ___ 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
Re: [uClinux-dev] Shared libraries + CVS
Hi Paul, On 01/04/11 10:21, Paul McGougan wrote: Hi David. Thanks for that. I thought that was probably just missed, but didn't want to waste time patching it back in, if it was fundamentally broken elsewhere. It should work under 2.6, our existing systems using uClinux are built using a heavily modified *very* old uClinux-dist with a 2.6 kernel and they are all using shared flat libraries. Guess I'd better get to it. I haven't bothered with shared libs for m68knommu for a long time. So I couldn't say if they work or not current 2.6 kernels or not. Let us know how you go :-) Regards Greg Thanks again. Regards, On 1/04/2011 10:10 AM, David McCullough wrote: Jivin Paul McGougan lays it down ... On 1/04/2011 9:33 AM, Paul McGougan wrote: I tracked the issue back to a change that's been made to uClibc between version 0.9.26 and 0.9.27 (so this problem would appear to affect every uClinux-dist since 2005?), where part of the makefile rules for building shared library code appears to have been removed, namely code including this from uClibc/Makefile: So after some more checking I found that even though that makefile code was removed in the 0.9.27 branch of uClibc, I checked a later uClinux-dist (20070130) that includes uClibc 0.9.27 and the makefile rules appear in the uClinux-dist version of uClibc. So I guess the uClinux-dist guys added these rules back in themselves for the uClinux-dist version of uClibc? And if so, was this stopped in later uClinux-dist releases for a reason, or just by oversight? It would have been lost as part of a merge of a newer uClibc, this stuff always seemed to be a moving target and caused pain during merges. My guess, it got lost by accident and no one picked up on it as it wasn't being used. Should be easy enoug to graft in what you had working/have found to get it back working again. Someone else would have to confirm because I haven't even looked sideways at this stuff forever, but I think shared lib support is/was broken in 2.6 ? Might be why it's gone unnoticed ? Cheers, Davidm Paul McGougan Senior Software Engineer Braintree Communications Pty Ltd -- Greg Ungerer -- Principal EngineerEMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com ___ 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
Re: [uClinux-dev] Shared libraries + CVS
On Thu, Mar 31, 2011 at 8:36 PM, Greg Ungerer wrote: On 01/04/11 10:07, David McCullough wrote: Jivin Mike Frysinger lays it down ... On Thu, Mar 31, 2011 at 7:33 PM, Paul McGougan wrote: And finally, uclinux.org CVS seems way out-of-date compared to the latest uClinux-dist releases, has the public source control gone away altogether, or just moved elsewhere? the public cvs has never really been a public cvs. more like when a new tarball is released, the contents were checked into cvs. it's a sham ! Thats right, it was never a public CVS for contributions, it was meant as a way to reduce peoples downloads by only getting what had changed. It also hasn't been updates for a long time and could be turned off IMO, It should be killed. It is completely useless. Worse actually, it just confuses everyone... to be clear, just the uclinux-dist dirs. the elf2flt stuff is active and up-to-date. -mike ___ 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