flush_dcache_page from user space.

Arun KS getarunks at gmail.com
Tue Apr 1 02:20:11 EDT 2014


Hi Ratheesh,

On Tue, Apr 1, 2014 at 9:28 AM, ratheesh kannoth <ratheesh.ksz at gmail.com> wrote:
> I  mmap'ed  mmory allocated by  kmalloc , to userspace.  I can modify
> data ( in that memory region )  from  kernel space or userspace  and
> call flush_dcache_page to get it refected  in both kernel and
> userspace.

This requirement depends on what cache your hardware has.
Can you give more details about your processor?

If you have VIPT non aliasing cache or PIPT cache, you don't need to
do anything.

>
> 1)  if i modify a value from userspace,  is there any other way to
> flush dcache page from userspace. What i am looking is to avoid
> context switch ( to get into kernel  only to call   flush_dcache_page
> ) ?

Use __clear_cache.
But this will result in a system call and do a v7_coherent_user_range
in case of armv architectures.

Thanks,
Arun
>
>
> Thanks,
> Ratheesh
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



More information about the Kernelnewbies mailing list