aboutsummaryrefslogtreecommitdiff
path: root/target-i386/kvm.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-12-27 15:58:23 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2011-01-21 14:05:22 -0200
commit95c077c91900c1420cd4f0be996ffeea6fb6cec8 (patch)
tree8e10e4964371a3b510cc0f10487327d47dcd8fce /target-i386/kvm.c
parent3980e3024b2d1677a9910de5e35d22d5d8392522 (diff)
kvm: x86: Prevent sign extension of DR7 in guest debugging mode
This unbreaks guest debugging when the 4th hardware breakpoint used for guest debugging is a watchpoint of 4 or 8 byte lenght. The 31st bit of DR7 is set in that case and used to cause a sign extension to the high word which was breaking the guest state (vm entry failure). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r--target-i386/kvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 7e5982b132..85edaccad1 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1686,7 +1686,7 @@ void kvm_arch_update_guest_debug(CPUState *env, struct kvm_guest_debug *dbg)
dbg->arch.debugreg[n] = hw_breakpoint[n].addr;
dbg->arch.debugreg[7] |= (2 << (n * 2)) |
(type_code[hw_breakpoint[n].type] << (16 + n*4)) |
- (len_code[hw_breakpoint[n].len] << (18 + n*4));
+ ((uint32_t)len_code[hw_breakpoint[n].len] << (18 + n*4));
}
}
/* Legal xcr0 for loading */