diff options
author | Nadav Amit <namit@cs.technion.ac.il> | 2014-11-02 11:54:43 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-11-07 15:44:02 +0100 |
commit | 6d2a0526b09e551d0f395cfb63e7cb965db825af (patch) | |
tree | 20748d796d155fc44cd1102b8fb4a66663548805 /arch/x86/kvm/emulate.c | |
parent | 3ffb24681cc46f869378a4de54615db8d4ef0daf (diff) | |
download | lwn-6d2a0526b09e551d0f395cfb63e7cb965db825af.tar.gz lwn-6d2a0526b09e551d0f395cfb63e7cb965db825af.zip |
KVM: x86: Emulator should set DR6 upon GD like real CPU
It should clear B0-B3 and set BD.
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index a4703eb9c1ed..736a49f218ff 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3588,8 +3588,15 @@ static int check_dr_read(struct x86_emulate_ctxt *ctxt) if ((cr4 & X86_CR4_DE) && (dr == 4 || dr == 5)) return emulate_ud(ctxt); - if (check_dr7_gd(ctxt)) + if (check_dr7_gd(ctxt)) { + ulong dr6; + + ctxt->ops->get_dr(ctxt, 6, &dr6); + dr6 &= ~15; + dr6 |= DR6_BD | DR6_RTM; + ctxt->ops->set_dr(ctxt, 6, dr6); return emulate_db(ctxt); + } return X86EMUL_CONTINUE; } |