mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-05-04 14:23:46 +00:00
The function currently known as flush_icache_user_range only operates on a single page. Rename it to flush_icache_user_page as we'll need the name flush_icache_user_range for something else soon. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Greentime Hu <green.hu@gmail.com> Cc: Vincent Chen <deanbo422@gmail.com> Cc: Jonas Bonn <jonas@southpole.se> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Cc: Stafford Horne <shorne@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Palmer Dabbelt <palmer@sifive.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20200515143646.3857579-20-hch@lst.de Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
62 lines
2 KiB
C
62 lines
2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ALPHA_CACHEFLUSH_H
|
|
#define _ALPHA_CACHEFLUSH_H
|
|
|
|
#include <linux/mm.h>
|
|
|
|
/* Note that the following two definitions are _highly_ dependent
|
|
on the contexts in which they are used in the kernel. I personally
|
|
think it is criminal how loosely defined these macros are. */
|
|
|
|
/* We need to flush the kernel's icache after loading modules. The
|
|
only other use of this macro is in load_aout_interp which is not
|
|
used on Alpha.
|
|
|
|
Note that this definition should *not* be used for userspace
|
|
icache flushing. While functional, it is _way_ overkill. The
|
|
icache is tagged with ASNs and it suffices to allocate a new ASN
|
|
for the process. */
|
|
#ifndef CONFIG_SMP
|
|
#define flush_icache_range(start, end) imb()
|
|
#else
|
|
#define flush_icache_range(start, end) smp_imb()
|
|
extern void smp_imb(void);
|
|
#endif
|
|
|
|
/* We need to flush the userspace icache after setting breakpoints in
|
|
ptrace.
|
|
|
|
Instead of indiscriminately using imb, take advantage of the fact
|
|
that icache entries are tagged with the ASN and load a new mm context. */
|
|
/* ??? Ought to use this in arch/alpha/kernel/signal.c too. */
|
|
|
|
#ifndef CONFIG_SMP
|
|
#include <linux/sched.h>
|
|
|
|
extern void __load_new_mm_context(struct mm_struct *);
|
|
static inline void
|
|
flush_icache_user_page(struct vm_area_struct *vma, struct page *page,
|
|
unsigned long addr, int len)
|
|
{
|
|
if (vma->vm_flags & VM_EXEC) {
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
if (current->active_mm == mm)
|
|
__load_new_mm_context(mm);
|
|
else
|
|
mm->context[smp_processor_id()] = 0;
|
|
}
|
|
}
|
|
#define flush_icache_user_page flush_icache_user_page
|
|
#else /* CONFIG_SMP */
|
|
extern void flush_icache_user_page(struct vm_area_struct *vma,
|
|
struct page *page, unsigned long addr, int len);
|
|
#define flush_icache_user_page flush_icache_user_page
|
|
#endif /* CONFIG_SMP */
|
|
|
|
/* This is used only in __do_fault and do_swap_page. */
|
|
#define flush_icache_page(vma, page) \
|
|
flush_icache_user_page((vma), (page), 0, 0)
|
|
|
|
#include <asm-generic/cacheflush.h>
|
|
|
|
#endif /* _ALPHA_CACHEFLUSH_H */
|