All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Sang-Heon Jeon <ekffu200098@gmail.com>
Cc: will@kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: mm: drop redundant remap of FDT first page
Date: Tue, 26 May 2026 19:57:28 +0100	[thread overview]
Message-ID: <ahXtGL7QI82ZHPDO@arm.com> (raw)
In-Reply-To: <20260513170101.1858213-1-ekffu200098@gmail.com>

On Thu, May 14, 2026 at 02:01:01AM +0900, Sang-Heon Jeon wrote:
> fixmap_remap_fdt() calls create_mapping_noalloc() to map the first
> page of the FDT to read its magic and totalsize from the header. If
> the FDT does not fit in a single page, it calls create_mapping_noalloc()
> again to map the rest.
> 
> The second mapping redundantly covers the first page that was just
> mapped by the first mapping.
> 
> Start the second mapping at dt_phys_base + PAGE_SIZE so it only covers
> the pages that have not been mapped yet. No functional change.
> 
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
[...]
> diff --git a/arch/arm64/mm/fixmap.c b/arch/arm64/mm/fixmap.c
> index c5c5425791da..f8aea5572f7c 100644
> --- a/arch/arm64/mm/fixmap.c
> +++ b/arch/arm64/mm/fixmap.c
> @@ -167,8 +167,9 @@ void *__init fixmap_remap_fdt(phys_addr_t dt_phys, int *size, pgprot_t prot)
>  		return NULL;
>  
>  	if (offset + *size > PAGE_SIZE) {
> -		create_mapping_noalloc(dt_phys_base, dt_virt_base,
> -				       offset + *size, prot);
> +		create_mapping_noalloc(dt_phys_base + PAGE_SIZE,
> +			dt_virt_base + PAGE_SIZE,
> +			offset + *size - PAGE_SIZE, prot);
>  	}

Is it actually worth it? It's not that we allocate memory here or take a
noticeable time to reach the first pte. I find the current easier to
read.

-- 
Catalin


  parent reply	other threads:[~2026-05-26 18:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 17:01 [PATCH] arm64: mm: drop redundant remap of FDT first page Sang-Heon Jeon
2026-05-14 17:15 ` Sang-Heon Jeon
2026-05-26 18:57 ` Catalin Marinas [this message]
2026-05-27 12:36   ` Sang-Heon Jeon

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=ahXtGL7QI82ZHPDO@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=ekffu200098@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.