From d7d4be25b1ed7de89432f4cb6d4c73d9ccd6801e Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Mon, 21 Sep 2015 10:26:33 +0800 Subject: [PATCH] arm64: early check to see if the address of this block is the until address --- qemu/target-arm/translate-a64.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qemu/target-arm/translate-a64.c b/qemu/target-arm/translate-a64.c index 5dda2eba..d081fc49 100644 --- a/qemu/target-arm/translate-a64.c +++ b/qemu/target-arm/translate-a64.c @@ -11105,6 +11105,13 @@ void gen_intermediate_code_internal_a64(ARMCPU *cpu, tcg_clear_temp_count(); + // Unicorn: early check to see if the address of this block is the until address + if (tb->pc == env->uc->addr_end) { + gen_tb_start(tcg_ctx); + gen_exception_insn(dc, 0, EXCP_SWI, 0); + goto done_generating; + } + // Unicorn: trace this block on request // Only hook this block if it is not broken from previous translation due to // full translation cache