Commit d39c0b990a243fba280eb4222daf685491431a5b
1 parent
2b03a7a5
fixed MMU bug on code page boundary
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1362 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
8 additions
and
4 deletions
target-sparc/translate.c
... | ... | @@ -1395,24 +1395,24 @@ static void disas_sparc_insn(DisasContext * dc) |
1395 | 1395 | if (!supervisor(dc)) |
1396 | 1396 | goto priv_insn; |
1397 | 1397 | gen_op_sta(insn, 0, 4, 0); |
1398 | - break; | |
1398 | + break; | |
1399 | 1399 | case 0x15: |
1400 | 1400 | if (!supervisor(dc)) |
1401 | 1401 | goto priv_insn; |
1402 | 1402 | gen_op_stba(insn, 0, 1, 0); |
1403 | - break; | |
1403 | + break; | |
1404 | 1404 | case 0x16: |
1405 | 1405 | if (!supervisor(dc)) |
1406 | 1406 | goto priv_insn; |
1407 | 1407 | gen_op_stha(insn, 0, 2, 0); |
1408 | - break; | |
1408 | + break; | |
1409 | 1409 | case 0x17: |
1410 | 1410 | if (!supervisor(dc)) |
1411 | 1411 | goto priv_insn; |
1412 | 1412 | flush_T2(dc); |
1413 | 1413 | gen_movl_reg_T2(rd + 1); |
1414 | 1414 | gen_op_stda(insn, 0, 8, 0); |
1415 | - break; | |
1415 | + break; | |
1416 | 1416 | #endif |
1417 | 1417 | default: |
1418 | 1418 | case 0x0e: /* V9 stx */ |
... | ... | @@ -1545,6 +1545,10 @@ static inline int gen_intermediate_code_internal(TranslationBlock * tb, |
1545 | 1545 | /* if the next PC is different, we abort now */ |
1546 | 1546 | if (dc->pc != (last_pc + 4)) |
1547 | 1547 | break; |
1548 | + /* if we reach a page boundary, we stop generation so that the | |
1549 | + PC of a TT_TFAULT exception is always in the right page */ | |
1550 | + if ((dc->pc & (TARGET_PAGE_SIZE - 1)) == 0) | |
1551 | + break; | |
1548 | 1552 | /* if single step mode, we generate only one instruction and |
1549 | 1553 | generate an exception */ |
1550 | 1554 | if (env->singlestep_enabled) { | ... | ... |