From patchwork Sat Jun 23 00:33:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 166711 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 A6EA2B6F9F for ; Sat, 23 Jun 2012 11:25:49 +1000 (EST) Received: from localhost ([::1]:57361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiEJW-0007eP-Fe for incoming@patchwork.ozlabs.org; Fri, 22 Jun 2012 20:34:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiEIm-00068T-B2 for qemu-devel@nongnu.org; Fri, 22 Jun 2012 20:34:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SiEIk-0007uf-GX for qemu-devel@nongnu.org; Fri, 22 Jun 2012 20:34:11 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:50139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiEIk-0007rl-7m for qemu-devel@nongnu.org; Fri, 22 Jun 2012 20:34:10 -0400 Received: by mail-pz0-f45.google.com with SMTP id n2so3053134dad.4 for ; Fri, 22 Jun 2012 17:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=F9ckgXYJfaz3vJ3vhUhNDAMLS/r/IVUFXlwBmJTuSkE=; b=ZH7eH2aDCRBQ+oArzXczTkR0blGCQ7rVYMZt0Jxxvc/wAX56jdrmm4DCX5ZJgRb/Sq HGyl/MQjZQhAyWhiViYh92mMxDEQJrw1paj5dMdR46gt9pEIWIzBVErP4nCCGpufoAqK juexlBy3DParXDCCM+W6LUxbPgFFa9ZkuOr1cy7rnK3w6bSd/7aAm+iyyxZEfcAz9xr0 rkvyTCbqiVR8JVPYA7BXI4c5ra37pvzyGqKylx1iSF4QB1qH77CpxJ2pKrr3JsWHeZQT dFBmk4XDjktcORQrqsS47LIgOMkZVr0Q6gmgOIpflQu0ZNil4/B6uAz3qw7kxTpNJSQ5 FXsg== Received: by 10.68.240.69 with SMTP id vy5mr14663050pbc.156.1340411649152; Fri, 22 Jun 2012 17:34:09 -0700 (PDT) Received: from localhost.localdomain ([32.97.110.59]) by mx.google.com with ESMTPS id os1sm630169pbb.49.2012.06.22.17.34.06 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jun 2012 17:34:08 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Fri, 22 Jun 2012 19:33:12 -0500 Message-Id: <1340411610-22596-9-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1340411610-22596-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1340411610-22596-1-git-send-email-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.45 Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH stable-1.1 08/26] exec: fix TB invalidation after breakpoint insertion/deletion 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 From: Max Filippov tb_invalidate_phys_addr has to be called with the exact physical address of the breakpoint we add/remove, not just the page's base address. Otherwise we easily fail to flush the right TB. This breakage was introduced by the commit f3705d5329 "memory: make phys_page_find() return an unadjusted". This appeared to work for some guest architectures because their cpu_get_phys_page_debug implementation returns full translated physical address, not just the base of the TARGET_PAGE_SIZE-sized page. Reported-by: TeLeMan Signed-off-by: Jan Kiszka Signed-off-by: Max Filippov Signed-off-by: Blue Swirl --- exec.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/exec.c b/exec.c index a0494c7..0a67f07 100644 --- a/exec.c +++ b/exec.c @@ -1492,7 +1492,8 @@ void tb_invalidate_phys_addr(target_phys_addr_t addr) static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) { - tb_invalidate_phys_addr(cpu_get_phys_page_debug(env, pc)); + tb_invalidate_phys_addr(cpu_get_phys_page_debug(env, pc) | + (pc & ~TARGET_PAGE_MASK)); } #endif #endif /* TARGET_HAS_ICE */