linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, arnd@arndb.de,
	catalin.marinas@arm.com, hch@lst.de, rppt@kernel.org,
	thuth@redhat.com, will@kernel.org
Subject: Re: [PATCH] arm64: patching: avoid early page_to_phys()
Date: Tue, 3 Dec 2024 01:46:11 +0100	[thread overview]
Message-ID: <20241203004611.GA8116@lst.de> (raw)
In-Reply-To: <20241202170359.1475019-1-mark.rutland@arm.com>

On Mon, Dec 02, 2024 at 05:03:59PM +0000, Mark Rutland wrote:
> +	phys_addr_t phys;
> +
> +	if (is_image_text((unsigned long)addr)) {
> +		phys = __pa_symbol(addr);
> +	} else {
> +		struct page *page = vmalloc_to_page(addr);
> +		BUG_ON(!page);
> +		phys = page_to_phys(page) + offset_in_page(addr);
> +	}
> +
> +	return (void *)set_fixmap_offset(fixmap, phys);

This looks much better.  Btw, I recently open coded the vmalloc to phys
logic above in an unrelated fix, and noticed that
arch/powerpc/mm/pgtable.c has a nice vmalloc_to_phys that could
be generalized and move to common code.  Does anyone have an opinion
on that?



  parent reply	other threads:[~2024-12-03  0:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 17:03 [PATCH] arm64: patching: avoid early page_to_phys() Mark Rutland
2024-12-02 17:45 ` Mark Rutland
2024-12-03  8:56   ` Mike Rapoport
2024-12-03  0:46 ` Christoph Hellwig [this message]
2024-12-03  8:55   ` Mike Rapoport
2024-12-03  9:08 ` Mike Rapoport
2024-12-03 21:19 ` Catalin Marinas

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=20241203004611.GA8116@lst.de \
    --to=hch@lst.de \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=rppt@kernel.org \
    --cc=thuth@redhat.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;
as well as URLs for NNTP newsgroup(s).