From: Paolo Bonzini Date: Tue, 10 Oct 2017 15:14:44 +0000 (+0200) Subject: nios2: define tcg_env X-Git-Tag: v2.10.2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e31942b4865634e613b3b3d17af80b38e82d5fbe;p=thirdparty%2Fqemu.git nios2: define tcg_env This should be done by all target and, since commit 53f6672bcf ("gen-icount: use tcg_ctx.tcg_env instead of cpu_env", 2017-06-30), is causing the NIOS2 target to hang. This is because the test for "should I exit to the main loop" was being done with the correct offset to the icount decrementer, but using TCG temporary 0 (the frame pointer) rather than the env pointer. Cc: qemu-stable@nongnu.org Cc: Marek Vasut Reported-by: Thomas Huth Signed-off-by: Paolo Bonzini (cherry picked from commit 17bd9597be45b96ae00716b0ae01a4d11bbee1ab) Signed-off-by: Michael Roth --- diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 8b97d6585f0..f25ef7e2bb7 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -942,6 +942,7 @@ void nios2_tcg_init(void) int i; cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env"); + tcg_ctx.tcg_env = cpu_env; for (i = 0; i < NUM_CORE_REGS; i++) { cpu_R[i] = tcg_global_mem_new(cpu_env,