aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2008-12-15 07:52:10 -0500
committerAvi Kivity <avi@redhat.com>2009-03-24 05:02:49 -0400
commit55934c0bd3bb232a9cf902820dd63ad18ed65e49 (patch)
tree172644d0cc14e359a8e45a24d247b5180914b968 /arch
parentd0bfb940ecabf0b44fb1fd80d8d60594e569e5ec (diff)
KVM: VMX: Allow single-stepping when uninterruptible
When single-stepping over STI and MOV SS, we must clear the corresponding interruptibility bits in the guest state. Otherwise vmentry fails as it then expects bit 14 (BS) in pending debug exceptions being set, but that's not correct for the guest debugging case. Note that clearing those bits is safe as we check for interruptibility based on the original state and do not inject interrupts or NMIs if guest interruptibility was blocked. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/vmx.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f55690ddb3ac..c776868ffe41 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2478,6 +2478,11 @@ static void do_interrupt_requests(struct kvm_vcpu *vcpu,
2478{ 2478{
2479 vmx_update_window_states(vcpu); 2479 vmx_update_window_states(vcpu);
2480 2480
2481 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
2482 vmcs_clear_bits(GUEST_INTERRUPTIBILITY_INFO,
2483 GUEST_INTR_STATE_STI |
2484 GUEST_INTR_STATE_MOV_SS);
2485
2481 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) { 2486 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) {
2482 if (vcpu->arch.interrupt.pending) { 2487 if (vcpu->arch.interrupt.pending) {
2483 enable_nmi_window(vcpu); 2488 enable_nmi_window(vcpu);
@@ -3244,6 +3249,11 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
3244 3249
3245 vmx_update_window_states(vcpu); 3250 vmx_update_window_states(vcpu);
3246 3251
3252 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
3253 vmcs_clear_bits(GUEST_INTERRUPTIBILITY_INFO,
3254 GUEST_INTR_STATE_STI |
3255 GUEST_INTR_STATE_MOV_SS);
3256
3247 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) { 3257 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) {
3248 if (vcpu->arch.interrupt.pending) { 3258 if (vcpu->arch.interrupt.pending) {
3249 enable_nmi_window(vcpu); 3259 enable_nmi_window(vcpu);