[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation
From: |
Ilya Leoshkevich |
Subject: |
[PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation |
Date: |
Wed, 14 Apr 2021 15:41:12 +0200 |
If arch-specific code generates a translation block of size 0,
tb_gen_code() may generate a spurious exception. Add an assertion in
order to catch such situations early.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
accel/tcg/translate-all.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index ba6ab09790..93b2dae112 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1913,6 +1913,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
tcg_ctx->cpu = env_cpu(env);
gen_intermediate_code(cpu, tb, max_insns);
+ assert(tb->size != 0);
tcg_ctx->cpu = NULL;
max_insns = tb->icount;
--
2.29.2
- [PATCH v3 0/3] accel/tcg: Make sure that tb->size != 0 after translation, Ilya Leoshkevich, 2021/04/14
- [PATCH v3 2/3] target/arm: Make sure that commpage's tb->size != 0, Ilya Leoshkevich, 2021/04/14
- [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation,
Ilya Leoshkevich <=
- Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation, David Hildenbrand, 2021/04/14
- Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation, Ilya Leoshkevich, 2021/04/14
- Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation, Max Filippov, 2021/04/14
- Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation, Richard Henderson, 2021/04/14
- Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation, Max Filippov, 2021/04/14
- Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation, Ilya Leoshkevich, 2021/04/15
- Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation, Richard Henderson, 2021/04/15
- Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation, Peter Maydell, 2021/04/15
- Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation, Max Filippov, 2021/04/15
[PATCH v3 1/3] target/s390x: Fix translation exception on illegal instruction, Ilya Leoshkevich, 2021/04/14