* [Qemu-devel] [PATCH] kvm: x86: Prevent sign extension of DR7 in guest debugging mode
@ 2010-12-27 14:58 Jan Kiszka
2010-12-27 15:38 ` [Qemu-devel] " Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2010-12-27 14:58 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: qemu-devel, kvm
[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]
From: Jan Kiszka <jan.kiszka@siemens.com>
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>
---
target-i386/kvm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 9a4bf98..218812a 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1693,7 +1693,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 */
--
1.7.1
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-27 15:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-27 14:58 [Qemu-devel] [PATCH] kvm: x86: Prevent sign extension of DR7 in guest debugging mode Jan Kiszka
2010-12-27 15:38 ` [Qemu-devel] " Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).