Commit fc34531db3cf8c422f2ff7cf4ef507a3ca672cd2

Authored by Christian Borntraeger
Committed by Avi Kivity
1 parent 971eb77f87

KVM: s390: Don't exit SIE on SIGP sense running

Newer (guest) kernels use sigp sense running in their spinlock
implementation to check if the other cpu is running before yielding
the processor. This revealed some wrong guest settings, causing
unnecessary exits for every sigp sense running.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

Showing 2 changed files with 4 additions and 2 deletions Side-by-side Diff

arch/s390/include/asm/kvm_host.h
... ... @@ -26,7 +26,7 @@
26 26  
27 27 struct sca_entry {
28 28 atomic_t scn;
29   - __u64 reserved;
  29 + __u32 reserved;
30 30 __u64 sda;
31 31 __u64 reserved2[2];
32 32 } __attribute__((packed));
arch/s390/kvm/kvm-s390.c
... ... @@ -207,6 +207,7 @@
207 207 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
208 208 {
209 209 VCPU_EVENT(vcpu, 3, "%s", "free cpu");
  210 + clear_bit(63 - vcpu->vcpu_id, (unsigned long *) &vcpu->kvm->arch.sca->mcn);
210 211 if (vcpu->kvm->arch.sca->cpu[vcpu->vcpu_id].sda ==
211 212 (__u64) vcpu->arch.sie_block)
212 213 vcpu->kvm->arch.sca->cpu[vcpu->vcpu_id].sda = 0;
... ... @@ -296,7 +297,7 @@
296 297 {
297 298 atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH);
298 299 set_bit(KVM_REQ_MMU_RELOAD, &vcpu->requests);
299   - vcpu->arch.sie_block->ecb = 2;
  300 + vcpu->arch.sie_block->ecb = 6;
300 301 vcpu->arch.sie_block->eca = 0xC1002001U;
301 302 vcpu->arch.sie_block->fac = (int) (long) facilities;
302 303 hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
... ... @@ -329,6 +330,7 @@
329 330 kvm->arch.sca->cpu[id].sda = (__u64) vcpu->arch.sie_block;
330 331 vcpu->arch.sie_block->scaoh = (__u32)(((__u64)kvm->arch.sca) >> 32);
331 332 vcpu->arch.sie_block->scaol = (__u32)(__u64)kvm->arch.sca;
  333 + set_bit(63 - id, (unsigned long *) &kvm->arch.sca->mcn);
332 334  
333 335 spin_lock_init(&vcpu->arch.local_int.lock);
334 336 INIT_LIST_HEAD(&vcpu->arch.local_int.list);