aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c5f7e035e0f1..d1a1feaa522b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4706,7 +4706,7 @@ static void emulator_invlpg(struct x86_emulate_ctxt *ctxt, ulong address)
4706 kvm_mmu_invlpg(emul_to_vcpu(ctxt), address); 4706 kvm_mmu_invlpg(emul_to_vcpu(ctxt), address);
4707} 4707}
4708 4708
4709int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu) 4709int kvm_emulate_wbinvd_noskip(struct kvm_vcpu *vcpu)
4710{ 4710{
4711 if (!need_emulate_wbinvd(vcpu)) 4711 if (!need_emulate_wbinvd(vcpu))
4712 return X86EMUL_CONTINUE; 4712 return X86EMUL_CONTINUE;
@@ -4723,11 +4723,19 @@ int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu)
4723 wbinvd(); 4723 wbinvd();
4724 return X86EMUL_CONTINUE; 4724 return X86EMUL_CONTINUE;
4725} 4725}
4726
4727int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu)
4728{
4729 kvm_x86_ops->skip_emulated_instruction(vcpu);
4730 return kvm_emulate_wbinvd_noskip(vcpu);
4731}
4726EXPORT_SYMBOL_GPL(kvm_emulate_wbinvd); 4732EXPORT_SYMBOL_GPL(kvm_emulate_wbinvd);
4727 4733
4734
4735
4728static void emulator_wbinvd(struct x86_emulate_ctxt *ctxt) 4736static void emulator_wbinvd(struct x86_emulate_ctxt *ctxt)
4729{ 4737{
4730 kvm_emulate_wbinvd(emul_to_vcpu(ctxt)); 4738 kvm_emulate_wbinvd_noskip(emul_to_vcpu(ctxt));
4731} 4739}
4732 4740
4733int emulator_get_dr(struct x86_emulate_ctxt *ctxt, int dr, unsigned long *dest) 4741int emulator_get_dr(struct x86_emulate_ctxt *ctxt, int dr, unsigned long *dest)
@@ -5817,7 +5825,7 @@ void kvm_arch_exit(void)
5817 free_percpu(shared_msrs); 5825 free_percpu(shared_msrs);
5818} 5826}
5819 5827
5820int kvm_emulate_halt(struct kvm_vcpu *vcpu) 5828int kvm_vcpu_halt(struct kvm_vcpu *vcpu)
5821{ 5829{
5822 ++vcpu->stat.halt_exits; 5830 ++vcpu->stat.halt_exits;
5823 if (irqchip_in_kernel(vcpu->kvm)) { 5831 if (irqchip_in_kernel(vcpu->kvm)) {
@@ -5828,6 +5836,13 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu)
5828 return 0; 5836 return 0;
5829 } 5837 }
5830} 5838}
5839EXPORT_SYMBOL_GPL(kvm_vcpu_halt);
5840
5841int kvm_emulate_halt(struct kvm_vcpu *vcpu)
5842{
5843 kvm_x86_ops->skip_emulated_instruction(vcpu);
5844 return kvm_vcpu_halt(vcpu);
5845}
5831EXPORT_SYMBOL_GPL(kvm_emulate_halt); 5846EXPORT_SYMBOL_GPL(kvm_emulate_halt);
5832 5847
5833int kvm_hv_hypercall(struct kvm_vcpu *vcpu) 5848int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
@@ -5912,6 +5927,8 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu)
5912 unsigned long nr, a0, a1, a2, a3, ret; 5927 unsigned long nr, a0, a1, a2, a3, ret;
5913 int op_64_bit, r = 1; 5928 int op_64_bit, r = 1;
5914 5929
5930 kvm_x86_ops->skip_emulated_instruction(vcpu);
5931
5915 if (kvm_hv_hypercall_enabled(vcpu->kvm)) 5932 if (kvm_hv_hypercall_enabled(vcpu->kvm))
5916 return kvm_hv_hypercall(vcpu); 5933 return kvm_hv_hypercall(vcpu);
5917 5934