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=1796403975; b=MbnOfjxpRs2E45BFDKBG7e6UmmJEyC/ruAyUKCDAesgg+aPxHXa8gKQVZCMNlQNH1JbS eZ6XVHdly1YN3o9Zqv3Nl4yKDKnQvzlkBfcH5HXmNI19hdkx/W3kDH8qtvssLNCcPtQm6 k1ZK9AshFAe7yhyq3B+hosYc2m/lIvaMGs02CTRxG2o5ZF8cJx887nqxIzfOM6bKoPnBy Y17NjawKLFijnhKon9IFEngouuyuzLSfbqNFtYj1da+rW6VJZfxS1lZh763nwavadhQ/8 eAcKnm3MBpyJgU/8JkPqrfZgY9qyY7hULK5dzAy492eX+eZ7LxK6F2q6oPqo7rYRKxA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796403975; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=wyQWLkto62Dr0KjQIKXOdq1LYmv/8kbGwcb0+R8IjrU=; b=saaxaPXIAQDapWDD7mu9zRGwGS65EaPfQw7Xt050koZeGhWjWA3Kr5QGF8clf8GRnoBi CZ/zMFCj4ZcZVFJJWRwB0CLYDtxVYI/HpGJBp2coE7a311E9gvFLC3X4jIsNwJl1o40wa MDB9RYHfJYd5qR7Z+vaPJVkT1rvrqoH/ox+njNxNJKnOkRTLm+qHmT9Y03EvB7vp/B84P T+8pItP/zJ0W2Ztd057otE1KgWFOS263zh9IDczxZzix9kixMWnhrRJcvgDsLams5ykgU XhdteYUwaKxKuSLGuwkyrLg/KUqG13RLUGB49jzH2XuSFWm5WOWnPuqYTQtbTW4KH0g== 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=WZBYomOA; 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 61453606A338; Fri, 4 Dec 2026 17:06:15 +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=WZBYomOA Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82BD81F00A2B; Fri, 4 Dec 2026 17:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796403974; bh=wyQWLkto62Dr0KjQIKXOdq1LYmv/8kbGwcb0+R8IjrU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=WZBYomOACUYCcxSNj7t1SDZ0H81eQkQ0/bQxuofmhdSu6zm2IasV9d89K/nbqGklQ 2T9Cfww+lGl960Ebob3Bzkmk+nlkdfldmkR6YcZLZChNPbkvnCFYzbpK4FbMFFOLlk DWYLgmP0BQQidyW2i0JUl1+IJmp97yjd71Il0/i/Mmv//2HW8xq7Dd9AhoLf/Fbu6s qb6aiYF70XOISTfO3RkT8JJ4d4Q3uO3sup+/fBNqET3Bw8iRg6j8p+h6x43I0I020a 9kCWSLYTycznvnEOW/yWpnbo0MlXbUNPNLb2tZJdG4RzqZRcMn6T/7RhljK1ZCToRW HwLFkmFpD5imw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v1 1/5] KVM: s390: Only allocate page table when cmma is enabled Reply-To: sashiko-reviews@lists.linux.dev To: "Claudio Imbrenda" , kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, "Heiko Carstens" , "Vasily Gorbik" , "Alexander Gordeev" , "Christian Borntraeger" In-Reply-To: <20261204163735.237528-2-imbrenda@linux.ibm.com> References: <20261204163735.237528-1-imbrenda@linux.ibm.com> <20261204163735.237528-2-imbrenda@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 17:06:14 +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 1 potential issue to consider: - [Medium] KVM: s390: missing MMU cache topup on -ENOMEM in kvm_s390_faultin_gfn() -- commit 0d1f3b314bae87061643363aac78552599afc310 Author: Claudio Imbrenda KVM: s390: Only allocate page table when cmma is enabled When a guest-originated fault hits an unallocated segment with CMMA enabled, this commit allocates only the page table instead of also faulting in the backing guest memory. > diff --git a/arch/s390/kvm/gmap/faultin.c b/arch/s390/kvm/gmap/faultin.c > index 2e93bd563d5c3..8d0e86943b23c 100644 > --- a/arch/s390/kvm/gmap/faultin.c > +++ b/arch/s390/kvm/gmap/faultin.c [ ... ] > @@ -67,6 +69,21 @@ int kvm_s390_faultin_gfn(struct kvm_vcpu *vcpu, struct= kvm *kvm, struct guest_fa > mc =3D local_mc; > } > =20 > + /* > + * For guest-originated faults when CMMA is active, if no leaf > + * tables were present, allocate the page table only, do not also > + * fault-in the memory. > + */ > + if (cmm_first_fault) { > + scoped_guard(read_lock, &kvm->mmu_lock) { > + rc =3D dat_entry_walk(mc, f->gfn, kvm->arch.gmap->asce, DAT_WALK_ALLO= C, > + TABLE_TYPE_PAGE_TABLE, &f->crstep, &f->ptep); > + if (!rc) > + return 0; > + } > + } > + > + rc =3D -EAGAIN; > while (rc =3D=3D -EAGAIN) { > f->valid =3D false; > inv_seq =3D kvm->mmu_invalidate_seq; [Severity: Medium] Should this handle -ENOMEM from dat_entry_walk() by calling kvm_s390_mmu_cache_topup(mc) outside mmu_lock and retrying? vcpu->arch.mc only caches 2 page tables and 6 CRST tables, so an ESSA sweep quickly drains it and leaves dat_entry_walk() falling back to GFP_ATOMIC allocations (including order-2 CRST tables). When an atomic allocation fails under memory pressure or fragmentation, falling through to the main loop calls __kvm_faultin_pfn() and faults in the guest backing page (or full huge page) for an ESSA fault before gmap_link() hits -ENOMEM and finally tops up mc. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204163735.2375= 28-1-imbrenda@linux.ibm.com?part=3D1