aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/emulate.c4
-rw-r--r--arch/x86/kvm/svm.c2
-rw-r--r--arch/x86/kvm/vmx.c8
-rw-r--r--arch/x86/kvm/x86.c12
4 files changed, 17 insertions, 9 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 35f7acd4a91f..c9f604b0819c 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2128,7 +2128,7 @@ special_insn:
2128 } 2128 }
2129 2129
2130 if (c->modrm_reg == VCPU_SREG_SS) 2130 if (c->modrm_reg == VCPU_SREG_SS)
2131 toggle_interruptibility(ctxt, X86_SHADOW_INT_MOV_SS); 2131 toggle_interruptibility(ctxt, KVM_X86_SHADOW_INT_MOV_SS);
2132 2132
2133 rc = kvm_load_segment_descriptor(ctxt->vcpu, sel, c->modrm_reg); 2133 rc = kvm_load_segment_descriptor(ctxt->vcpu, sel, c->modrm_reg);
2134 2134
@@ -2366,7 +2366,7 @@ special_insn:
2366 if (emulator_bad_iopl(ctxt)) 2366 if (emulator_bad_iopl(ctxt))
2367 kvm_inject_gp(ctxt->vcpu, 0); 2367 kvm_inject_gp(ctxt->vcpu, 0);
2368 else { 2368 else {
2369 toggle_interruptibility(ctxt, X86_SHADOW_INT_STI); 2369 toggle_interruptibility(ctxt, KVM_X86_SHADOW_INT_STI);
2370 ctxt->eflags |= X86_EFLAGS_IF; 2370 ctxt->eflags |= X86_EFLAGS_IF;
2371 c->dst.type = OP_NONE; /* Disable writeback. */ 2371 c->dst.type = OP_NONE; /* Disable writeback. */
2372 } 2372 }
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 294bbca34173..bd8f52f0823f 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -265,7 +265,7 @@ static u32 svm_get_interrupt_shadow(struct kvm_vcpu *vcpu, int mask)
265 u32 ret = 0; 265 u32 ret = 0;
266 266
267 if (svm->vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) 267 if (svm->vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK)
268 ret |= X86_SHADOW_INT_STI | X86_SHADOW_INT_MOV_SS; 268 ret |= KVM_X86_SHADOW_INT_STI | KVM_X86_SHADOW_INT_MOV_SS;
269 return ret & mask; 269 return ret & mask;
270} 270}
271 271
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 68f895b00450..61f03980adae 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -846,9 +846,9 @@ static u32 vmx_get_interrupt_shadow(struct kvm_vcpu *vcpu, int mask)
846 int ret = 0; 846 int ret = 0;
847 847
848 if (interruptibility & GUEST_INTR_STATE_STI) 848 if (interruptibility & GUEST_INTR_STATE_STI)
849 ret |= X86_SHADOW_INT_STI; 849 ret |= KVM_X86_SHADOW_INT_STI;
850 if (interruptibility & GUEST_INTR_STATE_MOV_SS) 850 if (interruptibility & GUEST_INTR_STATE_MOV_SS)
851 ret |= X86_SHADOW_INT_MOV_SS; 851 ret |= KVM_X86_SHADOW_INT_MOV_SS;
852 852
853 return ret & mask; 853 return ret & mask;
854} 854}
@@ -860,9 +860,9 @@ static void vmx_set_interrupt_shadow(struct kvm_vcpu *vcpu, int mask)
860 860
861 interruptibility &= ~(GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS); 861 interruptibility &= ~(GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS);
862 862
863 if (mask & X86_SHADOW_INT_MOV_SS) 863 if (mask & KVM_X86_SHADOW_INT_MOV_SS)
864 interruptibility |= GUEST_INTR_STATE_MOV_SS; 864 interruptibility |= GUEST_INTR_STATE_MOV_SS;
865 if (mask & X86_SHADOW_INT_STI) 865 else if (mask & KVM_X86_SHADOW_INT_STI)
866 interruptibility |= GUEST_INTR_STATE_STI; 866 interruptibility |= GUEST_INTR_STATE_STI;
867 867
868 if ((interruptibility != interruptibility_old)) 868 if ((interruptibility != interruptibility_old))
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2b1c9f2fb8dd..84ffd95ee198 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2111,6 +2111,9 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
2111 vcpu->arch.interrupt.pending && !vcpu->arch.interrupt.soft; 2111 vcpu->arch.interrupt.pending && !vcpu->arch.interrupt.soft;
2112 events->interrupt.nr = vcpu->arch.interrupt.nr; 2112 events->interrupt.nr = vcpu->arch.interrupt.nr;
2113 events->interrupt.soft = 0; 2113 events->interrupt.soft = 0;
2114 events->interrupt.shadow =
2115 kvm_x86_ops->get_interrupt_shadow(vcpu,
2116 KVM_X86_SHADOW_INT_MOV_SS | KVM_X86_SHADOW_INT_STI);
2114 2117
2115 events->nmi.injected = vcpu->arch.nmi_injected; 2118 events->nmi.injected = vcpu->arch.nmi_injected;
2116 events->nmi.pending = vcpu->arch.nmi_pending; 2119 events->nmi.pending = vcpu->arch.nmi_pending;
@@ -2119,7 +2122,8 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
2119 events->sipi_vector = vcpu->arch.sipi_vector; 2122 events->sipi_vector = vcpu->arch.sipi_vector;
2120 2123
2121 events->flags = (KVM_VCPUEVENT_VALID_NMI_PENDING 2124 events->flags = (KVM_VCPUEVENT_VALID_NMI_PENDING
2122 | KVM_VCPUEVENT_VALID_SIPI_VECTOR); 2125 | KVM_VCPUEVENT_VALID_SIPI_VECTOR
2126 | KVM_VCPUEVENT_VALID_SHADOW);
2123 2127
2124 vcpu_put(vcpu); 2128 vcpu_put(vcpu);
2125} 2129}
@@ -2128,7 +2132,8 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
2128 struct kvm_vcpu_events *events) 2132 struct kvm_vcpu_events *events)
2129{ 2133{
2130 if (events->flags & ~(KVM_VCPUEVENT_VALID_NMI_PENDING 2134 if (events->flags & ~(KVM_VCPUEVENT_VALID_NMI_PENDING
2131 | KVM_VCPUEVENT_VALID_SIPI_VECTOR)) 2135 | KVM_VCPUEVENT_VALID_SIPI_VECTOR
2136 | KVM_VCPUEVENT_VALID_SHADOW))
2132 return -EINVAL; 2137 return -EINVAL;
2133 2138
2134 vcpu_load(vcpu); 2139 vcpu_load(vcpu);
@@ -2143,6 +2148,9 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
2143 vcpu->arch.interrupt.soft = events->interrupt.soft; 2148 vcpu->arch.interrupt.soft = events->interrupt.soft;
2144 if (vcpu->arch.interrupt.pending && irqchip_in_kernel(vcpu->kvm)) 2149 if (vcpu->arch.interrupt.pending && irqchip_in_kernel(vcpu->kvm))
2145 kvm_pic_clear_isr_ack(vcpu->kvm); 2150 kvm_pic_clear_isr_ack(vcpu->kvm);
2151 if (events->flags & KVM_VCPUEVENT_VALID_SHADOW)
2152 kvm_x86_ops->set_interrupt_shadow(vcpu,
2153 events->interrupt.shadow);
2146 2154
2147 vcpu->arch.nmi_injected = events->nmi.injected; 2155 vcpu->arch.nmi_injected = events->nmi.injected;
2148 if (events->flags & KVM_VCPUEVENT_VALID_NMI_PENDING) 2156 if (events->flags & KVM_VCPUEVENT_VALID_NMI_PENDING)