From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796222148; b=tBrbRf+QWCwZphlqK/Tt8emZUzycy1/KNp0OjIDDrheXWWR9fPBKvomgLFkmsl9s9vDY M0kiZv/N500bn/1pEFYBsv8G+apxXQKvqvxy3PIlCfoPzDexARMiUXN3mpWQ3ySXTn/7t ZJpgb1W/X5464775HKEHXmUp3VaWcudXsucMVm5YwAVEg1a1L7wbCkZoSLehhSrmf3a0N lSRocWDo4SDHxCc3jAsGCzXz6Q9YZ+AmO0pLGHp+mIV/KA4deV7PcV8ZrAi1wX7uFS1CK UmqgnTS7H42r02f/azblvWEWzcuSBP0/QL4CxywAKoAEl/29lnf0cOjEwVb9QBCSJJA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796222148; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Rf3Kbv770zz/uob4cfyu+A1ocUzaS6Dtpr5Fxzur1/s=; b=jgjxcCe9mHBtQFowKyJ8sDmWPiNQIfGlZzmH8J3TQsyNpED5CBQCrYEkOMaRtttFVIHK sX1yAQkKw4MfHB/9fS3hP8737LsLzEykpctDCm4IMIkdRUrHtoAzELq+UBULArPsKee4l JxG6xQDs+qmOC6nT/KOt3MYy9TXJbO71Ouc2IDMBfya2IoBKKbEJ45zyGFe/ysQhcebL+ 9A6NRXuAoi7on00nNnnNUJ3o3mxBFTel/jXPBK4IxV3J5DgHVAlJ5hneVJxkFGFEoSi2q nBSxrRHuO2N6N7tAmvJnY8XRTp/rKF40eBa/KkqL2trarVzwxDu2kj9bIfHQF9FLQ1Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ExYAw3Ua; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FE05606A31A; Wed, 2 Dec 2026 14:35:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ExYAw3Ua Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACFA81F00893; Wed, 2 Dec 2026 14:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796222148; bh=Rf3Kbv770zz/uob4cfyu+A1ocUzaS6Dtpr5Fxzur1/s=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ExYAw3Ua9NCpL0PQsvVKg01e0cB2eWbcxluEbvF9M8i0sOtHT3ligT6Hu6Ss8/9Gs VEO3bzWhp3uqrYgRSug2AYjStk6iSs4fmzMNi1gjjyvdavqOrTuuv+PD4D0VD38MPV On4xl77H15G9JyZtkNlP4VKrwOBrulL8X6jm/dE7IOxF1prfJvgKyiKeQwooatUFx0 kCJShJtzKT3isPKm5n/deSYFYMR/To1Ob7z6WTFQrWasy84tF2T9zgcMGZUTNV3AuK dej/HAkOJNE6CDgq2RG3LpZYWEBxn3kRndrqrlXr/CmO2smLSBt//vcoWLO4D2fTNA 9aaE/i93/Nw+w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 07/12] KVM: s390: arm64: Enable full smccc support Reply-To: sashiko-reviews@lists.linux.dev To: "Steffen Eiden" Cc: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-s390@vger.kernel.org, "Oliver Upton" , "Marc Zyngier" , "Heiko Carstens" , "Vasily Gorbik" , "Alexander Gordeev" , "Christian Borntraeger" In-Reply-To: <20261202-smccc-v1-7-48340e2737b6@linux.ibm.com> References: <20261202-smccc-v1-0-48340e2737b6@linux.ibm.com> <20261202-smccc-v1-7-48340e2737b6@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 14:35:47 +0000 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] KVM: s390: arm64: unclamped kvm->max_vcpus in kvm_arch_init_vm() - [Low] KVM: s390: arm64: misplaced case blocks in kvm_arch_vm_ioctl() -- commit 531ac05785ece0e3573d8628fd57758de85eef37 Author: Steffen Eiden KVM: s390: arm64: Enable full smccc support This commit enables SMCCC, PSCI, PV time, and TRNG support for arm64 guests on s390 by wiring up the shared arm64 hypercall handling code. > diff --git a/arch/s390/kvm/arm64/arm.c b/arch/s390/kvm/arm64/arm.c > index 483f29665524f..7212ea1fc1419 100644 > --- a/arch/s390/kvm/arm64/arm.c > +++ b/arch/s390/kvm/arm64/arm.c > @@ -44,7 +46,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long = ext) > case KVM_CAP_NR_VCPUS: > case KVM_CAP_MAX_VCPUS: > case KVM_CAP_MAX_VCPU_ID: > - ret =3D KVM_MAX_VCPUS; > + ret =3D min(kvm_sae_max_vcpus(), KVM_MAX_VCPUS); > break; [ ... ] > @@ -154,6 +161,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long t= ype) > =20 > kvm->arch.epd =3D ptff_qagto(0); > =20 > + kvm_arm_init_hypercalls(kvm); > + > VM_EVENT(kvm, 3, "vm created with type %lu", type); > return 0; > =20 > @@ -180,6 +189,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) > kvm_destroy_vcpus(kvm); > debug_unregister(kvm->arch.dbf); > kvm->arch.gmap =3D gmap_put(kvm->arch.gmap); > + kvm_arm_teardown_hypercalls(kvm); > } > =20 > u32 get_kvm_ipa_limit(void) > @@ -189,6 +199,9 @@ u32 get_kvm_ipa_limit(void) > =20 > int kvm_arch_vcpu_precreate(struct kvm *kvm, unsigned int id) > { > + if (id >=3D kvm->max_vcpus) > + return -EINVAL; > + > return 0; > } [Severity: Medium] Should kvm_arch_init_vm() clamp kvm->max_vcpus to min(kvm_sae_max_vcpus(), KVM_MAX_VCPUS)? kvm_create_vm() initializes kvm->max_vcpus to KVM_MAX_VCPUS (now 8) before calling kvm_arch_init_vm(). Because kvm_arch_init_vm() never updates kvm->max_vcpus, both kvm_vm_ioctl_create_vcpu() and kvm_arch_vcpu_precreate() check against 8 instead of the hardware limit reported by kvm_sae_max_vcpus(), allowing userspace to create vCPUs past the hardware limit on systems where kvm_sae_max_vcpus() < 8. [ ... ] > @@ -799,6 +856,19 @@ int kvm_arch_vm_ioctl(struct file *filp, unsigned in= t ioctl, unsigned long arg) > return -EFAULT; > =20 > return 0; > + case KVM_HAS_DEVICE_ATTR: { > + if (copy_from_user(&attr, argp, sizeof(attr))) > + return -EFAULT; > + > + return kvm_vm_has_attr(kvm, &attr); > + } > + case KVM_SET_DEVICE_ATTR: { > + if (copy_from_user(&attr, argp, sizeof(attr))) > + return -EFAULT; > + > + return kvm_vm_set_attr(kvm, &attr); > + } > + > } > =20 > default: [Severity: Low] This isn't a bug, but case KVM_HAS_DEVICE_ATTR and case KVM_SET_DEVICE_ATTR are placed inside the compound block opened by case KVM_ARM_PREFERRED_TARGET, jumping into the scope of init rather than after the closing brace of KVM_ARM_PREFERRED_TARGET. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-smccc-v1-0= -48340e2737b6@linux.ibm.com?part=3D7