[RFC PATCH] uprobes: copy to user-space xol page with proper cache flushing
David Miller
davem at davemloft.net
Tue Apr 15 19:24:23 PDT 2014
From: Victor Kamensky <victor.kamensky at linaro.org>
Date: Tue, 15 Apr 2014 18:42:39 -0700
> +void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
> + void *src, unsigned long len)
> +{
> + /* Initialize the slot */
> + copy_to_page(page, vaddr, src, len);
> +
> + /*
> + * We probably need flush_icache_user_range() but it needs vma.
> + * This should work on most of architectures by default. If
> + * architecture needs to do something different it can define
> + * its own version of the function.
> + */
> + flush_dcache_page(page);
> +}
> +
I would say that, if anything, flush_dcache_page() is unnecessary
if you just copy straight to userspace.
The default implementation should be copy_to_user(), and that's what
every architecture can use if it needs no I-cache flushing.
More information about the linux-arm-kernel
mailing list