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=1796295604; b=YysYJgukvpaL9xA+N3PrDcF3vpq9LZnY1JPmG45N+U9B9LDhcsz1il5l26ggpbcWCMYB NQytxYoJDPC2f7HmSJA0jS9v7yHIggtRcDFKAi5L03IQfBsM+P5tqdOb/qk5IxcbcJ6xc /JJDIoH3gjzxnEvckV4sj6KqQ5Ock5RBsALfYwoMhqMq0Av9aFokixNZtCk2GR9Cy5ymo U1IR6vWy2XZ0PdCQH6Y4WXApG+8n1rgIf8YkuMTQ13tkj3Yz5aFvkqY2uGohENyDvJ1YC EUcaGNOeTHsMDTgZeOKGxXJXJfFo0T2CdRqFB/2loai1vSBWN8p18cNnmchqjNacqAQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796295604; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=+I+vc4DJRPpdD/wZ6UIrQAF0eJU7Lbv9jXrnJvWxBL0=; b=QAzZzIglQO7+Rb2qH3BX1PTXERu2/5u9UczKFfNGtk1vXUHeXylN6IYdm1kHKMHPOKSc IYxZCBgxVt63YzUsMXZS/lTcEsePOVlhOHAsZEzch8CpbijDEvJ4/jFWI40TjE95n/Pt1 7jbH7VetFtciVTYZpIsRACiMHK2mB212IT9AA0HShnfhngO1IAu3JqYxFJdsWhI43PgFk LvTOCrCOHTNUdO2kVx6GEC/Ucu+Zi8FvosDz+DjNKM4UNt1b/5DI6zVtYU4AZcKvlhKfH sFM+lGQt3RxSC7zS69+j2mBj4qVHZIwNUy1xDCDEAVeCCL5Iej3ZLUjkuOaA1QPgV8g== 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="QzJ0/0AM"; 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 BD51E606A32C for ; Thu, 3 Dec 2026 11:00:04 +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=QzJ0/0AM Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E0001F00893; Thu, 3 Dec 2026 11:00:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796295604; bh=+I+vc4DJRPpdD/wZ6UIrQAF0eJU7Lbv9jXrnJvWxBL0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=QzJ0/0AMQcoxZt6EmQnIozuzldGILYa5O/R534jrF4FePLIPx8pqZnv2gXTJanKrG hhT0Ye3CbS4Bbr5u9h+hvR9RkwaDw4E/6IvtMsfghWDQAuEDcsX3GeKjB50YrsOOau 8lmqWVY6DTA8fuj/KMI+OTJ2vjTnaD1yCoL/lL5nmtGLue57d4796XShdyu5mUErXj h3YIusBDoIk6/OPt3pGMnQdDtebSsEid7d//f4FxAjd8oJ7oXp51Jz8iH8JLZBv+by 1G0cJ6ZnxmdCtsxTZTvpgcZO5Bs79RNw6TsF60OltSZqR7oCzG6jwzsJQ3zCQihQM0 Ihym7bZjCHc1Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 12/17] s390/pageattr: Mark intentional 4k kernel mappings Reply-To: sashiko-reviews@lists.linux.dev To: "Heiko Carstens" Cc: linux-s390@vger.kernel.org, "Vasily Gorbik" , "Alexander Gordeev" , "Christian Borntraeger" In-Reply-To: <20261203103345.1206548-13-hca@linux.ibm.com> References: <20261203103345.1206548-1-hca@linux.ibm.com> <20261203103345.1206548-13-hca@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 11:00:03 +0000 X-Mailing-List: linux-s390@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: - [High] s390/pageattr: set_pte() strips _PAGE_KERNEL_4K aliased to _PAGE_UNUSED -- commit 096b6065239ba4a2322c8abe5f72bd2b041bcd18 Author: Heiko Carstens s390/pageattr: Mark intentional 4k kernel mappings This commit defines _PAGE_KERNEL_4K as an alias of _PAGE_UNUSED and sets it on intentional 4k kernel mappings created via SET_MEMORY_4K or debug_pagealloc direct mappings so they are not collapsed later. > diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgta= ble.h > index a09055f3eb586..2f21ce7b545e8 100644 > --- a/arch/s390/include/asm/pgtable.h > +++ b/arch/s390/include/asm/pgtable.h > @@ -183,6 +183,7 @@ void setup_protection_map(void); > #define _PAGE_WRITE 0x020 /* SW pte write bit */ > #define _PAGE_SPECIAL 0x040 /* SW associated with special page */ > #define _PAGE_UNUSED 0x080 /* SW bit for pgste usage state */ > +#define _PAGE_KERNEL_4K _PAGE_UNUSED /* SW bit for kernel ptes which mus= t not be collapsed */ > =20 > #ifdef CONFIG_MEM_SOFT_DIRTY > #define _PAGE_SOFT_DIRTY 0x002 /* SW pte soft dirty bit */ [Severity: High] Does aliasing _PAGE_KERNEL_4K to _PAGE_UNUSED cause set_pte() to strip the bit before it is written? arch/s390/include/asm/pgtable.h:set_pte() { if (pte_present(pte)) pte =3D clear_pte_bit(pte, __pgprot(_PAGE_UNUSED)); WRITE_ONCE(*ptep, pte); } Mapped kernel PTEs have _PAGE_PRESENT set, so set_pte() clears _PAGE_KERNEL_4K in walk_pte_level() for SET_MEMORY_4K, in modify_pte_table() for debug_pagealloc direct mappings, and in __kernel_map_pages() when a KFENCE or debug_pagealloc page is remapped. As a result, intentional 4k kernel mappings are never marked (or lose their marker on remap), so collapsing code cannot distinguish them from split mappings and can collapse a PMD containing KFENCE or debug_pagealloc pages. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203103345.1206= 548-1-hca@linux.ibm.com?part=3D12