KVM: x86: fix root cause for missed hardware breakpoints
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Feb 2016 11:28:40 +0000 (12:28 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 9 Mar 2016 18:15:10 +0000 (13:15 -0500)
commit18d609bb0b8c6823a750b32106be5685ca3daff7
tree1029cb3396c12588e839d4be9afc750a713019f4
parentd017f850a3b6f84e6d847c6cbb01eaf6ce61f4f6
KVM: x86: fix root cause for missed hardware breakpoints

[ Upstream commit 70e4da7a8ff62f2775337b705f45c804bb450454 ]

Commit 172b2386ed16 ("KVM: x86: fix missed hardware breakpoints",
2016-02-10) worked around a case where the debug registers are not loaded
correctly on preemption and on the first entry to KVM_RUN.

However, Xiao Guangrong pointed out that the root cause must be that
KVM_DEBUGREG_BP_ENABLED is not being set correctly.  This can indeed
happen due to the lazy debug exit mechanism, which does not call
kvm_update_dr7.  Fix it by replacing the existing loop (more or less
equivalent to kvm_update_dr0123) with calls to all the kvm_update_dr*
functions.

Cc: stable@vger.kernel.org # 4.1+
Fixes: 172b2386ed16a9143d9a456aae5ec87275c61489
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/x86/kvm/x86.c