[PULL 06/47] tcg: Do not flush icache for interpreter

Richard Henderson posted 47 patches 3 years, 5 months ago
Maintainers: Jiaxun Yang <jiaxun.yang@flygoat.com>, Thomas Huth <thuth@redhat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Alistair Francis <Alistair.Francis@wdc.com>, Cornelia Huck <cohuck@redhat.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Aurelien Jarno <aurelien@aurel32.net>, Palmer Dabbelt <palmer@dabbelt.com>, Laurent Vivier <laurent@vivier.eu>, Richard Henderson <richard.henderson@linaro.org>, Huacai Chen <chenhuacai@kernel.org>, Paolo Bonzini <pbonzini@redhat.com>, Stefan Weil <sw@weilnetz.de>, Andrzej Zaborowski <balrogg@gmail.com>
There is a newer version of this series
[PULL 06/47] tcg: Do not flush icache for interpreter
Posted by Richard Henderson 3 years, 5 months ago
This is currently a no-op within tci/tcg-target.h, but
is about to be moved to a more generic location.

Reviewed-by: Joelle van Dyne <j@getutm.app>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/tcg.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 95aacc8597..9bdc450196 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1078,7 +1078,9 @@ void tcg_prologue_init(TCGContext *s)
 #endif
 
     buf1 = s->code_ptr;
+#ifndef CONFIG_TCG_INTERPRETER
     flush_icache_range((uintptr_t)buf0, (uintptr_t)buf1);
+#endif
 
     /* Deduct the prologue from the buffer.  */
     prologue_size = tcg_current_code_size(s);
@@ -4324,8 +4326,10 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
         return -2;
     }
 
+#ifndef CONFIG_TCG_INTERPRETER
     /* flush instruction cache */
     flush_icache_range((uintptr_t)s->code_buf, (uintptr_t)s->code_ptr);
+#endif
 
     return tcg_current_code_size(s);
 }
-- 
2.25.1