Message ID | 20220801080418.120311-1-rppt@kernel.org (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED38EC00144 for <linux-arm-kernel@archiver.kernel.org>; Mon, 1 Aug 2022 08:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MYw23h/zrK/hMq96E5RizUG5qScxK8Ih+MXaHPmXzBc=; b=ienEFOsYrr4kZH i74t13FCh9ArQGSBxBW2eOJrBX5tfyOPeT19jrQHnoRHTCvoUYXx81RIfRQRRM7CIF5HjdE4IdNV6 Vp78rjoj/LpDZrzKn6T3lpg+bfXDG8v5D9sDk0upEXvqeuXK7G5kopoxHqoZ3DX4bUi/UWaO1sO8b ynH/rUlm5qs6h7T14aQHywsLY7HhxohOvmbQrJDaPUGfahqRZPV8fT5JoqiHtbWp/FBvOKoHauvrj m4YzqAqqezcWmNMUswqZ9mWIBQEca+YrkRd2zN4F3UuCfPQ5vD2tGvkD+JnekAyG7BJWSlShWYvxr 5frkgrEp7kKJ2ecFCP8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIQPp-003kk1-49; Mon, 01 Aug 2022 08:04:41 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIQPk-003kfy-Qs for linux-arm-kernel@lists.infradead.org; Mon, 01 Aug 2022 08:04:38 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1541460F11; Mon, 1 Aug 2022 08:04:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04576C433D6; Mon, 1 Aug 2022 08:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659341074; bh=56n+0m+xaHkhO9EercwLYHh4JA36EIdVcoYGgta05LM=; h=From:To:Cc:Subject:Date:From; b=PBTOQQmjAlS/LOaIiG9gZDpZNG456lN6JjSjXbHBgemcsUCZlcon3FWS3cRznwonl jwI8f1YENB0df5Ks3YrRDkO3mzP0TGnYfumoxMS29SzSgh16Pg9LsCeNl1HAjMt0q+ 0qV2CSWGls94Q3xgUU25TVJpf8nD/pmTYrGZrqA2Wfqfewf3CKPF+7yG9jvEgyWse2 aheSEixbfrrXyCsETH4ojUN1bWsAsnI+hH/YFLGQ69bdvPAE7dXhVoOc22SZXPHHY7 NrQGbpBDqcX4++iBSyN2UBtap8HzR9uXYhXUAN4My9vE43gPZQdenoipFA09OaR5jh kUu6BkdmJ+ROA== From: Mike Rapoport <rppt@kernel.org> To: linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel <ardb@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, Guanghui Feng <guanghuifeng@linux.alibaba.com>, Mark Rutland <mark.rutland@arm.com>, Mike Rapoport <rppt@kernel.org>, Mike Rapoport <rppt@linux.ibm.com>, Will Deacon <will@kernel.org>, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 0/4] arm64/mm: remap crash kernel with base pages even if rodata_full disabled Date: Mon, 1 Aug 2022 11:04:14 +0300 Message-Id: <20220801080418.120311-1-rppt@kernel.org> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220801_010436_954672_65E1CC5E X-CRM114-Status: GOOD ( 16.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
arm64/mm: remap crash kernel with base pages even if rodata_full disabled
|
expand
|
From: Mike Rapoport <rppt@linux.ibm.com> Hi, There were several rounds of discussion how to remap with base pages only the crash kernel area, the latest one here: https://lore.kernel.org/all/1656777473-73887-1-git-send-email-guanghuifeng@linux.alibaba.com and this is my attempt to allow having both large pages in the linear map and protection for the crash kernel memory. For server systems it is important to protect crash kernel memory for post-mortem analysis, and for that protection to work the crash kernel memory should be mapped with base pages in the linear map. On the systems with ZONE_DMA/DMA32 enabled, crash kernel reservation happens after the linear map is created and the current code forces using base pages for the entire linear map, which results in performance degradation. These patches enable remapping of the crash kernel area with base pages while keeping large pages in the rest of the linear map. The idea is to align crash kernel reservation to PUD boundaries, remap that PUD and then free the extra memory. For now the remapping does not deal with the case when crash kernel base is specified, but this won't be a problem to add if the idea is generally acceptable. Mike Rapoport (4): arm64: introduce have_zone_dma() helper arm64/mmu: drop _hotplug from unmap_hotplug_* function names arm64/mmu: move helpers for hotplug page tables freeing close to callers arm64/mm: remap crash kernel with base pages even if rodata_full disabled arch/arm64/include/asm/memory.h | 8 +++ arch/arm64/include/asm/mmu.h | 2 + arch/arm64/mm/init.c | 44 ++++++++++-- arch/arm64/mm/mmu.c | 116 ++++++++++++++++++++------------ 4 files changed, 122 insertions(+), 48 deletions(-)