aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/interrupt.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-08-08 16:39:32 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-09-08 07:40:53 -0400
commita6940674c384ebf56aa0c44f417032de2b67100c (patch)
tree2050fc6d85844310c17ff7d240c692d3682a2592 /arch/s390/kvm/interrupt.c
parent80cd8763388b52fa9129cbb4b57a3615a55afd40 (diff)
KVM: s390: allow 255 VCPUs when sca entries aren't used
If the SCA entries aren't used by the hardware (no SIGPIF), we can simply not set the entries, stick to the basic sca and allow more than 64 VCPUs. To hinder any other facility from using these entries, let's properly provoke intercepts by not setting the MCN and keeping the entries unset. This effectively allows when running KVM under KVM (vSIE) or under z/VM to provide more than 64 VCPUs to a guest. Let's limit it to 255 for now, to not run into problems if the CPU numbers are limited somewhere else. 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/interrupt.c')
-rw-r--r--arch/s390/kvm/interrupt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 353e0b78e667..be4db07f70d3 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -42,6 +42,7 @@ static int sca_ext_call_pending(struct kvm_vcpu *vcpu, int *src_id)
42 if (!(atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_ECALL_PEND)) 42 if (!(atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_ECALL_PEND))
43 return 0; 43 return 0;
44 44
45 BUG_ON(!kvm_s390_use_sca_entries());
45 read_lock(&vcpu->kvm->arch.sca_lock); 46 read_lock(&vcpu->kvm->arch.sca_lock);
46 if (vcpu->kvm->arch.use_esca) { 47 if (vcpu->kvm->arch.use_esca) {
47 struct esca_block *sca = vcpu->kvm->arch.sca; 48 struct esca_block *sca = vcpu->kvm->arch.sca;
@@ -70,6 +71,7 @@ static int sca_inject_ext_call(struct kvm_vcpu *vcpu, int src_id)
70{ 71{
71 int expect, rc; 72 int expect, rc;
72 73
74 BUG_ON(!kvm_s390_use_sca_entries());
73 read_lock(&vcpu->kvm->arch.sca_lock); 75 read_lock(&vcpu->kvm->arch.sca_lock);
74 if (vcpu->kvm->arch.use_esca) { 76 if (vcpu->kvm->arch.use_esca) {
75 struct esca_block *sca = vcpu->kvm->arch.sca; 77 struct esca_block *sca = vcpu->kvm->arch.sca;
@@ -111,6 +113,8 @@ static void sca_clear_ext_call(struct kvm_vcpu *vcpu)
111 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; 113 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
112 int rc, expect; 114 int rc, expect;
113 115
116 if (!kvm_s390_use_sca_entries())
117 return;
114 atomic_andnot(CPUSTAT_ECALL_PEND, li->cpuflags); 118 atomic_andnot(CPUSTAT_ECALL_PEND, li->cpuflags);
115 read_lock(&vcpu->kvm->arch.sca_lock); 119 read_lock(&vcpu->kvm->arch.sca_lock);
116 if (vcpu->kvm->arch.use_esca) { 120 if (vcpu->kvm->arch.use_esca) {