Commit 4f400ab52009ed8f76fa541454a4368f9515f897

Authored by edgar_igl
1 parent 9004627f

Cut the translation block after translating a break insn. This avoids an issue w…

…here QEMU finds an illegal CRIS insn while the guest is returning through a signal return trampoline.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3997 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 1 deletions
target-cris/translate.c
@@ -71,6 +71,8 @@ @@ -71,6 +71,8 @@
71 #define BUG() (gen_BUG(dc, __FILE__, __LINE__)) 71 #define BUG() (gen_BUG(dc, __FILE__, __LINE__))
72 #define BUG_ON(x) ({if (x) BUG();}) 72 #define BUG_ON(x) ({if (x) BUG();})
73 73
  74 +#define DISAS_SWI 5
  75 +
74 /* Used by the decoder. */ 76 /* Used by the decoder. */
75 #define EXTRACT_FIELD(src, start, end) \ 77 #define EXTRACT_FIELD(src, start, end) \
76 (((src) >> start) & ((1 << (end - start + 1)) - 1)) 78 (((src) >> start) & ((1 << (end - start + 1)) - 1))
@@ -2112,6 +2114,7 @@ static unsigned int dec_rfe_etc(DisasContext *dc) @@ -2112,6 +2114,7 @@ static unsigned int dec_rfe_etc(DisasContext *dc)
2112 gen_op_movl_pc_T0(); 2114 gen_op_movl_pc_T0();
2113 /* Breaks start at 16 in the exception vector. */ 2115 /* Breaks start at 16 in the exception vector. */
2114 gen_op_break_im(dc->op1 + 16); 2116 gen_op_break_im(dc->op1 + 16);
  2117 + dc->is_jmp = DISAS_SWI;
2115 break; 2118 break;
2116 default: 2119 default:
2117 printf ("op2=%x\n", dc->op2); 2120 printf ("op2=%x\n", dc->op2);
@@ -2332,7 +2335,8 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb, @@ -2332,7 +2335,8 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
2332 do 2335 do
2333 { 2336 {
2334 check_breakpoint(env, dc); 2337 check_breakpoint(env, dc);
2335 - if (dc->is_jmp == DISAS_JUMP) 2338 + if (dc->is_jmp == DISAS_JUMP
  2339 + || dc->is_jmp == DISAS_SWI)
2336 goto done; 2340 goto done;
2337 2341
2338 if (search_pc) { 2342 if (search_pc) {
@@ -2404,6 +2408,7 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb, @@ -2404,6 +2408,7 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
2404 to find the next TB */ 2408 to find the next TB */
2405 tcg_gen_exit_tb(0); 2409 tcg_gen_exit_tb(0);
2406 break; 2410 break;
  2411 + case DISAS_SWI:
2407 case DISAS_TB_JUMP: 2412 case DISAS_TB_JUMP:
2408 /* nothing more to generate */ 2413 /* nothing more to generate */
2409 break; 2414 break;