Skip to content

Commit 411fadd

Browse files
committed
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>
1 parent 9b046d0 commit 411fadd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

arch/parisc/kernel/cache.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ static inline void
315315
__flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr,
316316
unsigned long physaddr)
317317
{
318+
if (!static_branch_likely(&parisc_has_cache))
319+
return;
318320
preempt_disable();
319321
flush_dcache_page_asm(physaddr, vmaddr);
320322
if (vma->vm_flags & VM_EXEC)
@@ -326,6 +328,8 @@ static inline void
326328
__purge_cache_page(struct vm_area_struct *vma, unsigned long vmaddr,
327329
unsigned long physaddr)
328330
{
331+
if (!static_branch_likely(&parisc_has_cache))
332+
return;
329333
preempt_disable();
330334
purge_dcache_page_asm(physaddr, vmaddr);
331335
if (vma->vm_flags & VM_EXEC)

0 commit comments

Comments
 (0)