diff options
author | Dominik Dingel <dingel@linux.vnet.ibm.com> | 2014-03-10 10:23:34 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-03-17 06:06:45 -0400 |
commit | fed495d25e0137028c37678a14cd1d8466c02dd3 (patch) | |
tree | 24ecbc821ab62da7ad4965f154e2c6720bcc91d7 /arch/s390/kvm | |
parent | 8fbb1daf3e8254afc17fc4490b69db00920197ae (diff) |
KVM: s390: Removing untriggerable BUG_ONs
The BUG_ON in kvm-s390.c is unreachable, as we get the vcpu per common code,
which itself does this from the private_data field of the file descriptor,
and there is no KVM_UNCREATE_VCPU.
The __{set,unset}_cpu_idle BUG_ONs are not triggerable because the vcpu
creation code already checks against KVM_MAX_VCPUS.
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r-- | arch/s390/kvm/interrupt.c | 2 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 1d0f9d532c0b..79d2e4fa9f9c 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c | |||
@@ -114,14 +114,12 @@ static int __interrupt_is_deliverable(struct kvm_vcpu *vcpu, | |||
114 | 114 | ||
115 | static void __set_cpu_idle(struct kvm_vcpu *vcpu) | 115 | static void __set_cpu_idle(struct kvm_vcpu *vcpu) |
116 | { | 116 | { |
117 | BUG_ON(vcpu->vcpu_id > KVM_MAX_VCPUS - 1); | ||
118 | atomic_set_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags); | 117 | atomic_set_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags); |
119 | set_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask); | 118 | set_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask); |
120 | } | 119 | } |
121 | 120 | ||
122 | static void __unset_cpu_idle(struct kvm_vcpu *vcpu) | 121 | static void __unset_cpu_idle(struct kvm_vcpu *vcpu) |
123 | { | 122 | { |
124 | BUG_ON(vcpu->vcpu_id > KVM_MAX_VCPUS - 1); | ||
125 | atomic_clear_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags); | 123 | atomic_clear_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags); |
126 | clear_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask); | 124 | clear_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask); |
127 | } | 125 | } |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 9136f8d40850..62683576f8e2 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -949,8 +949,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
949 | 949 | ||
950 | atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags); | 950 | atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags); |
951 | 951 | ||
952 | BUG_ON(kvm_get_vcpu(vcpu->kvm, vcpu->vcpu_id) == NULL); | ||
953 | |||
954 | switch (kvm_run->exit_reason) { | 952 | switch (kvm_run->exit_reason) { |
955 | case KVM_EXIT_S390_SIEIC: | 953 | case KVM_EXIT_S390_SIEIC: |
956 | case KVM_EXIT_UNKNOWN: | 954 | case KVM_EXIT_UNKNOWN: |