From patchwork Tue Mar 14 14:21:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 13174511 Return-Path: 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 8F79CC6FD1C for ; Tue, 14 Mar 2023 14:22:31 +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=SwzeOtwzK4vWwso4AtNVzClh7rm3cBbyTEJ5aMR6b90=; b=merrq+7iqNrN8+ XAnvGKiIpcDuUmlCfPXDa+O3yp5mff1+TUtzRPVAPD8G/kdID/8BEVhWfMBMXf/KVkV7uz8GjXCBI 4ctNH+od5wa2NG3S5opdTmW1SaUX2vfe8/by9nQgp8Oy9F0M+c4Xgf5ZR7p1mJj1OJFrW7LiNZqdm RIqcHFIFh/6hArx3ZSLtY4eLiORWsSuzUft7+uGakdAC9k17eTtnVRdgqPvv4husIr3sRtBREeBhO g0Uke5z6ADmrndctIYKDI2euCqma4Z2LOQhkr9GYn1sqdlVTGSwBtUfp/R3xXaLnUJjWcOirC9qUN xSWU+4NvhzqXBVXmtmJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pc5X1-00ARgK-0Y; Tue, 14 Mar 2023 14:21:39 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pc5Wy-00ARf2-0y for linux-arm-kernel@lists.infradead.org; Tue, 14 Mar 2023 14:21:37 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7EB5B4B3; Tue, 14 Mar 2023 07:22:16 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D28283F67D; Tue, 14 Mar 2023 07:21:31 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: anshuman.khandual@arm.com, ardb@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, ryan.roberts@arm.com, will@kernel.org Subject: [PATCH 0/2] arm64: simplify fixmap code Date: Tue, 14 Mar 2023 14:21:23 +0000 Message-Id: <20230314142125.502043-1-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230314_072136_385116_8678002A X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently arm64's fixmap code tries to use 2M blocks to map the FDT when 4K pages are in use. We do so for a number of historical reasons largely boiling down to "it was simpler at the time", but there's no functional or performance reason why we must use 2M block mappings for the FDT, and using 2M blocks complicates the code and causes some potential issues (e.g. mismatched aliases with memory surrounding the FDT). These patches change the fixmap code to always map the FDT at page granularity. This makes the code simpler, and gets rid of potential issues. The first patch fators the fixmap code out into a separate file, adding a few lines due to includes and function prototypes. The second patch makes the actual strucutural changes to simplify the code. I've botted tested this atop v6.3-rc2 using both 4K and 64K pages. Thanks, Mark. Mark Rutland (2): arm64: mm: move fixmap code to its own file arm64: mm: always map fixmap at page granularity arch/arm64/include/asm/fixmap.h | 15 +- arch/arm64/include/asm/kernel-pgtable.h | 5 +- arch/arm64/include/asm/mmu.h | 2 + arch/arm64/mm/Makefile | 2 +- arch/arm64/mm/fixmap.c | 203 ++++++++++++++++++++++++ arch/arm64/mm/mmu.c | 197 +---------------------- 6 files changed, 219 insertions(+), 205 deletions(-) create mode 100644 arch/arm64/mm/fixmap.c