* [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags
@ 2021-02-09 18:27 Alex Bennée
2021-02-09 18:27 ` [PATCH v1 01/12] exec: Move TranslationBlock typedef to qemu/typedefs.h Alex Bennée
` (12 more replies)
0 siblings, 13 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: kuhn.chenqun, aaron, cota, Alex Bennée, robhenry
Hi,
Aaron reported an issue with TCG plugins when interacting with the
cpu_io_recompile code during icount. The ultimate fix was to avoid
instrumenting the re-executed block but along the way we clean-up a
bunch of the code by getting rid of CF_NOCACHE. I've also included
Richard's recently posted recompile hook cleanups at the start of the
series because it makes the improves the diffstat by pushing more arch
specific black magic to the targets. In fact without the additional
tests this removes more code than it adds ;-)
I've added some acceptance tests to detect the failure mode as well as
manually testing with a test Peter had lying around that exercises the
trixy "executing out of MMIO" code path which I've touched.
Please test and review.
Alex Bennée (8):
tests/plugin: expand insn test to detect duplicate instructions
tests/acceptance: add a new set of tests to exercise plugins
accel/tcg: actually cache our partial icount TB
accel/tcg: cache single instruction TB on pending replay exception
accel/tcg: re-factor non-RAM execution code
accel/tcg: remove CF_NOCACHE and special cases
accel/tcg: allow plugin instrumentation to be disable via cflags
tests/acceptance: add a new tests to detect counting errors
Richard Henderson (4):
exec: Move TranslationBlock typedef to qemu/typedefs.h
accel/tcg: Create io_recompile_replay_branch hook
target/mips: Create mips_io_recompile_replay_branch
target/sh4: Create superh_io_recompile_replay_branch
include/exec/exec-all.h | 6 +-
include/exec/tb-context.h | 1 -
include/hw/core/cpu.h | 4 +-
include/hw/core/tcg-cpu-ops.h | 13 +++-
include/qemu/typedefs.h | 1 +
target/arm/internals.h | 3 +-
accel/tcg/cpu-exec.c | 62 ++++-----------
accel/tcg/translate-all.c | 128 +++++++++++-------------------
accel/tcg/translator.c | 2 +-
target/cris/translate.c | 2 +-
target/lm32/translate.c | 2 +-
target/mips/cpu.c | 18 +++++
target/moxie/translate.c | 2 +-
target/sh4/cpu.c | 18 +++++
target/unicore32/translate.c | 2 +-
tests/plugin/insn.c | 12 ++-
tests/acceptance/tcg_plugins.py | 134 ++++++++++++++++++++++++++++++++
17 files changed, 263 insertions(+), 147 deletions(-)
create mode 100644 tests/acceptance/tcg_plugins.py
--
2.20.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH v1 01/12] exec: Move TranslationBlock typedef to qemu/typedefs.h
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 18:27 ` [PATCH v1 02/12] accel/tcg: Create io_recompile_replay_branch hook Alex Bennée
` (11 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Eduardo Habkost, Anthony Green, Richard Henderson,
Michael Walle, robhenry, aaron, cota, Paolo Bonzini, kuhn.chenqun,
Guan Xuetao, Alex Bennée, Edgar E. Iglesias,
open list:ARM TCG CPUs
From: Richard Henderson <richard.henderson@linaro.org>
This also means we don't need an extra declaration of
the structure in hw/core/cpu.h.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210208233906.479571-2-richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
include/exec/tb-context.h | 1 -
include/hw/core/cpu.h | 4 +---
include/hw/core/tcg-cpu-ops.h | 3 +--
include/qemu/typedefs.h | 1 +
target/arm/internals.h | 3 +--
target/cris/translate.c | 2 +-
target/lm32/translate.c | 2 +-
target/moxie/translate.c | 2 +-
target/unicore32/translate.c | 2 +-
9 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/include/exec/tb-context.h b/include/exec/tb-context.h
index ec4c13b455..cc33979113 100644
--- a/include/exec/tb-context.h
+++ b/include/exec/tb-context.h
@@ -26,7 +26,6 @@
#define CODE_GEN_HTABLE_BITS 15
#define CODE_GEN_HTABLE_SIZE (1 << CODE_GEN_HTABLE_BITS)
-typedef struct TranslationBlock TranslationBlock;
typedef struct TBContext TBContext;
struct TBContext {
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 38d813c389..c005d3dc2d 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -74,8 +74,6 @@ typedef enum MMUAccessType {
typedef struct CPUWatchpoint CPUWatchpoint;
-struct TranslationBlock;
-
/* see tcg-cpu-ops.h */
struct TCGCPUOps;
@@ -375,7 +373,7 @@ struct CPUState {
IcountDecr *icount_decr_ptr;
/* Accessed in parallel; all accesses must be atomic */
- struct TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE];
+ TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE];
struct GDBRegisterState *gdb_regs;
int gdb_num_regs;
diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h
index ccc97d1894..ac3bb051f2 100644
--- a/include/hw/core/tcg-cpu-ops.h
+++ b/include/hw/core/tcg-cpu-ops.h
@@ -30,8 +30,7 @@ struct TCGCPUOps {
* If more state needs to be restored, the target must implement a
* function to restore all the state, and register it here.
*/
- void (*synchronize_from_tb)(CPUState *cpu,
- const struct TranslationBlock *tb);
+ void (*synchronize_from_tb)(CPUState *cpu, const TranslationBlock *tb);
/** @cpu_exec_enter: Callback for cpu_exec preparation */
void (*cpu_exec_enter)(CPUState *cpu);
/** @cpu_exec_exit: Callback for cpu_exec cleanup */
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index dc39b05c30..ee60eb3de4 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -120,6 +120,7 @@ typedef struct ReservedRegion ReservedRegion;
typedef struct SavedIOTLB SavedIOTLB;
typedef struct SHPCDevice SHPCDevice;
typedef struct SSIBus SSIBus;
+typedef struct TranslationBlock TranslationBlock;
typedef struct VirtIODevice VirtIODevice;
typedef struct Visitor Visitor;
typedef struct VMChangeStateEntry VMChangeStateEntry;
diff --git a/target/arm/internals.h b/target/arm/internals.h
index 448982dd2f..7d26ce0c9d 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -172,8 +172,7 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu);
void arm_translate_init(void);
#ifdef CONFIG_TCG
-void arm_cpu_synchronize_from_tb(CPUState *cs,
- const struct TranslationBlock *tb);
+void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb);
#endif /* CONFIG_TCG */
diff --git a/target/cris/translate.c b/target/cris/translate.c
index c893f877ab..65c168c0c7 100644
--- a/target/cris/translate.c
+++ b/target/cris/translate.c
@@ -132,7 +132,7 @@ typedef struct DisasContext {
int delayed_branch;
- struct TranslationBlock *tb;
+ TranslationBlock *tb;
int singlestep_enabled;
} DisasContext;
diff --git a/target/lm32/translate.c b/target/lm32/translate.c
index 030b232d66..20c70d03f1 100644
--- a/target/lm32/translate.c
+++ b/target/lm32/translate.c
@@ -93,7 +93,7 @@ typedef struct DisasContext {
unsigned int tb_flags, synced_flags; /* tb dependent flags. */
int is_jmp;
- struct TranslationBlock *tb;
+ TranslationBlock *tb;
int singlestep_enabled;
uint32_t features;
diff --git a/target/moxie/translate.c b/target/moxie/translate.c
index d5fb27dfb8..24a742b25e 100644
--- a/target/moxie/translate.c
+++ b/target/moxie/translate.c
@@ -36,7 +36,7 @@
/* This is the state at translation time. */
typedef struct DisasContext {
- struct TranslationBlock *tb;
+ TranslationBlock *tb;
target_ulong pc, saved_pc;
uint32_t opcode;
uint32_t fp_status;
diff --git a/target/unicore32/translate.c b/target/unicore32/translate.c
index 962f9877a0..370709c9ea 100644
--- a/target/unicore32/translate.c
+++ b/target/unicore32/translate.c
@@ -34,7 +34,7 @@ typedef struct DisasContext {
int condjmp;
/* The label that will be jumped to when the instruction is skipped. */
TCGLabel *condlabel;
- struct TranslationBlock *tb;
+ TranslationBlock *tb;
int singlestep_enabled;
#ifndef CONFIG_USER_ONLY
int user;
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 02/12] accel/tcg: Create io_recompile_replay_branch hook
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
2021-02-09 18:27 ` [PATCH v1 01/12] exec: Move TranslationBlock typedef to qemu/typedefs.h Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 18:27 ` [PATCH v1 03/12] target/mips: Create mips_io_recompile_replay_branch Alex Bennée
` (10 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, robhenry, aaron, cota, Paolo Bonzini,
kuhn.chenqun, Alex Bennée
From: Richard Henderson <richard.henderson@linaro.org>
Create a hook in which to split out the mips and
sh4 ifdefs from cpu_io_recompile.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210208233906.479571-3-richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
[AJB: s/stoped/stopped/]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
include/hw/core/tcg-cpu-ops.h | 10 ++++++++++
accel/tcg/translate-all.c | 17 +++++++++++++----
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h
index ac3bb051f2..72d791438c 100644
--- a/include/hw/core/tcg-cpu-ops.h
+++ b/include/hw/core/tcg-cpu-ops.h
@@ -88,6 +88,16 @@ struct TCGCPUOps {
*/
bool (*debug_check_watchpoint)(CPUState *cpu, CPUWatchpoint *wp);
+ /**
+ * @io_recompile_replay_branch: Callback for cpu_io_recompile.
+ *
+ * The cpu has been stopped, and cpu_restore_state_from_tb has been
+ * called. If the faulting instruction is in a delay slot, and the
+ * target architecture requires re-execution of the branch, then
+ * adjust the cpu state as required and return true.
+ */
+ bool (*io_recompile_replay_branch)(CPUState *cpu,
+ const TranslationBlock *tb);
#endif /* CONFIG_SOFTMMU */
#endif /* NEED_CPU_H */
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 81d4c83f22..6eb37883bd 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -60,6 +60,7 @@
#include "sysemu/cpu-timers.h"
#include "sysemu/tcg.h"
#include "qapi/error.h"
+#include "hw/core/tcg-cpu-ops.h"
#include "internal.h"
/* #define DEBUG_TB_INVALIDATE */
@@ -2420,6 +2421,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
CPUArchState *env = cpu->env_ptr;
#endif
TranslationBlock *tb;
+ CPUClass *cc;
uint32_t n;
tb = tcg_tb_lookup(retaddr);
@@ -2429,11 +2431,18 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
}
cpu_restore_state_from_tb(cpu, tb, retaddr, true);
- /* On MIPS and SH, delay slot instructions can only be restarted if
- they were already the first instruction in the TB. If this is not
- the first instruction in a TB then re-execute the preceding
- branch. */
+ /*
+ * Some guests must re-execute the branch when re-executing a delay
+ * slot instruction. When this is the case, adjust icount and N
+ * to account for the re-execution of the branch.
+ */
n = 1;
+ cc = CPU_GET_CLASS(cpu);
+ if (cc->tcg_ops->io_recompile_replay_branch &&
+ cc->tcg_ops->io_recompile_replay_branch(cpu, tb)) {
+ cpu_neg(cpu)->icount_decr.u16.low++;
+ n = 2;
+ }
#if defined(TARGET_MIPS)
if ((env->hflags & MIPS_HFLAG_BMASK) != 0
&& env->active_tc.PC != tb->pc) {
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 03/12] target/mips: Create mips_io_recompile_replay_branch
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
2021-02-09 18:27 ` [PATCH v1 01/12] exec: Move TranslationBlock typedef to qemu/typedefs.h Alex Bennée
2021-02-09 18:27 ` [PATCH v1 02/12] accel/tcg: Create io_recompile_replay_branch hook Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 18:27 ` [PATCH v1 04/12] target/sh4: Create superh_io_recompile_replay_branch Alex Bennée
` (9 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Aleksandar Rikalo, Richard Henderson, Philippe Mathieu-Daudé,
robhenry, aaron, cota, Paolo Bonzini, kuhn.chenqun,
Alex Bennée, Aurelien Jarno
From: Richard Henderson <richard.henderson@linaro.org>
Move the code from accel/tcg/translate-all.c to target/mips/cpu.c.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210208233906.479571-4-richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
accel/tcg/translate-all.c | 12 ++----------
target/mips/cpu.c | 18 ++++++++++++++++++
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 6eb37883bd..470657b02a 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -2417,7 +2417,7 @@ void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr)
*/
void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
{
-#if defined(TARGET_MIPS) || defined(TARGET_SH4)
+#if defined(TARGET_SH4)
CPUArchState *env = cpu->env_ptr;
#endif
TranslationBlock *tb;
@@ -2443,15 +2443,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
cpu_neg(cpu)->icount_decr.u16.low++;
n = 2;
}
-#if defined(TARGET_MIPS)
- if ((env->hflags & MIPS_HFLAG_BMASK) != 0
- && env->active_tc.PC != tb->pc) {
- env->active_tc.PC -= (env->hflags & MIPS_HFLAG_B16 ? 2 : 4);
- cpu_neg(cpu)->icount_decr.u16.low++;
- env->hflags &= ~MIPS_HFLAG_BMASK;
- n = 2;
- }
-#elif defined(TARGET_SH4)
+#if defined(TARGET_SH4)
if ((env->flags & ((DELAY_SLOT | DELAY_SLOT_CONDITIONAL))) != 0
&& env->pc != tb->pc) {
env->pc -= 2;
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index ad163ead62..bf70c77295 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -268,6 +268,23 @@ static void mips_cpu_synchronize_from_tb(CPUState *cs,
env->hflags &= ~MIPS_HFLAG_BMASK;
env->hflags |= tb->flags & MIPS_HFLAG_BMASK;
}
+
+# ifndef CONFIG_USER_ONLY
+static bool mips_io_recompile_replay_branch(CPUState *cs,
+ const TranslationBlock *tb)
+{
+ MIPSCPU *cpu = MIPS_CPU(cs);
+ CPUMIPSState *env = &cpu->env;
+
+ if ((env->hflags & MIPS_HFLAG_BMASK) != 0
+ && env->active_tc.PC != tb->pc) {
+ env->active_tc.PC -= (env->hflags & MIPS_HFLAG_B16 ? 2 : 4);
+ env->hflags &= ~MIPS_HFLAG_BMASK;
+ return true;
+ }
+ return false;
+}
+# endif /* !CONFIG_USER_ONLY */
#endif /* CONFIG_TCG */
static bool mips_cpu_has_work(CPUState *cs)
@@ -679,6 +696,7 @@ static struct TCGCPUOps mips_tcg_ops = {
.do_interrupt = mips_cpu_do_interrupt,
.do_transaction_failed = mips_cpu_do_transaction_failed,
.do_unaligned_access = mips_cpu_do_unaligned_access,
+ .io_recompile_replay_branch = mips_io_recompile_replay_branch,
#endif /* !CONFIG_USER_ONLY */
};
#endif /* CONFIG_TCG */
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 04/12] target/sh4: Create superh_io_recompile_replay_branch
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (2 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 03/12] target/mips: Create mips_io_recompile_replay_branch Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 18:27 ` [PATCH v1 05/12] tests/plugin: expand insn test to detect duplicate instructions Alex Bennée
` (8 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Yoshinori Sato, Richard Henderson, robhenry, aaron, cota,
Paolo Bonzini, kuhn.chenqun, Alex Bennée
From: Richard Henderson <richard.henderson@linaro.org>
Move the code from accel/tcg/translate-all.c to target/sh4/cpu.c.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210208233906.479571-5-richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
accel/tcg/translate-all.c | 12 ------------
target/sh4/cpu.c | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 470657b02a..b8ad95aa1b 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -2417,9 +2417,6 @@ void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr)
*/
void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
{
-#if defined(TARGET_SH4)
- CPUArchState *env = cpu->env_ptr;
-#endif
TranslationBlock *tb;
CPUClass *cc;
uint32_t n;
@@ -2443,15 +2440,6 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
cpu_neg(cpu)->icount_decr.u16.low++;
n = 2;
}
-#if defined(TARGET_SH4)
- if ((env->flags & ((DELAY_SLOT | DELAY_SLOT_CONDITIONAL))) != 0
- && env->pc != tb->pc) {
- env->pc -= 2;
- cpu_neg(cpu)->icount_decr.u16.low++;
- env->flags &= ~(DELAY_SLOT | DELAY_SLOT_CONDITIONAL);
- n = 2;
- }
-#endif
/* Generate a new TB executing the I/O insn. */
cpu->cflags_next_tb = curr_cflags() | CF_LAST_IO | n;
diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
index a78d283bc8..ac65c88f1f 100644
--- a/target/sh4/cpu.c
+++ b/target/sh4/cpu.c
@@ -43,6 +43,23 @@ static void superh_cpu_synchronize_from_tb(CPUState *cs,
cpu->env.flags = tb->flags & TB_FLAG_ENVFLAGS_MASK;
}
+#ifndef CONFIG_USER_ONLY
+static bool superh_io_recompile_replay_branch(CPUState *cs,
+ const TranslationBlock *tb)
+{
+ SuperHCPU *cpu = SUPERH_CPU(cs);
+ CPUSH4State *env = &cpu->env;
+
+ if ((env->flags & ((DELAY_SLOT | DELAY_SLOT_CONDITIONAL))) != 0
+ && env->pc != tb->pc) {
+ env->pc -= 2;
+ env->flags &= ~(DELAY_SLOT | DELAY_SLOT_CONDITIONAL);
+ return true;
+ }
+ return false;
+}
+#endif
+
static bool superh_cpu_has_work(CPUState *cs)
{
return cs->interrupt_request & CPU_INTERRUPT_HARD;
@@ -217,6 +234,7 @@ static struct TCGCPUOps superh_tcg_ops = {
#ifndef CONFIG_USER_ONLY
.do_interrupt = superh_cpu_do_interrupt,
.do_unaligned_access = superh_cpu_do_unaligned_access,
+ .io_recompile_replay_branch = superh_io_recompile_replay_branch,
#endif /* !CONFIG_USER_ONLY */
};
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 05/12] tests/plugin: expand insn test to detect duplicate instructions
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (3 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 04/12] target/sh4: Create superh_io_recompile_replay_branch Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 18:34 ` Richard Henderson
2021-02-09 18:27 ` [PATCH v1 06/12] tests/acceptance: add a new set of tests to exercise plugins Alex Bennée
` (7 subsequent siblings)
12 siblings, 1 reply; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: kuhn.chenqun, aaron, cota, Alex Bennée, robhenry
A duplicate insn is one that is appears to be executed twice in a row.
This is currently possible due to -icount and cpu_io_recompile()
causing a re-translation of a block. On it's own this won't trigger
any tests though.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
[AJB: well not quite, the x86_64 test trips over this due to some
weirdness in the way we handle rep insns, e.g. rep movsb (%esi),
%es:(%edi) in the x86 bios code]
---
tests/plugin/insn.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c
index a9a6e41237..c253980ec8 100644
--- a/tests/plugin/insn.c
+++ b/tests/plugin/insn.c
@@ -21,6 +21,14 @@ static bool do_inline;
static void vcpu_insn_exec_before(unsigned int cpu_index, void *udata)
{
+ static uint64_t last_pc;
+ uint64_t this_pc = GPOINTER_TO_UINT(udata);
+ if (this_pc == last_pc) {
+ g_autofree gchar *out = g_strdup_printf("detected repeat execution @ 0x%"
+ PRIx64 "\n", this_pc);
+ qemu_plugin_outs(out);
+ }
+ last_pc = this_pc;
insn_count++;
}
@@ -36,8 +44,10 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
qemu_plugin_register_vcpu_insn_exec_inline(
insn, QEMU_PLUGIN_INLINE_ADD_U64, &insn_count, 1);
} else {
+ uint64_t vaddr = qemu_plugin_insn_vaddr(insn);
qemu_plugin_register_vcpu_insn_exec_cb(
- insn, vcpu_insn_exec_before, QEMU_PLUGIN_CB_NO_REGS, NULL);
+ insn, vcpu_insn_exec_before, QEMU_PLUGIN_CB_NO_REGS,
+ GUINT_TO_POINTER(vaddr));
}
}
}
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 06/12] tests/acceptance: add a new set of tests to exercise plugins
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (4 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 05/12] tests/plugin: expand insn test to detect duplicate instructions Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 18:27 ` [PATCH v1 07/12] accel/tcg: actually cache our partial icount TB Alex Bennée
` (6 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, robhenry, aaron, cota,
Wainer dos Santos Moschetta, Cleber Rosa, kuhn.chenqun,
Alex Bennée
This is just a simple test to count the instructions executed by a
kernel. However a later test will detect a failure condition when
icount is enabled.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/acceptance/tcg_plugins.py | 103 ++++++++++++++++++++++++++++++++
1 file changed, 103 insertions(+)
create mode 100644 tests/acceptance/tcg_plugins.py
diff --git a/tests/acceptance/tcg_plugins.py b/tests/acceptance/tcg_plugins.py
new file mode 100644
index 0000000000..b512979769
--- /dev/null
+++ b/tests/acceptance/tcg_plugins.py
@@ -0,0 +1,103 @@
+# TCG Plugins tests
+#
+# These are a little more involved than the basic tests run by check-tcg.
+#
+# Copyright (c) 2021 Linaro
+#
+# Author:
+# Alex Bennée <alex.bennee@linaro.org>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import logging
+import time
+import tempfile
+import mmap
+import re
+
+from boot_linux_console import LinuxKernelTest
+
+
+class PluginKernelBase(LinuxKernelTest):
+ """
+ Boots a Linux kernel with a TCG plugin enabled.
+ """
+
+ timeout = 120
+ KERNEL_COMMON_COMMAND_LINE = 'printk.time=1 panic=-1 '
+
+ def run_vm(self, kernel_path, kernel_command_line,
+ plugin, plugin_log, console_pattern, args):
+
+ logger = logging.getLogger('plugin')
+ start_time = time.time()
+ vm = self.get_vm()
+ vm.set_console()
+ vm.add_args('-kernel', kernel_path,
+ '-append', kernel_command_line,
+ '-plugin', plugin,
+ '-d', 'plugin',
+ '-D', plugin_log,
+ '-net', 'none',
+ '-no-reboot')
+ if args:
+ vm.add_args(*args)
+
+ try:
+ vm.launch()
+ except:
+ # fails if plugins not enabled
+ self.cancel("TCG Plugins not enabled")
+
+ self.wait_for_console_pattern(console_pattern, vm)
+ elapsed = time.time() - start_time
+ logger.info('elapsed time %.2f sec' % elapsed)
+ # ensure logs are flushed
+ vm.shutdown()
+ return elapsed
+
+
+class PluginKernelNormal(PluginKernelBase):
+
+ def _grab_aarch64_kernel(self):
+ kernel_url = ('http://security.debian.org/'
+ 'debian-security/pool/updates/main/l/linux-signed-arm64/'
+ 'linux-image-4.19.0-12-arm64_4.19.152-1_arm64.deb')
+ kernel_sha1 = '2036c2792f80ac9c4ccaae742b2e0a28385b6010'
+ kernel_deb = self.fetch_asset(kernel_url, asset_hash=kernel_sha1)
+ kernel_path = self.extract_from_deb(kernel_deb,
+ "/boot/vmlinuz-4.19.0-12-arm64")
+ return kernel_path
+
+ def test_aarch64_virt_insn(self):
+ """
+ :avocado: tags=accel:tcg
+ :avocado: tags=arch:aarch64
+ :avocado: tags=machine:virt
+ :avocado: tags=cpu:cortex-a57
+ """
+ kernel_path = self._grab_aarch64_kernel()
+ kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+ 'console=ttyAMA0')
+ console_pattern = 'Kernel panic - not syncing: VFS:'
+
+ plugin_log = tempfile.NamedTemporaryFile(mode="r+t", prefix="plugin",
+ suffix=".log")
+
+ self.run_vm(kernel_path, kernel_command_line,
+ "tests/plugin/libinsn.so", plugin_log.name,
+ console_pattern,
+ args=('-cpu', 'cortex-a53'))
+
+ logger = logging.getLogger()
+
+ with plugin_log as lf, \
+ mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s:
+
+ m = re.search(br"insns: (?P<count>\d+)", s)
+ if "count" in m.groupdict():
+ logger.debug("reported %d instructions",
+ int(m.group("count")))
+ else:
+ logger.debug("Failed to find instruction count")
+ self.fail
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 07/12] accel/tcg: actually cache our partial icount TB
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (5 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 06/12] tests/acceptance: add a new set of tests to exercise plugins Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 18:41 ` Richard Henderson
2021-02-09 18:27 ` [PATCH v1 08/12] accel/tcg: cache single instruction TB on pending replay exception Alex Bennée
` (5 subsequent siblings)
12 siblings, 1 reply; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, robhenry, aaron, cota, Paolo Bonzini,
kuhn.chenqun, Alex Bennée
When we exit a block under icount with instructions left to execute we
might need a shorter than normal block to take us to the next
deterministic event. Instead of creating a throwaway block on demand
we use the existing compile flags mechanism to ensure we fetch (or
compile and fetch) a block with exactly the number of instructions we
need.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
accel/tcg/cpu-exec.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index d9ef69121c..7f477af891 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -730,16 +730,18 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb,
/* Ensure global icount has gone forward */
icount_update(cpu);
/* Refill decrementer and continue execution. */
- insns_left = MIN(0xffff, cpu->icount_budget);
+ insns_left = MIN(CF_COUNT_MASK, cpu->icount_budget);
cpu_neg(cpu)->icount_decr.u16.low = insns_left;
cpu->icount_extra = cpu->icount_budget - insns_left;
- if (!cpu->icount_extra && insns_left < tb->icount) {
- /* Execute any remaining instructions, then let the main loop
- * handle the next event.
- */
- if (insns_left > 0) {
- cpu_exec_nocache(cpu, insns_left, tb, false);
- }
+
+ /*
+ * If the next tb has more instructions than we have left to
+ * execute we need to ensure we find/generate a TB with exactly
+ * insns_left instructions in it.
+ */
+ if (!cpu->icount_extra && insns_left > 0 && insns_left < tb->icount) {
+ g_assert(insns_left < CF_COUNT_MASK);
+ cpu->cflags_next_tb = (tb->cflags & ~CF_COUNT_MASK) | insns_left;
}
#endif
}
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 08/12] accel/tcg: cache single instruction TB on pending replay exception
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (6 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 07/12] accel/tcg: actually cache our partial icount TB Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 18:27 ` [PATCH v1 09/12] accel/tcg: re-factor non-RAM execution code Alex Bennée
` (4 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, robhenry, aaron, cota, Paolo Bonzini,
kuhn.chenqun, Alex Bennée
Again there is no reason to jump through the nocache hoops to execute
a single instruction block. We do have to add an additional wrinkle to
the cpu_handle_interrupt case to ensure we let through a TB where we
have specifically disabled icount for the block.
As the last user of cpu_exec_nocache we can now remove the function.
Further clean-up will follow in subsequent patches.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
accel/tcg/cpu-exec.c | 44 ++++----------------------------------------
1 file changed, 4 insertions(+), 40 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 7f477af891..609a68a3ae 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -224,40 +224,6 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit)
return last_tb;
}
-#ifndef CONFIG_USER_ONLY
-/* Execute the code without caching the generated code. An interpreter
- could be used if available. */
-static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
- TranslationBlock *orig_tb, bool ignore_icount)
-{
- TranslationBlock *tb;
- uint32_t cflags = curr_cflags() | CF_NOCACHE;
- int tb_exit;
-
- if (ignore_icount) {
- cflags &= ~CF_USE_ICOUNT;
- }
-
- /* Should never happen.
- We only end up here when an existing TB is too long. */
- cflags |= MIN(max_cycles, CF_COUNT_MASK);
-
- mmap_lock();
- tb = tb_gen_code(cpu, orig_tb->pc, orig_tb->cs_base,
- orig_tb->flags, cflags);
- tb->orig_tb = orig_tb;
- mmap_unlock();
-
- /* execute the generated code */
- trace_exec_tb_nocache(tb, tb->pc);
- cpu_tb_exec(cpu, tb, &tb_exit);
-
- mmap_lock();
- tb_phys_invalidate(tb, -1);
- mmap_unlock();
- tcg_tb_remove(tb);
-}
-#endif
static void cpu_exec_enter(CPUState *cpu)
{
@@ -524,15 +490,12 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
#ifndef CONFIG_USER_ONLY
if (replay_has_exception()
&& cpu_neg(cpu)->icount_decr.u16.low + cpu->icount_extra == 0) {
- /* try to cause an exception pending in the log */
- cpu_exec_nocache(cpu, 1, tb_find(cpu, NULL, 0, curr_cflags()), true);
+ /* Execute just one insn to trigger exception pending in the log */
+ cpu->cflags_next_tb = (curr_cflags() & ~CF_USE_ICOUNT) | 1;
}
#endif
- if (cpu->exception_index < 0) {
- return false;
- }
+ return false;
}
-
if (cpu->exception_index >= EXCP_INTERRUPT) {
/* exit request from the cpu execution loop */
*ret = cpu->exception_index;
@@ -688,6 +651,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
/* Finally, check if we need to exit to the main loop. */
if (unlikely(qatomic_read(&cpu->exit_request))
|| (icount_enabled()
+ && (cpu->cflags_next_tb == -1 || cpu->cflags_next_tb & CF_USE_ICOUNT)
&& cpu_neg(cpu)->icount_decr.u16.low + cpu->icount_extra == 0)) {
qatomic_set(&cpu->exit_request, 0);
if (cpu->exception_index == -1) {
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 09/12] accel/tcg: re-factor non-RAM execution code
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (7 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 08/12] accel/tcg: cache single instruction TB on pending replay exception Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 18:27 ` [PATCH v1 10/12] accel/tcg: remove CF_NOCACHE and special cases Alex Bennée
` (3 subsequent siblings)
12 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, robhenry, aaron, cota, Paolo Bonzini,
kuhn.chenqun, Alex Bennée
There is no real need to use CF_NOCACHE here. As long as the TB isn't
linked to other TBs or included in the QHT or jump cache then it will
only get executed once.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
accel/tcg/translate-all.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index b8ad95aa1b..b2c5003829 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1778,7 +1778,7 @@ static inline void tb_page_add(PageDesc *p, TranslationBlock *tb,
#endif
}
-/* add a new TB and link it to the physical page tables. phys_page2 is
+/* Add a new TB and link it to the physical page tables. phys_page2 is
* (-1) to indicate that only one page contains the TB.
*
* Called with mmap_lock held for user-mode emulation.
@@ -1797,17 +1797,6 @@ tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
assert_memory_lock();
- if (phys_pc == -1) {
- /*
- * If the TB is not associated with a physical RAM page then
- * it must be a temporary one-insn TB, and we have nothing to do
- * except fill in the page_addr[] fields.
- */
- assert(tb->cflags & CF_NOCACHE);
- tb->page_addr[0] = tb->page_addr[1] = -1;
- return tb;
- }
-
/*
* Add the TB to the page list, acquiring first the pages's locks.
* We keep the locks held until after inserting the TB in the hash table,
@@ -1880,9 +1869,8 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
phys_pc = get_page_addr_code(env, pc);
if (phys_pc == -1) {
- /* Generate a temporary TB with 1 insn in it */
- cflags &= ~CF_COUNT_MASK;
- cflags |= CF_NOCACHE | 1;
+ /* Generate a one-shot TB with 1 insn in it */
+ cflags = (cflags & ~CF_COUNT_MASK) | 1;
}
cflags &= ~CF_CLUSTER_MASK;
@@ -2096,6 +2084,17 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
tb_reset_jump(tb, 1);
}
+ /*
+ * If the TB is not associated with a physical RAM page then
+ * it must be a temporary one-insn TB, and we have nothing to do
+ * except fill in the page_addr[] fields. Return early before
+ * attempting to link to other TBs or add to the lookup table.
+ */
+ if (phys_pc == -1) {
+ tb->page_addr[0] = tb->page_addr[1] = -1;
+ return tb;
+ }
+
/* check next page if needed */
virt_page2 = (pc + tb->size - 1) & TARGET_PAGE_MASK;
phys_page2 = -1;
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 10/12] accel/tcg: remove CF_NOCACHE and special cases
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (8 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 09/12] accel/tcg: re-factor non-RAM execution code Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 21:03 ` Richard Henderson
2021-02-09 18:27 ` [PATCH v1 11/12] accel/tcg: allow plugin instrumentation to be disable via cflags Alex Bennée
` (2 subsequent siblings)
12 siblings, 1 reply; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, robhenry, aaron, cota, Paolo Bonzini,
kuhn.chenqun, Alex Bennée
Now we no longer generate CF_NOCACHE blocks we can remove a bunch of
the special case handling for them. While we are at it we can remove
the unused tb->orig_tb field and save a few bytes on the TB structure.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
include/exec/exec-all.h | 3 ---
accel/tcg/translate-all.c | 51 ++++++++++++---------------------------
2 files changed, 15 insertions(+), 39 deletions(-)
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index f933c74c44..e08179de34 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -454,7 +454,6 @@ struct TranslationBlock {
uint32_t cflags; /* compile flags */
#define CF_COUNT_MASK 0x00007fff
#define CF_LAST_IO 0x00008000 /* Last insn may be an IO access. */
-#define CF_NOCACHE 0x00010000 /* To be freed after execution */
#define CF_USE_ICOUNT 0x00020000
#define CF_INVALID 0x00040000 /* TB is stale. Set with @jmp_lock held */
#define CF_PARALLEL 0x00080000 /* Generate code for a parallel context */
@@ -469,8 +468,6 @@ struct TranslationBlock {
struct tb_tc tc;
- /* original tb when cflags has CF_NOCACHE */
- struct TranslationBlock *orig_tb;
/* first and second physical page containing code. The lower bit
of the pointer tells the index in page_next[].
The list is protected by the TB's page('s) lock(s) */
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index b2c5003829..27b3042f1d 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -409,12 +409,6 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc, bool will_exit)
TranslationBlock *tb = tcg_tb_lookup(host_pc);
if (tb) {
cpu_restore_state_from_tb(cpu, tb, host_pc, will_exit);
- if (tb_cflags(tb) & CF_NOCACHE) {
- /* one-shot translation, invalidate it immediately */
- tb_phys_invalidate(tb, -1);
- tcg_tb_remove(tb);
- tb_destroy(tb);
- }
return true;
}
}
@@ -1633,8 +1627,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb, bool rm_from_page_list)
phys_pc = tb->page_addr[0] + (tb->pc & ~TARGET_PAGE_MASK);
h = tb_hash_func(phys_pc, tb->pc, tb->flags, tb_cflags(tb) & CF_HASH_MASK,
tb->trace_vcpu_dstate);
- if (!(tb->cflags & CF_NOCACHE) &&
- !qht_remove(&tb_ctx.htable, tb, h)) {
+ if (!qht_remove(&tb_ctx.htable, tb, h)) {
return;
}
@@ -1794,6 +1787,8 @@ tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
{
PageDesc *p;
PageDesc *p2 = NULL;
+ void *existing_tb = NULL;
+ uint32_t h;
assert_memory_lock();
@@ -1813,25 +1808,20 @@ tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
tb->page_addr[1] = -1;
}
- if (!(tb->cflags & CF_NOCACHE)) {
- void *existing_tb = NULL;
- uint32_t h;
-
- /* add in the hash table */
- h = tb_hash_func(phys_pc, tb->pc, tb->flags, tb->cflags & CF_HASH_MASK,
- tb->trace_vcpu_dstate);
- qht_insert(&tb_ctx.htable, tb, h, &existing_tb);
+ /* add in the hash table */
+ h = tb_hash_func(phys_pc, tb->pc, tb->flags, tb->cflags & CF_HASH_MASK,
+ tb->trace_vcpu_dstate);
+ qht_insert(&tb_ctx.htable, tb, h, &existing_tb);
- /* remove TB from the page(s) if we couldn't insert it */
- if (unlikely(existing_tb)) {
- tb_page_remove(p, tb);
- invalidate_page_bitmap(p);
- if (p2) {
- tb_page_remove(p2, tb);
- invalidate_page_bitmap(p2);
- }
- tb = existing_tb;
+ /* remove TB from the page(s) if we couldn't insert it */
+ if (unlikely(existing_tb)) {
+ tb_page_remove(p, tb);
+ invalidate_page_bitmap(p);
+ if (p2) {
+ tb_page_remove(p2, tb);
+ invalidate_page_bitmap(p2);
}
+ tb = existing_tb;
}
if (p2 && p2 != p) {
@@ -1904,7 +1894,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
tb->cs_base = cs_base;
tb->flags = flags;
tb->cflags = cflags;
- tb->orig_tb = NULL;
tb->trace_vcpu_dstate = *cpu->trace_dstate;
tcg_ctx->tb_cflags = cflags;
tb_overflow:
@@ -2443,16 +2432,6 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
/* Generate a new TB executing the I/O insn. */
cpu->cflags_next_tb = curr_cflags() | CF_LAST_IO | n;
- if (tb_cflags(tb) & CF_NOCACHE) {
- if (tb->orig_tb) {
- /* Invalidate original TB if this TB was generated in
- * cpu_exec_nocache() */
- tb_phys_invalidate(tb->orig_tb, -1);
- }
- tcg_tb_remove(tb);
- tb_destroy(tb);
- }
-
qemu_log_mask_and_addr(CPU_LOG_EXEC, tb->pc,
"cpu_io_recompile: rewound execution of TB to "
TARGET_FMT_lx "\n", tb->pc);
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 11/12] accel/tcg: allow plugin instrumentation to be disable via cflags
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (9 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 10/12] accel/tcg: remove CF_NOCACHE and special cases Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-09 21:05 ` Richard Henderson
2021-02-09 18:27 ` [PATCH v1 12/12] tests/acceptance: add a new tests to detect counting errors Alex Bennée
2021-02-11 11:28 ` [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags no-reply
12 siblings, 1 reply; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, robhenry, aaron, cota, Paolo Bonzini,
kuhn.chenqun, Alex Bennée
When icount is enabled and we recompile an MMIO access we end up
double counting the instruction execution. To avoid this we introduce
the CF_NOINSTR cflag which disables instrumentation for the next TB.
As this is part of the hashed compile flags we will only execute the
generated TB while coming out of a cpu_io_recompile.
While we are at it delete the old TODO. We might as well keep the
translation handy as it's likely you will repeatedly hit it on each
MMIO access.
Reported-by: Aaron Lindsay <aaron@os.amperecomputing.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
include/exec/exec-all.h | 3 ++-
accel/tcg/translate-all.c | 17 ++++++++---------
accel/tcg/translator.c | 2 +-
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index e08179de34..ebf015e22d 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -454,6 +454,7 @@ struct TranslationBlock {
uint32_t cflags; /* compile flags */
#define CF_COUNT_MASK 0x00007fff
#define CF_LAST_IO 0x00008000 /* Last insn may be an IO access. */
+#define CF_NOINSTR 0x00010000 /* Disable instrumentation of TB */
#define CF_USE_ICOUNT 0x00020000
#define CF_INVALID 0x00040000 /* TB is stale. Set with @jmp_lock held */
#define CF_PARALLEL 0x00080000 /* Generate code for a parallel context */
@@ -461,7 +462,7 @@ struct TranslationBlock {
#define CF_CLUSTER_SHIFT 24
/* cflags' mask for hashing/comparison */
#define CF_HASH_MASK \
- (CF_COUNT_MASK | CF_LAST_IO | CF_USE_ICOUNT | CF_PARALLEL | CF_CLUSTER_MASK)
+ (CF_COUNT_MASK | CF_LAST_IO | CF_NOINSTR | CF_USE_ICOUNT | CF_PARALLEL | CF_CLUSTER_MASK)
/* Per-vCPU dynamic tracing state used to generate this TB */
uint32_t trace_vcpu_dstate;
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 27b3042f1d..3dee698457 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -2398,7 +2398,8 @@ void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr)
}
#ifndef CONFIG_USER_ONLY
-/* in deterministic execution mode, instructions doing device I/Os
+/*
+ * In deterministic execution mode, instructions doing device I/Os
* must be at the end of the TB.
*
* Called by softmmu_template.h, with iothread mutex not held.
@@ -2429,19 +2430,17 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
n = 2;
}
- /* Generate a new TB executing the I/O insn. */
- cpu->cflags_next_tb = curr_cflags() | CF_LAST_IO | n;
+ /*
+ * Exit the loop and potentially generate a new TB executing the
+ * just the I/O insns. We also disable instrumentation so we don't
+ * double count the instruction.
+ */
+ cpu->cflags_next_tb = curr_cflags() | CF_NOINSTR | CF_LAST_IO | n;
qemu_log_mask_and_addr(CPU_LOG_EXEC, tb->pc,
"cpu_io_recompile: rewound execution of TB to "
TARGET_FMT_lx "\n", tb->pc);
- /* TODO: If env->pc != tb->pc (i.e. the faulting instruction was not
- * the first in the TB) then we end up generating a whole new TB and
- * repeating the fault, which is horribly inefficient.
- * Better would be to execute just this insn uncached, or generate a
- * second new TB.
- */
cpu_loop_exit_noexc(cpu);
}
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index a49a794065..14d1ea795d 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -58,7 +58,7 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db,
ops->tb_start(db, cpu);
tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */
- plugin_enabled = plugin_gen_tb_start(cpu, tb);
+ plugin_enabled = !(tb_cflags(db->tb) & CF_NOINSTR) && plugin_gen_tb_start(cpu, tb);
while (true) {
db->num_insns++;
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH v1 12/12] tests/acceptance: add a new tests to detect counting errors
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (10 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 11/12] accel/tcg: allow plugin instrumentation to be disable via cflags Alex Bennée
@ 2021-02-09 18:27 ` Alex Bennée
2021-02-11 11:28 ` [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags no-reply
12 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, robhenry, aaron, cota,
Wainer dos Santos Moschetta, Cleber Rosa, kuhn.chenqun,
Alex Bennée
The insn plugin has a simple heuristic to detect if an instruction is
detected running twice in a row. Check the plugin log after the run
and pass accordingly.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/acceptance/tcg_plugins.py | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/tests/acceptance/tcg_plugins.py b/tests/acceptance/tcg_plugins.py
index b512979769..acab599505 100644
--- a/tests/acceptance/tcg_plugins.py
+++ b/tests/acceptance/tcg_plugins.py
@@ -101,3 +101,34 @@ class PluginKernelNormal(PluginKernelBase):
else:
logger.debug("Failed to find instruction count")
self.fail
+
+ def test_aarch64_virt_insn_icount(self):
+ """
+ :avocado: tags=accel:tcg
+ :avocado: tags=arch:aarch64
+ :avocado: tags=machine:virt
+ :avocado: tags=cpu:cortex-a57
+ """
+ kernel_path = self._grab_aarch64_kernel()
+ kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+ 'console=ttyAMA0')
+ console_pattern = 'Kernel panic - not syncing: VFS:'
+
+ plugin_log = tempfile.NamedTemporaryFile(mode="r+t", prefix="plugin",
+ suffix=".log", delete=False)
+
+ self.run_vm(kernel_path, kernel_command_line,
+ "tests/plugin/libinsn.so", plugin_log.name,
+ console_pattern,
+ args=('-cpu', 'cortex-a53', '-icount', 'shift=1'))
+
+ logger = logging.getLogger()
+
+ with plugin_log as lf, \
+ mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s:
+ m = re.search(br"detected repeat execution @ (?P<addr>0x[0-9A-Fa-f]+)", s)
+ if m is not None and "addr" in m.groupdict():
+ logger.debug("detected repeat instructions")
+ self.fail("detected repeated instructions")
+ else:
+ logger.debug("no repeats detected: %s", m)
--
2.20.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH v1 05/12] tests/plugin: expand insn test to detect duplicate instructions
2021-02-09 18:27 ` [PATCH v1 05/12] tests/plugin: expand insn test to detect duplicate instructions Alex Bennée
@ 2021-02-09 18:34 ` Richard Henderson
2021-02-09 20:48 ` Alex Bennée
0 siblings, 1 reply; 20+ messages in thread
From: Richard Henderson @ 2021-02-09 18:34 UTC (permalink / raw)
To: Alex Bennée, qemu-devel; +Cc: kuhn.chenqun, aaron, cota, robhenry
On 2/9/21 10:27 AM, Alex Bennée wrote:
> A duplicate insn is one that is appears to be executed twice in a row.
> This is currently possible due to -icount and cpu_io_recompile()
> causing a re-translation of a block. On it's own this won't trigger
> any tests though.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>
> ---
> [AJB: well not quite, the x86_64 test trips over this due to some
> weirdness in the way we handle rep insns, e.g. rep movsb (%esi),
> %es:(%edi) in the x86 bios code]
Ah, but that's not tcg weirdness, that's architectural weirdness. Multiple
executions is how "rep" is supposed to work.
r~
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v1 07/12] accel/tcg: actually cache our partial icount TB
2021-02-09 18:27 ` [PATCH v1 07/12] accel/tcg: actually cache our partial icount TB Alex Bennée
@ 2021-02-09 18:41 ` Richard Henderson
2021-02-09 20:49 ` Alex Bennée
0 siblings, 1 reply; 20+ messages in thread
From: Richard Henderson @ 2021-02-09 18:41 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: kuhn.chenqun, aaron, cota, robhenry, Paolo Bonzini
On 2/9/21 10:27 AM, Alex Bennée wrote:
> /* Refill decrementer and continue execution. */
> - insns_left = MIN(0xffff, cpu->icount_budget);
> + insns_left = MIN(CF_COUNT_MASK, cpu->icount_budget);
...
> + g_assert(insns_left < CF_COUNT_MASK);
Why both the MIN and the assert?
r~
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v1 05/12] tests/plugin: expand insn test to detect duplicate instructions
2021-02-09 18:34 ` Richard Henderson
@ 2021-02-09 20:48 ` Alex Bennée
0 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 20:48 UTC (permalink / raw)
To: Richard Henderson; +Cc: kuhn.chenqun, aaron, cota, qemu-devel, robhenry
Richard Henderson <richard.henderson@linaro.org> writes:
> On 2/9/21 10:27 AM, Alex Bennée wrote:
>> A duplicate insn is one that is appears to be executed twice in a row.
>> This is currently possible due to -icount and cpu_io_recompile()
>> causing a re-translation of a block. On it's own this won't trigger
>> any tests though.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>
>> ---
>> [AJB: well not quite, the x86_64 test trips over this due to some
>> weirdness in the way we handle rep insns, e.g. rep movsb (%esi),
>> %es:(%edi) in the x86 bios code]
>
> Ah, but that's not tcg weirdness, that's architectural weirdness. Multiple
> executions is how "rep" is supposed to work.
As the plugin can know the arch I can just disable the test for x86. At
the moment it doesn't matter because there is only a test for aarch64.
--
Alex Bennée
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v1 07/12] accel/tcg: actually cache our partial icount TB
2021-02-09 18:41 ` Richard Henderson
@ 2021-02-09 20:49 ` Alex Bennée
0 siblings, 0 replies; 20+ messages in thread
From: Alex Bennée @ 2021-02-09 20:49 UTC (permalink / raw)
To: Richard Henderson
Cc: qemu-devel, robhenry, aaron, cota, Paolo Bonzini, kuhn.chenqun
Richard Henderson <richard.henderson@linaro.org> writes:
> On 2/9/21 10:27 AM, Alex Bennée wrote:
>> /* Refill decrementer and continue execution. */
>> - insns_left = MIN(0xffff, cpu->icount_budget);
>> + insns_left = MIN(CF_COUNT_MASK, cpu->icount_budget);
> ...
>> + g_assert(insns_left < CF_COUNT_MASK);
>
> Why both the MIN and the assert?
Lack of faith in MIN I guess ;-)
I'll drop the assert.
>
>
> r~
--
Alex Bennée
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v1 10/12] accel/tcg: remove CF_NOCACHE and special cases
2021-02-09 18:27 ` [PATCH v1 10/12] accel/tcg: remove CF_NOCACHE and special cases Alex Bennée
@ 2021-02-09 21:03 ` Richard Henderson
0 siblings, 0 replies; 20+ messages in thread
From: Richard Henderson @ 2021-02-09 21:03 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: kuhn.chenqun, aaron, cota, robhenry, Paolo Bonzini
On 2/9/21 10:27 AM, Alex Bennée wrote:
> Now we no longer generate CF_NOCACHE blocks we can remove a bunch of
> the special case handling for them. While we are at it we can remove
> the unused tb->orig_tb field and save a few bytes on the TB structure.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> include/exec/exec-all.h | 3 ---
> accel/tcg/translate-all.c | 51 ++++++++++++---------------------------
> 2 files changed, 15 insertions(+), 39 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v1 11/12] accel/tcg: allow plugin instrumentation to be disable via cflags
2021-02-09 18:27 ` [PATCH v1 11/12] accel/tcg: allow plugin instrumentation to be disable via cflags Alex Bennée
@ 2021-02-09 21:05 ` Richard Henderson
0 siblings, 0 replies; 20+ messages in thread
From: Richard Henderson @ 2021-02-09 21:05 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: kuhn.chenqun, aaron, cota, robhenry, Paolo Bonzini
On 2/9/21 10:27 AM, Alex Bennée wrote:
> When icount is enabled and we recompile an MMIO access we end up
> double counting the instruction execution. To avoid this we introduce
> the CF_NOINSTR cflag which disables instrumentation for the next TB.
> As this is part of the hashed compile flags we will only execute the
> generated TB while coming out of a cpu_io_recompile.
>
> While we are at it delete the old TODO. We might as well keep the
> translation handy as it's likely you will repeatedly hit it on each
> MMIO access.
>
> Reported-by: Aaron Lindsay <aaron@os.amperecomputing.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> include/exec/exec-all.h | 3 ++-
> accel/tcg/translate-all.c | 17 ++++++++---------
> accel/tcg/translator.c | 2 +-
> 3 files changed, 11 insertions(+), 11 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
` (11 preceding siblings ...)
2021-02-09 18:27 ` [PATCH v1 12/12] tests/acceptance: add a new tests to detect counting errors Alex Bennée
@ 2021-02-11 11:28 ` no-reply
12 siblings, 0 replies; 20+ messages in thread
From: no-reply @ 2021-02-11 11:28 UTC (permalink / raw)
To: alex.bennee; +Cc: qemu-devel, robhenry, aaron, cota, kuhn.chenqun, alex.bennee
Patchew URL: https://patchew.org/QEMU/20210209182749.31323-1-alex.bennee@linaro.org/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Type: series
Message-id: 20210209182749.31323-1-alex.bennee@linaro.org
Subject: [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
- [tag update] patchew/20210209190224.62827-1-dgilbert@redhat.com -> patchew/20210209190224.62827-1-dgilbert@redhat.com
- [tag update] patchew/20210211045455.456371-1-thuth@redhat.com -> patchew/20210211045455.456371-1-thuth@redhat.com
Switched to a new branch 'test'
a9637ea tests/acceptance: add a new tests to detect counting errors
fa2e5c6 accel/tcg: allow plugin instrumentation to be disable via cflags
feba470 accel/tcg: remove CF_NOCACHE and special cases
efc2b45 accel/tcg: re-factor non-RAM execution code
8fa939a accel/tcg: cache single instruction TB on pending replay exception
3950a33 accel/tcg: actually cache our partial icount TB
999a79a tests/acceptance: add a new set of tests to exercise plugins
cd71497 tests/plugin: expand insn test to detect duplicate instructions
be5dad9 target/sh4: Create superh_io_recompile_replay_branch
ee10c4e target/mips: Create mips_io_recompile_replay_branch
69ecbdf accel/tcg: Create io_recompile_replay_branch hook
827fd40 exec: Move TranslationBlock typedef to qemu/typedefs.h
=== OUTPUT BEGIN ===
1/12 Checking commit 827fd4086c80 (exec: Move TranslationBlock typedef to qemu/typedefs.h)
2/12 Checking commit 69ecbdf64517 (accel/tcg: Create io_recompile_replay_branch hook)
3/12 Checking commit ee10c4e8c405 (target/mips: Create mips_io_recompile_replay_branch)
4/12 Checking commit be5dad9f333f (target/sh4: Create superh_io_recompile_replay_branch)
5/12 Checking commit cd71497cb2a2 (tests/plugin: expand insn test to detect duplicate instructions)
WARNING: line over 80 characters
#30: FILE: tests/plugin/insn.c:27:
+ g_autofree gchar *out = g_strdup_printf("detected repeat execution @ 0x%"
total: 0 errors, 1 warnings, 25 lines checked
Patch 5/12 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
6/12 Checking commit 999a79a49265 (tests/acceptance: add a new set of tests to exercise plugins)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#18:
new file mode 100644
total: 0 errors, 1 warnings, 103 lines checked
Patch 6/12 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
7/12 Checking commit 3950a3391d8c (accel/tcg: actually cache our partial icount TB)
8/12 Checking commit 8fa939a360c2 (accel/tcg: cache single instruction TB on pending replay exception)
WARNING: line over 80 characters
#89: FILE: accel/tcg/cpu-exec.c:654:
+ && (cpu->cflags_next_tb == -1 || cpu->cflags_next_tb & CF_USE_ICOUNT)
total: 0 errors, 1 warnings, 65 lines checked
Patch 8/12 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
9/12 Checking commit efc2b45722f4 (accel/tcg: re-factor non-RAM execution code)
WARNING: Block comments use a leading /* on a separate line
#26: FILE: accel/tcg/translate-all.c:1781:
+/* Add a new TB and link it to the physical page tables. phys_page2 is
total: 0 errors, 1 warnings, 53 lines checked
Patch 9/12 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/12 Checking commit feba47079ea4 (accel/tcg: remove CF_NOCACHE and special cases)
11/12 Checking commit fa2e5c6fe34b (accel/tcg: allow plugin instrumentation to be disable via cflags)
WARNING: line over 80 characters
#75: FILE: accel/tcg/translator.c:61:
+ plugin_enabled = !(tb_cflags(db->tb) & CF_NOINSTR) && plugin_gen_tb_start(cpu, tb);
ERROR: line over 90 characters
#96: FILE: include/exec/exec-all.h:465:
+ (CF_COUNT_MASK | CF_LAST_IO | CF_NOINSTR | CF_USE_ICOUNT | CF_PARALLEL | CF_CLUSTER_MASK)
total: 1 errors, 1 warnings, 57 lines checked
Patch 11/12 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
12/12 Checking commit a9637eabc2c8 (tests/acceptance: add a new tests to detect counting errors)
WARNING: line over 80 characters
#50: FILE: tests/acceptance/tcg_plugins.py:129:
+ m = re.search(br"detected repeat execution @ (?P<addr>0x[0-9A-Fa-f]+)", s)
total: 0 errors, 1 warnings, 34 lines checked
Patch 12/12 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/20210209182749.31323-1-alex.bennee@linaro.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2021-02-11 11:30 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-09 18:27 [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags Alex Bennée
2021-02-09 18:27 ` [PATCH v1 01/12] exec: Move TranslationBlock typedef to qemu/typedefs.h Alex Bennée
2021-02-09 18:27 ` [PATCH v1 02/12] accel/tcg: Create io_recompile_replay_branch hook Alex Bennée
2021-02-09 18:27 ` [PATCH v1 03/12] target/mips: Create mips_io_recompile_replay_branch Alex Bennée
2021-02-09 18:27 ` [PATCH v1 04/12] target/sh4: Create superh_io_recompile_replay_branch Alex Bennée
2021-02-09 18:27 ` [PATCH v1 05/12] tests/plugin: expand insn test to detect duplicate instructions Alex Bennée
2021-02-09 18:34 ` Richard Henderson
2021-02-09 20:48 ` Alex Bennée
2021-02-09 18:27 ` [PATCH v1 06/12] tests/acceptance: add a new set of tests to exercise plugins Alex Bennée
2021-02-09 18:27 ` [PATCH v1 07/12] accel/tcg: actually cache our partial icount TB Alex Bennée
2021-02-09 18:41 ` Richard Henderson
2021-02-09 20:49 ` Alex Bennée
2021-02-09 18:27 ` [PATCH v1 08/12] accel/tcg: cache single instruction TB on pending replay exception Alex Bennée
2021-02-09 18:27 ` [PATCH v1 09/12] accel/tcg: re-factor non-RAM execution code Alex Bennée
2021-02-09 18:27 ` [PATCH v1 10/12] accel/tcg: remove CF_NOCACHE and special cases Alex Bennée
2021-02-09 21:03 ` Richard Henderson
2021-02-09 18:27 ` [PATCH v1 11/12] accel/tcg: allow plugin instrumentation to be disable via cflags Alex Bennée
2021-02-09 21:05 ` Richard Henderson
2021-02-09 18:27 ` [PATCH v1 12/12] tests/acceptance: add a new tests to detect counting errors Alex Bennée
2021-02-11 11:28 ` [PATCH v1 00/12] fix plugins double counting with mmio, cleanup CF_ flags no-reply
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).