Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: s390: vsie: Allow non-zarch guests

Linux/KVM runs in z/Architecture-only mode. Although z/Architecture
is built upon a long history of hardware refinements, any other
CPU mode is not permitted.

Allow a userspace to explicitly enable the use of ESA mode for
nested guests, otherwise usage will be rejected.

Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>

authored by

Eric Farman and committed by
Janosch Frank
b0ad874d 1653545a

+6 -3
+1
arch/s390/include/asm/kvm_host.h
··· 656 656 int user_stsi; 657 657 int user_instr0; 658 658 int user_operexec; 659 + int allow_vsie_esamode; 659 660 struct s390_io_adapter *adapters[MAX_S390_IO_ADAPTERS]; 660 661 wait_queue_head_t ipte_wq; 661 662 int ipte_lock_count;
+5 -3
arch/s390/kvm/vsie.c
··· 125 125 struct kvm_s390_sie_block *scb_o = vsie_page->scb_o; 126 126 int newflags, cpuflags = atomic_read(&scb_o->cpuflags); 127 127 128 - /* we don't allow ESA/390 guests */ 129 - if (!(cpuflags & CPUSTAT_ZARCH)) 128 + /* we don't allow ESA/390 guests unless explicitly enabled */ 129 + if (!(cpuflags & CPUSTAT_ZARCH) && !vcpu->kvm->arch.allow_vsie_esamode) 130 130 return set_validity_icpt(scb_s, 0x0001U); 131 131 132 132 if (cpuflags & (CPUSTAT_RRF | CPUSTAT_MCDS)) ··· 135 135 return set_validity_icpt(scb_s, 0x0007U); 136 136 137 137 /* intervention requests will be set later */ 138 - newflags = CPUSTAT_ZARCH; 138 + newflags = 0; 139 + if (cpuflags & CPUSTAT_ZARCH) 140 + newflags = CPUSTAT_ZARCH; 139 141 if (cpuflags & CPUSTAT_GED && test_kvm_facility(vcpu->kvm, 8)) 140 142 newflags |= CPUSTAT_GED; 141 143 if (cpuflags & CPUSTAT_GED2 && test_kvm_facility(vcpu->kvm, 78)) {