diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2013-03-12 05:20:24 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-03-12 07:25:56 -0400 |
commit | 57f252f22908535e04d520f3833a6e3116eb159d (patch) | |
tree | 144fe55ee05d9334c3bea99581763630914ea463 /arch | |
parent | 03ba32cae66e3798d697e582633af2c7dd6907e5 (diff) |
KVM: x86: Drop unused return code from VCPU reset callback
Neither vmx nor svm nor the common part may generate an error on
kvm_vcpu_reset. So drop the return code.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 2 | ||||
-rw-r--r-- | arch/x86/kvm/svm.c | 4 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 7 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 15 |
4 files changed, 9 insertions, 19 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 635a74d22409..348d85965ead 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -643,7 +643,7 @@ struct kvm_x86_ops { | |||
643 | /* Create, but do not attach this VCPU */ | 643 | /* Create, but do not attach this VCPU */ |
644 | struct kvm_vcpu *(*vcpu_create)(struct kvm *kvm, unsigned id); | 644 | struct kvm_vcpu *(*vcpu_create)(struct kvm *kvm, unsigned id); |
645 | void (*vcpu_free)(struct kvm_vcpu *vcpu); | 645 | void (*vcpu_free)(struct kvm_vcpu *vcpu); |
646 | int (*vcpu_reset)(struct kvm_vcpu *vcpu); | 646 | void (*vcpu_reset)(struct kvm_vcpu *vcpu); |
647 | 647 | ||
648 | void (*prepare_guest_switch)(struct kvm_vcpu *vcpu); | 648 | void (*prepare_guest_switch)(struct kvm_vcpu *vcpu); |
649 | void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu); | 649 | void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu); |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index e1b1ce21bc00..907e4280116d 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1191,7 +1191,7 @@ static void init_vmcb(struct vcpu_svm *svm) | |||
1191 | enable_gif(svm); | 1191 | enable_gif(svm); |
1192 | } | 1192 | } |
1193 | 1193 | ||
1194 | static int svm_vcpu_reset(struct kvm_vcpu *vcpu) | 1194 | static void svm_vcpu_reset(struct kvm_vcpu *vcpu) |
1195 | { | 1195 | { |
1196 | struct vcpu_svm *svm = to_svm(vcpu); | 1196 | struct vcpu_svm *svm = to_svm(vcpu); |
1197 | u32 dummy; | 1197 | u32 dummy; |
@@ -1207,8 +1207,6 @@ static int svm_vcpu_reset(struct kvm_vcpu *vcpu) | |||
1207 | 1207 | ||
1208 | kvm_cpuid(vcpu, &eax, &dummy, &dummy, &dummy); | 1208 | kvm_cpuid(vcpu, &eax, &dummy, &dummy, &dummy); |
1209 | kvm_register_write(vcpu, VCPU_REGS_RDX, eax); | 1209 | kvm_register_write(vcpu, VCPU_REGS_RDX, eax); |
1210 | |||
1211 | return 0; | ||
1212 | } | 1210 | } |
1213 | 1211 | ||
1214 | static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) | 1212 | static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 473a5fe7e006..f588171be177 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -4100,11 +4100,10 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) | |||
4100 | return 0; | 4100 | return 0; |
4101 | } | 4101 | } |
4102 | 4102 | ||
4103 | static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) | 4103 | static void vmx_vcpu_reset(struct kvm_vcpu *vcpu) |
4104 | { | 4104 | { |
4105 | struct vcpu_vmx *vmx = to_vmx(vcpu); | 4105 | struct vcpu_vmx *vmx = to_vmx(vcpu); |
4106 | u64 msr; | 4106 | u64 msr; |
4107 | int ret; | ||
4108 | 4107 | ||
4109 | vmx->rmode.vm86_active = 0; | 4108 | vmx->rmode.vm86_active = 0; |
4110 | 4109 | ||
@@ -4195,10 +4194,6 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) | |||
4195 | update_exception_bitmap(&vmx->vcpu); | 4194 | update_exception_bitmap(&vmx->vcpu); |
4196 | 4195 | ||
4197 | vpid_sync_context(vmx); | 4196 | vpid_sync_context(vmx); |
4198 | |||
4199 | ret = 0; | ||
4200 | |||
4201 | return ret; | ||
4202 | } | 4197 | } |
4203 | 4198 | ||
4204 | /* | 4199 | /* |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index b67985af1753..fadd5a750476 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -162,7 +162,7 @@ u64 __read_mostly host_xcr0; | |||
162 | 162 | ||
163 | static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt); | 163 | static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt); |
164 | 164 | ||
165 | static int kvm_vcpu_reset(struct kvm_vcpu *vcpu); | 165 | static void kvm_vcpu_reset(struct kvm_vcpu *vcpu); |
166 | 166 | ||
167 | static inline void kvm_async_pf_hash_reset(struct kvm_vcpu *vcpu) | 167 | static inline void kvm_async_pf_hash_reset(struct kvm_vcpu *vcpu) |
168 | { | 168 | { |
@@ -5858,9 +5858,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu) | |||
5858 | pr_debug("vcpu %d received sipi with vector # %x\n", | 5858 | pr_debug("vcpu %d received sipi with vector # %x\n", |
5859 | vcpu->vcpu_id, vcpu->arch.sipi_vector); | 5859 | vcpu->vcpu_id, vcpu->arch.sipi_vector); |
5860 | kvm_lapic_reset(vcpu); | 5860 | kvm_lapic_reset(vcpu); |
5861 | r = kvm_vcpu_reset(vcpu); | 5861 | kvm_vcpu_reset(vcpu); |
5862 | if (r) | ||
5863 | return r; | ||
5864 | vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; | 5862 | vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; |
5865 | } | 5863 | } |
5866 | 5864 | ||
@@ -6486,9 +6484,8 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | |||
6486 | r = vcpu_load(vcpu); | 6484 | r = vcpu_load(vcpu); |
6487 | if (r) | 6485 | if (r) |
6488 | return r; | 6486 | return r; |
6489 | r = kvm_vcpu_reset(vcpu); | 6487 | kvm_vcpu_reset(vcpu); |
6490 | if (r == 0) | 6488 | r = kvm_mmu_setup(vcpu); |
6491 | r = kvm_mmu_setup(vcpu); | ||
6492 | vcpu_put(vcpu); | 6489 | vcpu_put(vcpu); |
6493 | 6490 | ||
6494 | return r; | 6491 | return r; |
@@ -6525,7 +6522,7 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) | |||
6525 | kvm_x86_ops->vcpu_free(vcpu); | 6522 | kvm_x86_ops->vcpu_free(vcpu); |
6526 | } | 6523 | } |
6527 | 6524 | ||
6528 | static int kvm_vcpu_reset(struct kvm_vcpu *vcpu) | 6525 | static void kvm_vcpu_reset(struct kvm_vcpu *vcpu) |
6529 | { | 6526 | { |
6530 | atomic_set(&vcpu->arch.nmi_queued, 0); | 6527 | atomic_set(&vcpu->arch.nmi_queued, 0); |
6531 | vcpu->arch.nmi_pending = 0; | 6528 | vcpu->arch.nmi_pending = 0; |
@@ -6552,7 +6549,7 @@ static int kvm_vcpu_reset(struct kvm_vcpu *vcpu) | |||
6552 | vcpu->arch.regs_avail = ~0; | 6549 | vcpu->arch.regs_avail = ~0; |
6553 | vcpu->arch.regs_dirty = ~0; | 6550 | vcpu->arch.regs_dirty = ~0; |
6554 | 6551 | ||
6555 | return kvm_x86_ops->vcpu_reset(vcpu); | 6552 | kvm_x86_ops->vcpu_reset(vcpu); |
6556 | } | 6553 | } |
6557 | 6554 | ||
6558 | int kvm_arch_hardware_enable(void *garbage) | 6555 | int kvm_arch_hardware_enable(void *garbage) |