From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796294033; b=JiaopXBFubjISzSURkXiacNOlUyKFSp4YOUWHKGuBMCXc/3Xk0wuPD12YBKvqPM2zdri GHM/LINWLzbHHiCjVmCsASXSOQrglPCBHD/4t2jqfZwp6ecdGoQH2j4j0VYf7hGfx0UMJ lromaQ8/8mZExH0EL1AeXU4Vnp6bpk/lSpuKQJ1XG78Rxnk0ikw6NxYZxQiCYqx8QN+hK V0h+wDGAs/0Xz3Z53tbmcCk69dq/5CVyTiXgj+dGQDYxNM6cwTMhhXI0KXw4C69/oWwMz U1cA4w7OSeoiB+pvsTlAavpYzuJjv+frBTi+PSkCegdZ2nnhBM5epGwCQaQOBO1gwCw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796294033; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Received: Received:Received:Received:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-TM-AS-GCONF:X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-GUID:X-Proofpoint-Spam-Info:X-Authority-Analysis: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=WiND3jIpHctyJAFy/hzHFq0B1gltx7xyi/ZuCkY3rsE=; b=RH9mudp4NxZ0Hp973pQEvfGhNLsz+i8sIU1pxBtsFRgpls42o8czyGb0FhdccE5FaDY/ /vNV6bciU45EV19Ocxyb1gYDewVLvsiaBGu/tGo1V9hKidBabyOlVdAlgKk7XrSlN8enr M90TftLHiPxfTPJ1Z6D8K/kdkoKl33YhwP4UzvPDTB6GOGIjTmJ8WC8cWejTxric+fuuX JHHcGHGbga70JtWHiSz5YeoMUIMLwDoR+4NIrzRNtrYYXlDUQ1tJFvModBcJnCgOJ91uC qmurI2f64IIb/8KLo+3IvBCXwJMNB3kSywvbj9F5pvBQ0OipkqF5YCjNeXDqfmzabng== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=MpK09EQD; arc=none smtp.remote-ip=148.163.156.1 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81A43606A32C; Thu, 3 Dec 2026 10:33:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 81A43606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=MpK09EQD Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3752Gh1099233; Thu, 3 Dec 2026 10:33:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=pp1; bh=WiND3jIpHctyJAFy/hzHFq0B1gltx7xyi/ZuCkY3r sE=; b=MpK09EQDR9lltZ0qJ+xpq/UlmodkFwBjNZcugaNUAZ1bdtTtzxBCTgpFH HUjWtH1VtNSGGDvs1iWS7/MTIJaxfS8oOihvGMsralMitJNVxLRevWpqIu/L2tAP XPvDTmxx+nZvr0AuVos+9w+im00nYEJpRxHctdYnrG69meroITql9qpIzA4vDyc2 Zza7ybxqHoaMLxK07CHovUpqFJC4DjEoxURngojabq87RyduJUaekT0OgdFrDPje qfdsjq7Ba7ull3m1Uww6qV7LnsbPCrrwIUoIhoY8OAWsQamx8ofVYXTu58GwlLB0 GEp9n7iURzOa/5te6Y37zRVFlW9sA== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4j7pmtee9q-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 03 Dec 2026 10:33:51 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3AJLv41784740; Thu, 3 Dec 2026 10:33:50 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4jb2wa0v3h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Dec 2026 10:33:50 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6B3AXkWl41681346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Dec 2026 10:33:46 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DE7B2004E; Thu, 3 Dec 2026 10:33:46 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C45E2004B; Thu, 3 Dec 2026 10:33:46 +0000 (GMT) Received: from tuxmaker.lnxne.boe (unknown [9.87.85.9]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Dec 2026 10:33:46 +0000 (GMT) From: Heiko Carstens To: Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger , Mike Rapoport , Gerald Schaefer Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 00/17] s390/mm: Large kernel mappings for vmalloc and execmem ROX cache Date: Thu, 3 Dec 2026 11:33:28 +0100 Message-ID: <20261203103345.1206548-1-hca@linux.ibm.com> X-Mailer: git-send-email 2.53.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: _aGRMAbmvd7VpPKkubxi6cl1iVdbZH-t X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDA0MCBTYWx0ZWRfXzV/TbJI8Amdv Y0f6+bIsBUbf5ZBcr+IHUfqldv92uC4Y4H8Lb6ZqvhwVH1CcAo4QlmsAeXYIODE612i9RJnTLUU eB6UeF1r7HDFJBpIapJ0NKMLPz6WoUmbrM/jzFi/fwGSs0/TdYfJ1gb8xmlZUxPYU+U4NBH2vLC kYU0769tv1tuT5qRaY8uFxfx03fwQGFdFuYDzvLLqVhxxQ1wSwMjm07X4Q6sLD0B3OSAO0ICAC1 afa0t9LLg0FlZ71uTAFtMKFQZ03lpXBq1Pv1FbMJKBTVkUPpwrlS6ALoeNPBqvRS1ZEfFc7eA7Q CfX9t/21BIx+mH5HpUZiXWgPBXuz5Agqbh74LawAxw7wBQbMXT6mJBvUXpqglb9X7uC9A+CdWxZ 0Ujk5DqK2OVESAR72lFyb3PkokUuKCD4N1gA9iEOLpnFTJ1eV5A6xYs7wiCT31MJGCRxqpNQJji CEguwCrRC5Qwz3Tct9Q== X-Proofpoint-GUID: _aGRMAbmvd7VpPKkubxi6cl1iVdbZH-t X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDA0MCBTYWx0ZWRfXw/oF7vKJh5dL GiYUwvVNituHcqTx2cPftQxMYsPNVV+g1jOaJLK5RmddT6e93Etzf5opFjtyVCaHSPafTycGtOn 5oNKZtz7un/O00VAnPARmW/ZTTl3LVc= X-Authority-Analysis: v=2.4 cv=U9cHnuru c=1 sm=1 tr=0 ts=6b11458f cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=fPKeJ9imjLEeOXot87sA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-03_02,2026-12-02_07,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030040 Enable the execmem ROX cache on s390. With EDAT1, module text, kprobes and ftrace allocations are backed by 1MB read-only and executable mappings instead of 4k mappings, which reduces TLB pressure. The series consists of several parts: Patches 1-4 are fixes and preparation, which are also useful on their own: init_mm->asce_limit is initialized, the direct map page counters are no longer modified for the kernel image, kernel page table changes are serialized with the init_mm mmap lock instead of two unrelated mutexes, and the vmem code uses the generic page table allocators. Patches 5-7 add the page table dump WC attribute and implement HAVE_ARCH_HUGE_VMAP and HAVE_ARCH_HUGE_VMALLOC, so that vmap(), ioremap() and vmalloc() can use 1MB mappings. Patches 8-13 rework pageattr.c: add helpers to replace live kernel page table entries, use a common helper to change permissions on all page table levels, avoid splitting mappings if the resulting entry would be identical, mark intentional 4k mappings, and collapse split mappings back into large pages after a successful set_memory_rox(). Patches 14-17 add PAGE_KERNEL_ROX, EXECMEM_KPROBES and EXECMEM_FTRACE ranges (which makes the s390 specific alloc_insn_page() and the explicit set_memory_rox() for ftrace trampolines obsolete), and finally enable ARCH_HAS_EXECMEM_ROX. Tested on s390 with EDAT1: all module text lives in two 1MB "PMD RO X" mappings which stay intact across module load/unload and ftrace selftests. Series applies on top of linux-next 20261202. Thanks, Heiko Heiko Carstens (17): s390/boot: Initialize asce_limit for init_mm properly s390/pageattr: Only account direct mapping in direct map page counters s390/mm: Serialize kernel page table changes with init_mm mmap lock s390/vmem: Use generic page table allocators for vmem page tables s390/mm: Show write-combining attribute in page table dump s390/mm: Implement HAVE_ARCH_HUGE_VMAP s390/mm: Implement HAVE_ARCH_HUGE_VMALLOC s390/pageattr: Add helpers to replace kernel page table entries s390/mm: Add _SEGMENT_ENTRY_TYPE s390/pageattr: Use common helper to change kernel page table permissions s390/pageattr: Avoid splitting mappings if permissions do not change s390/pageattr: Mark intentional 4k kernel mappings s390/pageattr: Collapse kernel mappings after changing page attributes s390/mm: Add PAGE_KERNEL_ROX s390/execmem: Add EXECMEM_KPROBES range s390/execmem: Add EXECMEM_FTRACE range s390/execmem: Enable EXECMEM_ARCH_ROX .../features/vm/huge-vmap/arch-support.txt | 2 +- arch/s390/Kconfig | 3 + arch/s390/boot/vmem.c | 1 + arch/s390/include/asm/pgalloc.h | 2 + arch/s390/include/asm/pgtable.h | 29 ++ arch/s390/include/asm/set_memory.h | 4 - arch/s390/include/asm/vmalloc.h | 16 + arch/s390/kernel/kprobes.c | 16 - arch/s390/kernel/module.c | 11 +- arch/s390/mm/dump_pagetables.c | 17 +- arch/s390/mm/init.c | 45 +++ arch/s390/mm/pageattr.c | 336 +++++++++++++----- arch/s390/mm/pgtable.c | 81 +++++ arch/s390/mm/vmem.c | 80 +++-- 14 files changed, 484 insertions(+), 159 deletions(-) base-commit: 799dd936553182df5770dde7f38d94c8337df75a -- 2.53.0