summaryrefslogtreecommitdiff
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-10-12 17:29:01 +0300
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-11-30 14:47:10 +0300
commiteaa78f343255dabac963ab8c7644367844d18e00 (patch)
treeb4928bcfe8a07b3f0adc13a0aff87ea5938421ea /arch/s390/kvm
parent10ce32d5b07470c5eb0fa821000c789073128b3f (diff)
downloadlinux-eaa78f343255dabac963ab8c7644367844d18e00.tar.xz
KVM: s390: cleanup sca_add_vcpu
Now that we already have kvm and the VCPU id set for the VCPU, we can convert sda_add_vcpu to look much more like sda_del_vcpu. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/kvm-s390.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 7e0092bea6e9..d9d71bb91404 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -1276,27 +1276,26 @@ static void sca_del_vcpu(struct kvm_vcpu *vcpu)
read_unlock(&vcpu->kvm->arch.sca_lock);
}
-static void sca_add_vcpu(struct kvm_vcpu *vcpu, struct kvm *kvm,
- unsigned int id)
+static void sca_add_vcpu(struct kvm_vcpu *vcpu)
{
- read_lock(&kvm->arch.sca_lock);
- if (kvm->arch.use_esca) {
- struct esca_block *sca = kvm->arch.sca;
+ read_lock(&vcpu->kvm->arch.sca_lock);
+ if (vcpu->kvm->arch.use_esca) {
+ struct esca_block *sca = vcpu->kvm->arch.sca;
- sca->cpu[id].sda = (__u64) vcpu->arch.sie_block;
+ sca->cpu[vcpu->vcpu_id].sda = (__u64) vcpu->arch.sie_block;
vcpu->arch.sie_block->scaoh = (__u32)(((__u64)sca) >> 32);
vcpu->arch.sie_block->scaol = (__u32)(__u64)sca & ~0x3fU;
vcpu->arch.sie_block->ecb2 |= 0x04U;
- set_bit_inv(id, (unsigned long *) sca->mcn);
+ set_bit_inv(vcpu->vcpu_id, (unsigned long *) sca->mcn);
} else {
- struct bsca_block *sca = kvm->arch.sca;
+ struct bsca_block *sca = vcpu->kvm->arch.sca;
- sca->cpu[id].sda = (__u64) vcpu->arch.sie_block;
+ sca->cpu[vcpu->vcpu_id].sda = (__u64) vcpu->arch.sie_block;
vcpu->arch.sie_block->scaoh = (__u32)(((__u64)sca) >> 32);
vcpu->arch.sie_block->scaol = (__u32)(__u64)sca;
- set_bit_inv(id, (unsigned long *) &sca->mcn);
+ set_bit_inv(vcpu->vcpu_id, (unsigned long *) &sca->mcn);
}
- read_unlock(&kvm->arch.sca_lock);
+ read_unlock(&vcpu->kvm->arch.sca_lock);
}
/* Basic SCA to Extended SCA data copy routines */
@@ -1492,7 +1491,7 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
mutex_unlock(&vcpu->kvm->lock);
if (!kvm_is_ucontrol(vcpu->kvm)) {
vcpu->arch.gmap = vcpu->kvm->arch.gmap;
- sca_add_vcpu(vcpu, vcpu->kvm, vcpu->vcpu_id);
+ sca_add_vcpu(vcpu);
}
}