From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQmmj-0003EP-5z for qemu-devel@nongnu.org; Sat, 05 May 2012 17:45:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQmmh-0008BY-Gl for qemu-devel@nongnu.org; Sat, 05 May 2012 17:45:00 -0400 Received: from mail-lpp01m010-f45.google.com ([209.85.215.45]:45333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQmmh-0008AH-7Y for qemu-devel@nongnu.org; Sat, 05 May 2012 17:44:59 -0400 Received: by lahe6 with SMTP id e6so3378719lah.4 for ; Sat, 05 May 2012 14:44:56 -0700 (PDT) From: Max Filippov Date: Sun, 6 May 2012 01:44:31 +0400 Message-Id: <1336254271-26269-1-git-send-email-jcmvbkbc@gmail.com> Subject: [Qemu-devel] [PATCH] cputlb: fix watchpoints handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Max Filippov , Richard Henderson 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 --- cputlb.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cputlb.c b/cputlb.c index 7f40a62..0d1e252 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; -- 1.7.7.6