parisc: speed up flush_tlb_all_local with qemu
authorHelge Deller <deller@gmx.de>
Mon, 12 Aug 2019 17:13:20 +0000 (19:13 +0200)
committerHelge Deller <deller@gmx.de>
Mon, 12 Aug 2019 17:17:40 +0000 (19:17 +0200)
When started in qemu, we know that qemu will drop all local TLB entries
on any pxtlbe instruction. So, if we detect qemu, replace the whole
flush_tlb_all_local function by one pdtlbe instruction.

Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/pacache.S

index df46b0e..fa092ed 100644 (file)
@@ -174,6 +174,15 @@ fdtdone:
 
 2:      bv             %r0(%r2)
        nop
+
+       /*
+        * When running in qemu, drop whole flush_tlb_all_local function and
+        * replace by one pdtlbe instruction, for which QEMU will drop all
+        * local TLB entries.
+        */
+3:     pdtlbe          %r0(%sr1,%r0)
+       bv,n            %r0(%r2)
+       ALTERNATIVE_CODE(flush_tlb_all_local, 2, ALT_COND_RUN_ON_QEMU, 3b)
 ENDPROC_CFI(flush_tlb_all_local)
 
        .import cache_info,data