Message ID | 20240801123109.2782155-1-mimu@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] KVM: s390: fix validity interception issue when gisa is switched off | expand |
On 8/1/24 2:31 PM, Michael Mueller wrote: > We might run into a SIE validity if gisa has been disabled either via using > kernel parameter "kvm.use_gisa=0" or by setting the related sysfs > attribute to N (echo N >/sys/module/kvm/parameters/use_gisa). > > The validity is caused by an invalid value in the SIE control block's > gisa designation. That happens because we pass the uninitialized gisa > origin to virt_to_phys() before writing it to the gisa designation. > > To fix this we return 0 in kvm_s390_get_gisa_desc() if the origin is 0. > kvm_s390_get_gisa_desc() is used to determine which gisa designation to > set in the SIE control block. A value of 0 in the gisa designation disables > gisa usage. > > The issue surfaces in the host kernel with the following kernel message as Reviewed-by: Janosch Frank <frankja@linux.ibm.com> I'm gonna throw this onto the CI in a minute.
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index bf8534218af3..e680c6bf0c9d 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h @@ -267,7 +267,12 @@ static inline unsigned long kvm_s390_get_gfn_end(struct kvm_memslots *slots) static inline u32 kvm_s390_get_gisa_desc(struct kvm *kvm) { - u32 gd = virt_to_phys(kvm->arch.gisa_int.origin); + u32 gd; + + if (!kvm->arch.gisa_int.origin) + return 0; + + gd = virt_to_phys(kvm->arch.gisa_int.origin); if (gd && sclp.has_gisaf) gd |= GISA_FORMAT1;