From patchwork Sat May 5 21:44:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 157049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E8B15B6FCA for ; Sun, 6 May 2012 07:45:10 +1000 (EST) Received: from localhost ([::1]:33883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQmmq-0003Ff-Lk for incoming@patchwork.ozlabs.org; Sat, 05 May 2012 17:45:08 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=dccT24GbvwuaQCw3ik07ILQPcMaJmgHiyL98aDkmWmw=; b=S1O6+fSZGYZzx/wMiSdqRSFxqrRQ2x6WMb6Hy8ABKSCtTTKlb1hDTSx6X6uI2ZToRx u/J97PRY2D15pnS4FgKzBJuFRruyaOPSZMi3UpoJx5jvgHOl7wz00HopZCAFQWUVhsiE q+ojz3M0jt2B+x6l0lBktkyOyG32mISQNiJ7RVaVYv0j34q2KmbYtg6Yu2wTxNJ6shDo cAMSNVUOIAQfJxzAGy3xVx8Kfet3GxG0u/VGlKpz7fMRQ4lSJIJq7LgXf/esfRdgLyZ2 H+heWTGzeRqv2trWqSMhz+BPGoDUakHyH+RmUE4/A/Q+0RFhfenKgekrz8FAmmdaqNfK 4piw== Received: by 10.152.132.166 with SMTP id ov6mr10800377lab.35.1336254296076; Sat, 05 May 2012 14:44:56 -0700 (PDT) Received: from octofox.metropolis ([188.134.19.124]) by mx.google.com with ESMTPS id te8sm13588069lab.3.2012.05.05.14.44.53 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 May 2012 14:44:54 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Sun, 6 May 2012 01:44:31 +0400 Message-Id: <1336254271-26269-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.7.7.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.45 Cc: Blue Swirl , Max Filippov , Richard Henderson Subject: [Qemu-devel] [PATCH] cputlb: fix watchpoints handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;