From patchwork Mon Dec 14 11:26:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [FOR,0.12] target-i386: Fix evaluation of DR7 register Date: Mon, 14 Dec 2009 01:26:27 -0000 From: Jan Kiszka X-Patchwork-Id: 41087 Message-Id: <4B2620E3.2050604@siemens.com> To: Anthony Liguori Cc: qemu-devel 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; }