From patchwork Mon Oct 28 00:43:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 286385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4EF542C00C5 for ; Mon, 28 Oct 2013 11:44:36 +1100 (EST) Received: from localhost ([::1]:39491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaawZ-0008S9-NE for incoming@patchwork.ozlabs.org; Sun, 27 Oct 2013 20:44:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaawF-0008Rq-0I for qemu-devel@nongnu.org; Sun, 27 Oct 2013 20:44:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vaaw8-0007Bf-Vh for qemu-devel@nongnu.org; Sun, 27 Oct 2013 20:44:10 -0400 Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:43047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vaaw8-0007BV-Nq; Sun, 27 Oct 2013 20:44:04 -0400 Received: by mail-lb0-f181.google.com with SMTP id x18so2338579lbi.12 for ; Sun, 27 Oct 2013 17:44:02 -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; bh=XEjaJHStLNfE5OfCXQ9eBVjf6wOIkEQTRBnzEzJGr8Q=; b=0o57nptrhKJf0i0OekmkYz7q4qbLCMa2TxDE73G8UyYnvGx7+n27eS/b2tOsjz0g0V F8o1drESxm7CYEyzMKqfbTGGd8fiGYgUa3sboG3eTP43sWf5lQTpun431WD0EbWisVLA 43sttEK0vi3aCIMXpMAc07FBzXkCpvu9q3GRL38QxL3p46pcHaT5EftV1+EaTsiyMRDL JCqYcpwg2sGcdsExJ1yYWDDlTjCpZ2EgTtu0JLRE19fyajq78PFRNvkIXFvkUOmyTUa3 l0wrWQRcWvZRf5v5S+pjRVzd9mULv4QG1TM1s6hDB9jVdqfPamcUXJpnMbm0hc8K2rqV Uwxw== X-Received: by 10.112.168.35 with SMTP id zt3mr9293099lbb.11.1382921042704; Sun, 27 Oct 2013 17:44:02 -0700 (PDT) Received: from octofox.metropolis ([188.134.19.124]) by mx.google.com with ESMTPSA id u18sm11134367lbp.4.2013.10.27.17.44.01 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Sun, 27 Oct 2013 17:44:01 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 28 Oct 2013 04:43:28 +0400 Message-Id: <1382921008-12575-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.8.1.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::235 Cc: pbonzini@redhat.com, qemu-stable@nongnu.org, Max Filippov Subject: [Qemu-devel] [PATCH for 1.7] exec: fix breakpoint_invalidate when pc may not be translated 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 This fixes qemu abort with the following message: include/qemu/int128.h:22: int128_get64: Assertion `!a.hi' failed. which happens due to attempt to invalidate breakpoint by virtual address for which get_phys_page_debug couldn't find mapping. For more details see http://lists.nongnu.org/archive/html/qemu-devel/2013-09/msg04582.html Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov Reviewed-by: Paolo Bonzini --- exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 2e31ffc..9150430 100644 --- a/exec.c +++ b/exec.c @@ -409,8 +409,10 @@ static void breakpoint_invalidate(CPUState *cpu, target_ulong pc) #else static void breakpoint_invalidate(CPUState *cpu, target_ulong pc) { - tb_invalidate_phys_addr(cpu_get_phys_page_debug(cpu, pc) | - (pc & ~TARGET_PAGE_MASK)); + hwaddr phys = cpu_get_phys_page_debug(cpu, pc); + if (phys != -1) { + tb_invalidate_phys_addr(phys | (pc & ~TARGET_PAGE_MASK)); + } } #endif #endif /* TARGET_HAS_ICE */