summaryrefslogtreecommitdiffstats
path: root/cputlb.c
diff options
context:
space:
mode:
authorMax Filippov2012-05-05 23:44:31 +0200
committerBlue Swirl2012-05-12 11:14:38 +0200
commit56eb21e15827fd0326c57dcab59771cb03ad9df6 (patch)
treea9573601b5f3dc04de606032cbcba47392eaf9ab /cputlb.c
parenttarget-arm/cpu.h: Make cpu_init("nonexistent cpu") return NULL (diff)
downloadqemu-56eb21e15827fd0326c57dcab59771cb03ad9df6.tar.gz
qemu-56eb21e15827fd0326c57dcab59771cb03ad9df6.tar.xz
qemu-56eb21e15827fd0326c57dcab59771cb03ad9df6.zip
cputlb: fix watchpoints handling
Cleanup commit e554861766d9ae84dd5720baa4869f4ed711506f have changed code_address calculation in the tlb_set_page function in case of access to a page with a watchpoint. This caused QEMU segfault in the xtensa test_break unit test. Fix it by moving code_address assignment above memory_region_section_get_iotlb call. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'cputlb.c')
-rw-r--r--cputlb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cputlb.c b/cputlb.c
index 7f40a62223..0d1e2527fb 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -272,10 +272,10 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr,
} else {
addend = 0;
}
- iotlb = memory_region_section_get_iotlb(env, section, vaddr, paddr, prot,
- &address);
code_address = address;
+ iotlb = memory_region_section_get_iotlb(env, section, vaddr, paddr, prot,
+ &address);
index = (vaddr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
env->iotlb[mmu_idx][index] = iotlb - vaddr;