mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: skseofh@gmail.com
To: catalin.marinas@arm.com, will@kernel.org
Cc: ryan.roberts@arm.com, mark.rutland@arm.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Daero Lee <skseofh@gmail.com>
Subject: [PATCH] arm64: add early fixmap initialization flag
Date: Sat, 17 Feb 2024 23:03:26 +0900	[thread overview]
Message-ID: <20240217140326.2367186-1-skseofh@gmail.com> (raw)

From: Daero Lee <skseofh@gmail.com>

early_fixmap_init may be called multiple times. Since there is no
change in the page table after early fixmap initialization, an
initialization flag was added.

Signed-off-by: Daero Lee <skseofh@gmail.com>
---
 arch/arm64/mm/fixmap.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/mm/fixmap.c b/arch/arm64/mm/fixmap.c
index c0a3301203bd..fbdd5f30f3a1 100644
--- a/arch/arm64/mm/fixmap.c
+++ b/arch/arm64/mm/fixmap.c
@@ -32,6 +32,8 @@ static pte_t bm_pte[NR_BM_PTE_TABLES][PTRS_PER_PTE] __page_aligned_bss;
 static pmd_t bm_pmd[PTRS_PER_PMD] __page_aligned_bss __maybe_unused;
 static pud_t bm_pud[PTRS_PER_PUD] __page_aligned_bss __maybe_unused;
 
+static int early_fixmap_initialized __initdata;
+
 static inline pte_t *fixmap_pte(unsigned long addr)
 {
 	return &bm_pte[BM_PTE_TABLE_IDX(addr)][pte_index(addr)];
@@ -100,10 +102,15 @@ void __init early_fixmap_init(void)
 	unsigned long addr = FIXADDR_TOT_START;
 	unsigned long end = FIXADDR_TOP;
 
+	if (early_fixmap_initialized)
+		return;
+
 	pgd_t *pgdp = pgd_offset_k(addr);
 	p4d_t *p4dp = p4d_offset(pgdp, addr);
 
 	early_fixmap_init_pud(p4dp, addr, end);
+
+	early_fixmap_initialized = 1;
 }
 
 /*
-- 
2.25.1


             reply	other threads:[~2024-02-17 14:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17 14:03 skseofh [this message]
2024-02-19 10:48 ` Mark Rutland
2024-02-20  0:29   ` Itaru Kitayama
2024-02-20 11:55     ` Mark Rutland
2024-02-20 23:14       ` Itaru Kitayama
2024-02-22 10:59         ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240217140326.2367186-1-skseofh@gmail.com \
    --to=skseofh@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=ryan.roberts@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®