Re: [PATCH] KVM: s390: fix validity interception issue when gisa is switched off

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/31/24 1:31 PM, Michael Mueller wrote:
The following validity interception occures when the gisa usage has been
switched off either by 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 issue surfaces in the host kernel with the following kernel message as
soon a new kvm guest start has been attemted.

How about:

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.


Cc: stable@xxxxxxxxxxxxxxx
Reported-by: Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>

Closes: https://ibm-systems-z.slack.com/archives/C04BWBXSKEY/p1722280755665409

I'd just remove that since it's not accessible for people outside of IBM. Yes, checkpatch will complain but in this case it's ok to ignore that.

Fixes: fe0ef0030463 ("KVM: s390: sort out physical vs virtual pointers usage")
Signed-off-by: Michael Mueller <mimu@xxxxxxxxxxxxx>
---
  arch/s390/kvm/kvm-s390.h | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

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;





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux