lkml.org 
[lkml]   [2008]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] [mm/nommu]: use copy_to_user_page to call flush icache for [#811] toolchain old bug
Is this patch OK for the nommu, David?

Thanks
-Bryan

On Mon, May 12, 2008 at 6:32 PM, Bryan Wu <cooloney@kernel.org> wrote:
> From: Jie Zhang <jie.zhang@analog.com>
>
> access_process_vm in mm/memory.c uses copy_to_user_page and
> copy_from_user_page. So for !MMU we'd better do the same thing.
> Other archs with mmu do the cache flush in copy_to_user_page.
> It gives me hint that copy_to_user_page is designed to flush
> the cache. On other side, no archs do the cache flush ptrace.
>
> Signed-off-by: Jie Zhang <jie.zhang@analog.com>
> Signed-off-by: Bryan Wu <cooloney@kernel.org>
> ---
> mm/nommu.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/mm/nommu.c b/mm/nommu.c
> index c11e5cc..56bb447 100644
> --- a/mm/nommu.c
> +++ b/mm/nommu.c
> @@ -1458,9 +1458,11 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
>
> /* only read or write mappings where it is permitted */
> if (write && vma->vm_flags & VM_MAYWRITE)
> - len -= copy_to_user((void *) addr, buf, len);
> + copy_to_user_page(vma, NULL, NULL,
> + (void *) addr, buf, len);
> else if (!write && vma->vm_flags & VM_MAYREAD)
> - len -= copy_from_user(buf, (void *) addr, len);
> + copy_from_user_page(vma, NULL, NULL,
> + buf, (void *) addr, len);
> else
> len = 0;
> } else {
> --
> 1.5.5
>
>


\
 
 \ /
  Last update: 2008-05-15 08:27    [from the cache]
©2003-2011 Jasper Spaans