summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-12-14 12:26:27 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-19 08:26:20 -0600
commita8ea3a357b4f6d53e1f93f23d1368c574084a6f2 (patch)
treecf1d85268e74a83ad0582ffcf7d0cc18c6550d0e /target-i386/cpu.h
parentkvm: x86: Use separate exception_injected CPUState field (diff)
downloadqemu-kvm-a8ea3a357b4f6d53e1f93f23d1368c574084a6f2.tar.gz
qemu-kvm-a8ea3a357b4f6d53e1f93f23d1368c574084a6f2.tar.bz2
qemu-kvm-a8ea3a357b4f6d53e1f93f23d1368c574084a6f2.zip
target-i386: Fix evaluation of DR7 register
hw_breakpoint_type and hw_breakpoint_len used the wrong index multiplier to extract type and len. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit d46272c774a94a8b2f0849703070dbcd93057f50)
Diffstat (limited to 'target-i386/cpu.h')
-rw-r--r--target-i386/cpu.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index afb4da5ea..f3834b307 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -835,12 +835,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;
}