Commit 10ce32d5 authored by David Hildenbrand's avatar David Hildenbrand Committed by Christian Borntraeger

KVM: s390: always set/clear the SCA sda field

Let's always set and clear the sda when enabling/disabling a VCPU.
Dealing with sda being set to something else makes no sense anymore
as we enable a VCPU in the SCA now after it has been registered at
the VM.
Signed-off-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 25508824
...@@ -1266,13 +1266,11 @@ static void sca_del_vcpu(struct kvm_vcpu *vcpu) ...@@ -1266,13 +1266,11 @@ static void sca_del_vcpu(struct kvm_vcpu *vcpu)
struct esca_block *sca = vcpu->kvm->arch.sca; struct esca_block *sca = vcpu->kvm->arch.sca;
clear_bit_inv(vcpu->vcpu_id, (unsigned long *) sca->mcn); clear_bit_inv(vcpu->vcpu_id, (unsigned long *) sca->mcn);
if (sca->cpu[vcpu->vcpu_id].sda == (__u64) vcpu->arch.sie_block)
sca->cpu[vcpu->vcpu_id].sda = 0; sca->cpu[vcpu->vcpu_id].sda = 0;
} else { } else {
struct bsca_block *sca = vcpu->kvm->arch.sca; struct bsca_block *sca = vcpu->kvm->arch.sca;
clear_bit_inv(vcpu->vcpu_id, (unsigned long *) &sca->mcn); clear_bit_inv(vcpu->vcpu_id, (unsigned long *) &sca->mcn);
if (sca->cpu[vcpu->vcpu_id].sda == (__u64) vcpu->arch.sie_block)
sca->cpu[vcpu->vcpu_id].sda = 0; sca->cpu[vcpu->vcpu_id].sda = 0;
} }
read_unlock(&vcpu->kvm->arch.sca_lock); read_unlock(&vcpu->kvm->arch.sca_lock);
...@@ -1285,7 +1283,6 @@ static void sca_add_vcpu(struct kvm_vcpu *vcpu, struct kvm *kvm, ...@@ -1285,7 +1283,6 @@ static void sca_add_vcpu(struct kvm_vcpu *vcpu, struct kvm *kvm,
if (kvm->arch.use_esca) { if (kvm->arch.use_esca) {
struct esca_block *sca = kvm->arch.sca; struct esca_block *sca = kvm->arch.sca;
if (!sca->cpu[id].sda)
sca->cpu[id].sda = (__u64) vcpu->arch.sie_block; sca->cpu[id].sda = (__u64) vcpu->arch.sie_block;
vcpu->arch.sie_block->scaoh = (__u32)(((__u64)sca) >> 32); vcpu->arch.sie_block->scaoh = (__u32)(((__u64)sca) >> 32);
vcpu->arch.sie_block->scaol = (__u32)(__u64)sca & ~0x3fU; vcpu->arch.sie_block->scaol = (__u32)(__u64)sca & ~0x3fU;
...@@ -1294,7 +1291,6 @@ static void sca_add_vcpu(struct kvm_vcpu *vcpu, struct kvm *kvm, ...@@ -1294,7 +1291,6 @@ static void sca_add_vcpu(struct kvm_vcpu *vcpu, struct kvm *kvm,
} else { } else {
struct bsca_block *sca = kvm->arch.sca; struct bsca_block *sca = kvm->arch.sca;
if (!sca->cpu[id].sda)
sca->cpu[id].sda = (__u64) vcpu->arch.sie_block; sca->cpu[id].sda = (__u64) vcpu->arch.sie_block;
vcpu->arch.sie_block->scaoh = (__u32)(((__u64)sca) >> 32); vcpu->arch.sie_block->scaoh = (__u32)(((__u64)sca) >> 32);
vcpu->arch.sie_block->scaol = (__u32)(__u64)sca; vcpu->arch.sie_block->scaol = (__u32)(__u64)sca;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment