From patchwork Mon Dec 14 11:26:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 41087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AC6BFB6F1B for ; Mon, 14 Dec 2009 22:29:31 +1100 (EST) Received: from localhost ([127.0.0.1]:49614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NK97I-0006j5-H4 for incoming@patchwork.ozlabs.org; Mon, 14 Dec 2009 06:29:28 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NK94X-0006Em-7V for qemu-devel@nongnu.org; Mon, 14 Dec 2009 06:26:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NK94S-0006CF-50 for qemu-devel@nongnu.org; Mon, 14 Dec 2009 06:26:36 -0500 Received: from [199.232.76.173] (port=34089 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NK94Q-0006C8-LP for qemu-devel@nongnu.org; Mon, 14 Dec 2009 06:26:30 -0500 Received: from goliath.siemens.de ([192.35.17.28]:23559) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NK94P-0003LV-Ln for qemu-devel@nongnu.org; Mon, 14 Dec 2009 06:26:30 -0500 Received: from mail3.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id nBEBQRDu001621; Mon, 14 Dec 2009 12:26:27 +0100 Received: from [139.25.109.167] (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail3.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id nBEBQRbZ027997; Mon, 14 Dec 2009 12:26:27 +0100 Message-ID: <4B2620E3.2050604@siemens.com> Date: Mon, 14 Dec 2009 12:26:27 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Anthony Liguori X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: qemu-devel Subject: [Qemu-devel] [FOR 0.12][PATCH] target-i386: Fix evaluation of DR7 register X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org hw_breakpoint_type and hw_breakpoint_len used the wrong index multiplier to extract type and len. Signed-off-by: Jan Kiszka --- target-i386/cpu.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 9ef1be4..e835f23 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -834,12 +834,12 @@ static inline int hw_breakpoint_enabled(unsigned long dr7, int index) static inline int hw_breakpoint_type(unsigned long dr7, int index) { - return (dr7 >> (DR7_TYPE_SHIFT + (index * 2))) & 3; + return (dr7 >> (DR7_TYPE_SHIFT + (index * 4))) & 3; } static inline int hw_breakpoint_len(unsigned long dr7, int index) { - int len = ((dr7 >> (DR7_LEN_SHIFT + (index * 2))) & 3); + int len = ((dr7 >> (DR7_LEN_SHIFT + (index * 4))) & 3); return (len == 2) ? 8 : len + 1; }