diff options
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 6276140044d0..89c4c5aa15f1 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -776,7 +776,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu) | |||
776 | } | 776 | } |
777 | 777 | ||
778 | if (!svm->next_rip) { | 778 | if (!svm->next_rip) { |
779 | if (emulate_instruction(vcpu, EMULTYPE_SKIP) != | 779 | if (kvm_emulate_instruction(vcpu, EMULTYPE_SKIP) != |
780 | EMULATE_DONE) | 780 | EMULATE_DONE) |
781 | printk(KERN_DEBUG "%s: NOP\n", __func__); | 781 | printk(KERN_DEBUG "%s: NOP\n", __func__); |
782 | return; | 782 | return; |
@@ -2715,7 +2715,7 @@ static int gp_interception(struct vcpu_svm *svm) | |||
2715 | 2715 | ||
2716 | WARN_ON_ONCE(!enable_vmware_backdoor); | 2716 | WARN_ON_ONCE(!enable_vmware_backdoor); |
2717 | 2717 | ||
2718 | er = emulate_instruction(vcpu, | 2718 | er = kvm_emulate_instruction(vcpu, |
2719 | EMULTYPE_VMWARE | EMULTYPE_NO_UD_ON_FAIL); | 2719 | EMULTYPE_VMWARE | EMULTYPE_NO_UD_ON_FAIL); |
2720 | if (er == EMULATE_USER_EXIT) | 2720 | if (er == EMULATE_USER_EXIT) |
2721 | return 0; | 2721 | return 0; |
@@ -2819,7 +2819,7 @@ static int io_interception(struct vcpu_svm *svm) | |||
2819 | string = (io_info & SVM_IOIO_STR_MASK) != 0; | 2819 | string = (io_info & SVM_IOIO_STR_MASK) != 0; |
2820 | in = (io_info & SVM_IOIO_TYPE_MASK) != 0; | 2820 | in = (io_info & SVM_IOIO_TYPE_MASK) != 0; |
2821 | if (string) | 2821 | if (string) |
2822 | return emulate_instruction(vcpu, 0) == EMULATE_DONE; | 2822 | return kvm_emulate_instruction(vcpu, 0) == EMULATE_DONE; |
2823 | 2823 | ||
2824 | port = io_info >> 16; | 2824 | port = io_info >> 16; |
2825 | size = (io_info & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT; | 2825 | size = (io_info & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT; |
@@ -3861,7 +3861,7 @@ static int iret_interception(struct vcpu_svm *svm) | |||
3861 | static int invlpg_interception(struct vcpu_svm *svm) | 3861 | static int invlpg_interception(struct vcpu_svm *svm) |
3862 | { | 3862 | { |
3863 | if (!static_cpu_has(X86_FEATURE_DECODEASSISTS)) | 3863 | if (!static_cpu_has(X86_FEATURE_DECODEASSISTS)) |
3864 | return emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE; | 3864 | return kvm_emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE; |
3865 | 3865 | ||
3866 | kvm_mmu_invlpg(&svm->vcpu, svm->vmcb->control.exit_info_1); | 3866 | kvm_mmu_invlpg(&svm->vcpu, svm->vmcb->control.exit_info_1); |
3867 | return kvm_skip_emulated_instruction(&svm->vcpu); | 3867 | return kvm_skip_emulated_instruction(&svm->vcpu); |
@@ -3869,13 +3869,13 @@ static int invlpg_interception(struct vcpu_svm *svm) | |||
3869 | 3869 | ||
3870 | static int emulate_on_interception(struct vcpu_svm *svm) | 3870 | static int emulate_on_interception(struct vcpu_svm *svm) |
3871 | { | 3871 | { |
3872 | return emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE; | 3872 | return kvm_emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE; |
3873 | } | 3873 | } |
3874 | 3874 | ||
3875 | static int rsm_interception(struct vcpu_svm *svm) | 3875 | static int rsm_interception(struct vcpu_svm *svm) |
3876 | { | 3876 | { |
3877 | return x86_emulate_instruction(&svm->vcpu, 0, 0, | 3877 | return kvm_emulate_instruction_from_buffer(&svm->vcpu, |
3878 | rsm_ins_bytes, 2) == EMULATE_DONE; | 3878 | rsm_ins_bytes, 2) == EMULATE_DONE; |
3879 | } | 3879 | } |
3880 | 3880 | ||
3881 | static int rdpmc_interception(struct vcpu_svm *svm) | 3881 | static int rdpmc_interception(struct vcpu_svm *svm) |
@@ -4700,7 +4700,7 @@ static int avic_unaccelerated_access_interception(struct vcpu_svm *svm) | |||
4700 | ret = avic_unaccel_trap_write(svm); | 4700 | ret = avic_unaccel_trap_write(svm); |
4701 | } else { | 4701 | } else { |
4702 | /* Handling Fault */ | 4702 | /* Handling Fault */ |
4703 | ret = (emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE); | 4703 | ret = (kvm_emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE); |
4704 | } | 4704 | } |
4705 | 4705 | ||
4706 | return ret; | 4706 | return ret; |
@@ -6747,7 +6747,7 @@ e_free: | |||
6747 | static int sev_dbg_crypt(struct kvm *kvm, struct kvm_sev_cmd *argp, bool dec) | 6747 | static int sev_dbg_crypt(struct kvm *kvm, struct kvm_sev_cmd *argp, bool dec) |
6748 | { | 6748 | { |
6749 | unsigned long vaddr, vaddr_end, next_vaddr; | 6749 | unsigned long vaddr, vaddr_end, next_vaddr; |
6750 | unsigned long dst_vaddr, dst_vaddr_end; | 6750 | unsigned long dst_vaddr; |
6751 | struct page **src_p, **dst_p; | 6751 | struct page **src_p, **dst_p; |
6752 | struct kvm_sev_dbg debug; | 6752 | struct kvm_sev_dbg debug; |
6753 | unsigned long n; | 6753 | unsigned long n; |
@@ -6763,7 +6763,6 @@ static int sev_dbg_crypt(struct kvm *kvm, struct kvm_sev_cmd *argp, bool dec) | |||
6763 | size = debug.len; | 6763 | size = debug.len; |
6764 | vaddr_end = vaddr + size; | 6764 | vaddr_end = vaddr + size; |
6765 | dst_vaddr = debug.dst_uaddr; | 6765 | dst_vaddr = debug.dst_uaddr; |
6766 | dst_vaddr_end = dst_vaddr + size; | ||
6767 | 6766 | ||
6768 | for (; vaddr < vaddr_end; vaddr = next_vaddr) { | 6767 | for (; vaddr < vaddr_end; vaddr = next_vaddr) { |
6769 | int len, s_off, d_off; | 6768 | int len, s_off, d_off; |