]> git.proxmox.com Git - qemu.git/commitdiff
cputlb: fix watchpoints handling
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 5 May 2012 21:44:31 +0000 (01:44 +0400)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 12 May 2012 09:14:38 +0000 (09:14 +0000)
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>
cputlb.c

index 7f40a622236b12d72f898f342a4c14fe4b908d67..0d1e2527fb0b761431cd62fda55b5d4ad3b6412b 100644 (file)
--- 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;