aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWanpeng Li <wanpeng.li@hotmail.com>2017-07-13 21:30:39 -0400
committerRadim Krčmář <rkrcmar@redhat.com>2017-07-14 08:24:28 -0400
commitcfcd20e5caad6ba552978c16ed8bed7edb0143cf (patch)
tree0c16071fdf5bc12870cb7496ed13d8315bac8568
parentefc479e6900c22bad9a2b649d13405ed9cde2d53 (diff)
KVM: x86: Simplify kvm_x86_ops->queue_exception parameter list
This patch removes all arguments except the first in kvm_x86_ops->queue_exception since they can extract the arguments from vcpu->arch.exception themselves. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
-rw-r--r--arch/x86/include/asm/kvm_host.h4
-rw-r--r--arch/x86/kvm/svm.c8
-rw-r--r--arch/x86/kvm/vmx.c8
-rw-r--r--arch/x86/kvm/x86.c5
4 files changed, 12 insertions, 13 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 9d8de5dd7546..8d11ddcb0dbf 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -954,9 +954,7 @@ struct kvm_x86_ops {
954 unsigned char *hypercall_addr); 954 unsigned char *hypercall_addr);
955 void (*set_irq)(struct kvm_vcpu *vcpu); 955 void (*set_irq)(struct kvm_vcpu *vcpu);
956 void (*set_nmi)(struct kvm_vcpu *vcpu); 956 void (*set_nmi)(struct kvm_vcpu *vcpu);
957 void (*queue_exception)(struct kvm_vcpu *vcpu, unsigned nr, 957 void (*queue_exception)(struct kvm_vcpu *vcpu);
958 bool has_error_code, u32 error_code,
959 bool reinject);
960 void (*cancel_injection)(struct kvm_vcpu *vcpu); 958 void (*cancel_injection)(struct kvm_vcpu *vcpu);
961 int (*interrupt_allowed)(struct kvm_vcpu *vcpu); 959 int (*interrupt_allowed)(struct kvm_vcpu *vcpu);
962 int (*nmi_allowed)(struct kvm_vcpu *vcpu); 960 int (*nmi_allowed)(struct kvm_vcpu *vcpu);
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 4c98d362e3e4..cde756a02b1a 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -637,11 +637,13 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
637 svm_set_interrupt_shadow(vcpu, 0); 637 svm_set_interrupt_shadow(vcpu, 0);
638} 638}
639 639
640static void svm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr, 640static void svm_queue_exception(struct kvm_vcpu *vcpu)
641 bool has_error_code, u32 error_code,
642 bool reinject)
643{ 641{
644 struct vcpu_svm *svm = to_svm(vcpu); 642 struct vcpu_svm *svm = to_svm(vcpu);
643 unsigned nr = vcpu->arch.exception.nr;
644 bool has_error_code = vcpu->arch.exception.has_error_code;
645 bool reinject = vcpu->arch.exception.reinject;
646 u32 error_code = vcpu->arch.exception.error_code;
645 647
646 /* 648 /*
647 * If we are within a nested VM we'd better #VMEXIT and let the guest 649 * If we are within a nested VM we'd better #VMEXIT and let the guest
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 25f2fdccf625..69cc228436ea 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2435,11 +2435,13 @@ static int nested_vmx_check_exception(struct kvm_vcpu *vcpu, unsigned nr)
2435 return 1; 2435 return 1;
2436} 2436}
2437 2437
2438static void vmx_queue_exception(struct kvm_vcpu *vcpu, unsigned nr, 2438static void vmx_queue_exception(struct kvm_vcpu *vcpu)
2439 bool has_error_code, u32 error_code,
2440 bool reinject)
2441{ 2439{
2442 struct vcpu_vmx *vmx = to_vmx(vcpu); 2440 struct vcpu_vmx *vmx = to_vmx(vcpu);
2441 unsigned nr = vcpu->arch.exception.nr;
2442 bool has_error_code = vcpu->arch.exception.has_error_code;
2443 bool reinject = vcpu->arch.exception.reinject;
2444 u32 error_code = vcpu->arch.exception.error_code;
2443 u32 intr_info = nr | INTR_INFO_VALID_MASK; 2445 u32 intr_info = nr | INTR_INFO_VALID_MASK;
2444 2446
2445 if (!reinject && is_guest_mode(vcpu) && 2447 if (!reinject && is_guest_mode(vcpu) &&
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4f41c5222ecd..e149c92476f1 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6356,10 +6356,7 @@ static int inject_pending_event(struct kvm_vcpu *vcpu, bool req_int_win)
6356 kvm_update_dr7(vcpu); 6356 kvm_update_dr7(vcpu);
6357 } 6357 }
6358 6358
6359 kvm_x86_ops->queue_exception(vcpu, vcpu->arch.exception.nr, 6359 kvm_x86_ops->queue_exception(vcpu);
6360 vcpu->arch.exception.has_error_code,
6361 vcpu->arch.exception.error_code,
6362 vcpu->arch.exception.reinject);
6363 return 0; 6360 return 0;
6364 } 6361 }
6365 6362