diff options
author | Helge Deller <deller@gmx.de> | 2022-03-18 22:59:59 +0100 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-03-18 22:59:59 +0100 |
commit | 411fadd62cecf74935693b7690b416af9bd4a332 (patch) | |
tree | 3c48888ca3b95781ff67f932f7069a05271899be /arch | |
parent | parisc: Avoid using hardware single-step in kprobes (diff) | |
download | linux-411fadd62cecf74935693b7690b416af9bd4a332.tar.xz linux-411fadd62cecf74935693b7690b416af9bd4a332.zip |
parisc: Avoid flushing cache on cache-less machines
Avoid flushing caches in __flush_cache_page() and __purge_cache_page()
if the machine hasn't data or instruction caches - as e.g. in qemu.
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/kernel/cache.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 231cebb3fc0d..d41fee3a9874 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -315,6 +315,8 @@ static inline void __flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long physaddr) { + if (!static_branch_likely(&parisc_has_cache)) + return; preempt_disable(); flush_dcache_page_asm(physaddr, vmaddr); if (vma->vm_flags & VM_EXEC) @@ -326,6 +328,8 @@ static inline void __purge_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long physaddr) { + if (!static_branch_likely(&parisc_has_cache)) + return; preempt_disable(); purge_dcache_page_asm(physaddr, vmaddr); if (vma->vm_flags & VM_EXEC) |