All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Mark Rutland <mark.rutland@arm.com>,
	linux-arm-kernel@lists.infradead.org, arnd@arndb.de,
	catalin.marinas@arm.com, thuth@redhat.com, will@kernel.org
Subject: Re: [PATCH] arm64: patching: avoid early page_to_phys()
Date: Tue, 3 Dec 2024 10:55:19 +0200	[thread overview]
Message-ID: <Z07Hd0UR3mQQW1f7@kernel.org> (raw)
In-Reply-To: <20241203004611.GA8116@lst.de>

On Tue, Dec 03, 2024 at 01:46:11AM +0100, Christoph Hellwig wrote:
> 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?

Maybe fold that check for !page into vmalloc_to_pfn() and make
vmalloc_to_phys() a static inline?
 
-- 
Sincerely yours,
Mike.


  reply	other threads:[~2024-12-03  8:56 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
2024-12-03  8:55   ` Mike Rapoport [this message]
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=Z07Hd0UR3mQQW1f7@kernel.org \
    --to=rppt@kernel.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=hch@lst.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --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 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.