diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-12-01 19:39:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-12-01 19:39:12 -0500 |
commit | e1ba1c99dad92c5917b22b1047cf36e4426b124a (patch) | |
tree | e812f55a2442ad85f810b6877bbd4f5193156b84 /arch/riscv/include/asm/cacheflush.h | |
parent | 4b1967c90af473e3a8bec00024758a3e676cea2d (diff) | |
parent | 3b62de26cf5ef17340a0e986d3e53eb4f74f96d5 (diff) |
Merge tag 'riscv-for-linus-4.15-rc2_cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/linux
Pull RISC-V cleanups and ABI fixes from Palmer Dabbelt:
"This contains a handful of small cleanups that are a result of
feedback that didn't make it into our original patch set, either
because the feedback hadn't been given yet, I missed the original
emails, or we weren't ready to submit the changes yet.
I've been maintaining the various cleanup patch sets I have as their
own branches, which I then merged together and signed. Each merge
commit has a short summary of the changes, and each branch is based on
your latest tag (4.15-rc1, in this case). If this isn't the right way
to do this then feel free to suggest something else, but it seems sane
to me.
Here's a short summary of the changes, roughly in order of how
interesting they are.
- libgcc.h has been moved from include/lib, where it's the only
member, to include/linux. This is meant to avoid tab completion
conflicts.
- VDSO entries for clock_get/gettimeofday/getcpu have been added.
These are simple syscalls now, but we want to let glibc use them
from the start so we can make them faster later.
- A VDSO entry for instruction cache flushing has been added so
userspace can flush the instruction cache.
- The VDSO symbol versions for __vdso_cmpxchg{32,64} have been
removed, as those VDSO entries don't actually exist.
- __io_writes has been corrected to respect the given type.
- A new READ_ONCE in arch_spin_is_locked().
- __test_and_op_bit_ord() is now actually ordered.
- Various small fixes throughout the tree to enable allmodconfig to
build cleanly.
- Removal of some dead code in our atomic support headers.
- Improvements to various comments in our atomic support headers"
* tag 'riscv-for-linus-4.15-rc2_cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/linux: (23 commits)
RISC-V: __io_writes should respect the length argument
move libgcc.h to include/linux
RISC-V: Clean up an unused include
RISC-V: Allow userspace to flush the instruction cache
RISC-V: Flush I$ when making a dirty page executable
RISC-V: Add missing include
RISC-V: Use define for get_cycles like other architectures
RISC-V: Provide stub of setup_profiling_timer()
RISC-V: Export some expected symbols for modules
RISC-V: move empty_zero_page definition to C and export it
RISC-V: io.h: type fixes for warnings
RISC-V: use RISCV_{INT,SHORT} instead of {INT,SHORT} for asm macros
RISC-V: use generic serial.h
RISC-V: remove spin_unlock_wait()
RISC-V: `sfence.vma` orderes the instruction cache
RISC-V: Add READ_ONCE in arch_spin_is_locked()
RISC-V: __test_and_op_bit_ord should be strongly ordered
RISC-V: Remove smb_mb__{before,after}_spinlock()
RISC-V: Remove __smp_bp__{before,after}_atomic
RISC-V: Comment on why {,cmp}xchg is ordered how it is
...
Diffstat (limited to 'arch/riscv/include/asm/cacheflush.h')
-rw-r--r-- | arch/riscv/include/asm/cacheflush.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/asm/cacheflush.h index 0595585013b0..efd89a88d2d0 100644 --- a/arch/riscv/include/asm/cacheflush.h +++ b/arch/riscv/include/asm/cacheflush.h | |||
@@ -18,22 +18,44 @@ | |||
18 | 18 | ||
19 | #undef flush_icache_range | 19 | #undef flush_icache_range |
20 | #undef flush_icache_user_range | 20 | #undef flush_icache_user_range |
21 | #undef flush_dcache_page | ||
21 | 22 | ||
22 | static inline void local_flush_icache_all(void) | 23 | static inline void local_flush_icache_all(void) |
23 | { | 24 | { |
24 | asm volatile ("fence.i" ::: "memory"); | 25 | asm volatile ("fence.i" ::: "memory"); |
25 | } | 26 | } |
26 | 27 | ||
28 | #define PG_dcache_clean PG_arch_1 | ||
29 | |||
30 | static inline void flush_dcache_page(struct page *page) | ||
31 | { | ||
32 | if (test_bit(PG_dcache_clean, &page->flags)) | ||
33 | clear_bit(PG_dcache_clean, &page->flags); | ||
34 | } | ||
35 | |||
36 | /* | ||
37 | * RISC-V doesn't have an instruction to flush parts of the instruction cache, | ||
38 | * so instead we just flush the whole thing. | ||
39 | */ | ||
40 | #define flush_icache_range(start, end) flush_icache_all() | ||
41 | #define flush_icache_user_range(vma, pg, addr, len) flush_icache_all() | ||
42 | |||
27 | #ifndef CONFIG_SMP | 43 | #ifndef CONFIG_SMP |
28 | 44 | ||
29 | #define flush_icache_range(start, end) local_flush_icache_all() | 45 | #define flush_icache_all() local_flush_icache_all() |
30 | #define flush_icache_user_range(vma, pg, addr, len) local_flush_icache_all() | 46 | #define flush_icache_mm(mm, local) flush_icache_all() |
31 | 47 | ||
32 | #else /* CONFIG_SMP */ | 48 | #else /* CONFIG_SMP */ |
33 | 49 | ||
34 | #define flush_icache_range(start, end) sbi_remote_fence_i(0) | 50 | #define flush_icache_all() sbi_remote_fence_i(0) |
35 | #define flush_icache_user_range(vma, pg, addr, len) sbi_remote_fence_i(0) | 51 | void flush_icache_mm(struct mm_struct *mm, bool local); |
36 | 52 | ||
37 | #endif /* CONFIG_SMP */ | 53 | #endif /* CONFIG_SMP */ |
38 | 54 | ||
55 | /* | ||
56 | * Bits in sys_riscv_flush_icache()'s flags argument. | ||
57 | */ | ||
58 | #define SYS_RISCV_FLUSH_ICACHE_LOCAL 1UL | ||
59 | #define SYS_RISCV_FLUSH_ICACHE_ALL (SYS_RISCV_FLUSH_ICACHE_LOCAL) | ||
60 | |||
39 | #endif /* _ASM_RISCV_CACHEFLUSH_H */ | 61 | #endif /* _ASM_RISCV_CACHEFLUSH_H */ |