cputlb: fix watchpoints handling
PATCH 1/1 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 <[email protected]>
--- cputlb.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
cputlb.c +2 -2
@@ -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;
Signature · 1 line
1.7.7.6
Blue Swirl
AppliedThanks, applied.
Quoted 31 lines · Max Filippov
Cleanup commit
e554861766d9ae84dd5720baa4869f4ed711506fhave changedcode_addresscalculation in thetlb_set_pagefunction in case of access to a page with a watchpoint. This caused QEMU segfault in the xtensatest_breakunit test. Fix it by movingcode_addressassignment abovememory_region_section_get_iotlbcall.Signed-off-by Max Filippov <[email protected]>---
cputlb.c | 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)cputlb.c +2
-3@@ -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; --1.7.7.6