aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2018-08-23 16:56:52 -0400
committerRadim Krčmář <rkrcmar@redhat.com>2018-08-30 10:20:44 -0400
commit0ce97a2b627c5e26347aee298f571ddf925e5fe4 (patch)
tree52687003208926739cf192d4e1b563767cd4b8c4
parent6c3dfeb6a48b1562bd5b8ec5f3317ef34d0134ef (diff)
KVM: x86: Rename emulate_instruction() to kvm_emulate_instruction()
Lack of the kvm_ prefix gives the impression that it's a VMX or SVM specific function, and there's no conflict that prevents adding the kvm_ prefix. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
-rw-r--r--arch/x86/include/asm/kvm_host.h2
-rw-r--r--arch/x86/kvm/svm.c12
-rw-r--r--arch/x86/kvm/vmx.c16
-rw-r--r--arch/x86/kvm/x86.c4
4 files changed, 17 insertions, 17 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 35e03b13edcb..8c9023661351 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1243,7 +1243,7 @@ enum emulation_result {
1243int x86_emulate_instruction(struct kvm_vcpu *vcpu, unsigned long cr2, 1243int x86_emulate_instruction(struct kvm_vcpu *vcpu, unsigned long cr2,
1244 int emulation_type, void *insn, int insn_len); 1244 int emulation_type, void *insn, int insn_len);
1245 1245
1246static inline int emulate_instruction(struct kvm_vcpu *vcpu, 1246static inline int kvm_emulate_instruction(struct kvm_vcpu *vcpu,
1247 int emulation_type) 1247 int emulation_type)
1248{ 1248{
1249 return x86_emulate_instruction(vcpu, 0, emulation_type, NULL, 0); 1249 return x86_emulate_instruction(vcpu, 0, emulation_type, NULL, 0);
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index b3cdfde8ff5e..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)
3861static int invlpg_interception(struct vcpu_svm *svm) 3861static 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,7 +3869,7 @@ static int invlpg_interception(struct vcpu_svm *svm)
3869 3869
3870static int emulate_on_interception(struct vcpu_svm *svm) 3870static 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
3875static int rsm_interception(struct vcpu_svm *svm) 3875static int rsm_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;
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index b345ad91809c..f910d33858d9 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6983,7 +6983,7 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu,
6983 * Cause the #SS fault with 0 error code in VM86 mode. 6983 * Cause the #SS fault with 0 error code in VM86 mode.
6984 */ 6984 */
6985 if (((vec == GP_VECTOR) || (vec == SS_VECTOR)) && err_code == 0) { 6985 if (((vec == GP_VECTOR) || (vec == SS_VECTOR)) && err_code == 0) {
6986 if (emulate_instruction(vcpu, 0) == EMULATE_DONE) { 6986 if (kvm_emulate_instruction(vcpu, 0) == EMULATE_DONE) {
6987 if (vcpu->arch.halt_request) { 6987 if (vcpu->arch.halt_request) {
6988 vcpu->arch.halt_request = 0; 6988 vcpu->arch.halt_request = 0;
6989 return kvm_vcpu_halt(vcpu); 6989 return kvm_vcpu_halt(vcpu);
@@ -7054,7 +7054,7 @@ static int handle_exception(struct kvm_vcpu *vcpu)
7054 7054
7055 if (!vmx->rmode.vm86_active && is_gp_fault(intr_info)) { 7055 if (!vmx->rmode.vm86_active && is_gp_fault(intr_info)) {
7056 WARN_ON_ONCE(!enable_vmware_backdoor); 7056 WARN_ON_ONCE(!enable_vmware_backdoor);
7057 er = emulate_instruction(vcpu, 7057 er = kvm_emulate_instruction(vcpu,
7058 EMULTYPE_VMWARE | EMULTYPE_NO_UD_ON_FAIL); 7058 EMULTYPE_VMWARE | EMULTYPE_NO_UD_ON_FAIL);
7059 if (er == EMULATE_USER_EXIT) 7059 if (er == EMULATE_USER_EXIT)
7060 return 0; 7060 return 0;
@@ -7157,7 +7157,7 @@ static int handle_io(struct kvm_vcpu *vcpu)
7157 ++vcpu->stat.io_exits; 7157 ++vcpu->stat.io_exits;
7158 7158
7159 if (string) 7159 if (string)
7160 return emulate_instruction(vcpu, 0) == EMULATE_DONE; 7160 return kvm_emulate_instruction(vcpu, 0) == EMULATE_DONE;
7161 7161
7162 port = exit_qualification >> 16; 7162 port = exit_qualification >> 16;
7163 size = (exit_qualification & 7) + 1; 7163 size = (exit_qualification & 7) + 1;
@@ -7231,7 +7231,7 @@ static int handle_set_cr4(struct kvm_vcpu *vcpu, unsigned long val)
7231static int handle_desc(struct kvm_vcpu *vcpu) 7231static int handle_desc(struct kvm_vcpu *vcpu)
7232{ 7232{
7233 WARN_ON(!(vcpu->arch.cr4 & X86_CR4_UMIP)); 7233 WARN_ON(!(vcpu->arch.cr4 & X86_CR4_UMIP));
7234 return emulate_instruction(vcpu, 0) == EMULATE_DONE; 7234 return kvm_emulate_instruction(vcpu, 0) == EMULATE_DONE;
7235} 7235}
7236 7236
7237static int handle_cr(struct kvm_vcpu *vcpu) 7237static int handle_cr(struct kvm_vcpu *vcpu)
@@ -7480,7 +7480,7 @@ static int handle_vmcall(struct kvm_vcpu *vcpu)
7480 7480
7481static int handle_invd(struct kvm_vcpu *vcpu) 7481static int handle_invd(struct kvm_vcpu *vcpu)
7482{ 7482{
7483 return emulate_instruction(vcpu, 0) == EMULATE_DONE; 7483 return kvm_emulate_instruction(vcpu, 0) == EMULATE_DONE;
7484} 7484}
7485 7485
7486static int handle_invlpg(struct kvm_vcpu *vcpu) 7486static int handle_invlpg(struct kvm_vcpu *vcpu)
@@ -7547,7 +7547,7 @@ static int handle_apic_access(struct kvm_vcpu *vcpu)
7547 return kvm_skip_emulated_instruction(vcpu); 7547 return kvm_skip_emulated_instruction(vcpu);
7548 } 7548 }
7549 } 7549 }
7550 return emulate_instruction(vcpu, 0) == EMULATE_DONE; 7550 return kvm_emulate_instruction(vcpu, 0) == EMULATE_DONE;
7551} 7551}
7552 7552
7553static int handle_apic_eoi_induced(struct kvm_vcpu *vcpu) 7553static int handle_apic_eoi_induced(struct kvm_vcpu *vcpu)
@@ -7704,7 +7704,7 @@ static int handle_ept_misconfig(struct kvm_vcpu *vcpu)
7704 if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) 7704 if (!static_cpu_has(X86_FEATURE_HYPERVISOR))
7705 return kvm_skip_emulated_instruction(vcpu); 7705 return kvm_skip_emulated_instruction(vcpu);
7706 else 7706 else
7707 return emulate_instruction(vcpu, EMULTYPE_SKIP) == 7707 return kvm_emulate_instruction(vcpu, EMULTYPE_SKIP) ==
7708 EMULATE_DONE; 7708 EMULATE_DONE;
7709 } 7709 }
7710 7710
@@ -7748,7 +7748,7 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu)
7748 if (kvm_test_request(KVM_REQ_EVENT, vcpu)) 7748 if (kvm_test_request(KVM_REQ_EVENT, vcpu))
7749 return 1; 7749 return 1;
7750 7750
7751 err = emulate_instruction(vcpu, 0); 7751 err = kvm_emulate_instruction(vcpu, 0);
7752 7752
7753 if (err == EMULATE_USER_EXIT) { 7753 if (err == EMULATE_USER_EXIT) {
7754 ++vcpu->stat.mmio_exits; 7754 ++vcpu->stat.mmio_exits;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index cbe2921e972b..915002c7f07e 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4987,7 +4987,7 @@ int handle_ud(struct kvm_vcpu *vcpu)
4987 emul_type = 0; 4987 emul_type = 0;
4988 } 4988 }
4989 4989
4990 er = emulate_instruction(vcpu, emul_type); 4990 er = kvm_emulate_instruction(vcpu, emul_type);
4991 if (er == EMULATE_USER_EXIT) 4991 if (er == EMULATE_USER_EXIT)
4992 return 0; 4992 return 0;
4993 if (er != EMULATE_DONE) 4993 if (er != EMULATE_DONE)
@@ -7740,7 +7740,7 @@ static inline int complete_emulated_io(struct kvm_vcpu *vcpu)
7740{ 7740{
7741 int r; 7741 int r;
7742 vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); 7742 vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
7743 r = emulate_instruction(vcpu, EMULTYPE_NO_DECODE); 7743 r = kvm_emulate_instruction(vcpu, EMULTYPE_NO_DECODE);
7744 srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); 7744 srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
7745 if (r != EMULATE_DONE) 7745 if (r != EMULATE_DONE)
7746 return 0; 7746 return 0;