All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
To: Leif Lindholm <leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Ard Biesheuvel
	<ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Catalin Marinas <Catalin.Marinas-5wv7dgnIgG8@public.gmane.org>
Subject: Re: [PATCH v2 1/2] arm64: don't make early_*map() calls post paging_init()
Date: Wed, 7 Jan 2015 19:03:36 +0000	[thread overview]
Message-ID: <20150107190335.GX7485@arm.com> (raw)
In-Reply-To: <20150107133109.GM3827-t77nlHhSwNqAroYi2ySoxKxOck334EZe@public.gmane.org>

On Wed, Jan 07, 2015 at 01:31:09PM +0000, Leif Lindholm wrote:
> On Wed, Jan 07, 2015 at 01:13:06PM +0000, Ard Biesheuvel wrote:
> > >> > -void __init efi_idmap_init(void)
> > >> > +void __init efi_memmap_init(void)
> > >> >  {
> > >> > +   u64 mapsize;
> > >> > +
> > >> >     if (!efi_enabled(EFI_BOOT))
> > >> >             return;
> > >> >
> > >> > +   /* replace early memmap mapping with permanent mapping */
> > >> > +   mapsize = memmap.map_end - memmap.map;
> > >> > +   memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map,
> > >> > +                                              mapsize);
> > >>
> > >> ioremap_cache() could potententially fail here if the phys_map address
> > >> doesn't have a valid pfn (not in the kernel linear ram mapping) because
> > >> some of the underlying vm support hasn't been initialized yet.
> > >
> > > Can you be more specific about the case you have in mind, please? pfn_valid
> > > uses the memblocks on arm64, and that should all have been sorted out in
> > > paging_init(). What's the issue that you're anticipating?
> > 
> > I think Mark's concern is that it is too early to call
> > __get_free_page(), which is what happens if ioremap_cache() finds that
> > the requested address is not covered by the existing linear mapping.
> > Currently, UEFI reserved RAM regions are covered by the linear
> > mapping, but that is something we intend to change in the future.
> 
> Which shouldn't be a problem, right? Since this function will be going
> away with your "stable mappings" set, and the remap call bumped down
> to an early initcall in arm64_enter_virtual_mode() (or potential
> future name for that function).

Sounds reasonable to me... Ard?

However, I'd certainly like something in the commit log and/or a comment
in the code with our reasoning.

Will

WARNING: multiple messages have this Message-ID (diff)
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] arm64: don't make early_*map() calls post paging_init()
Date: Wed, 7 Jan 2015 19:03:36 +0000	[thread overview]
Message-ID: <20150107190335.GX7485@arm.com> (raw)
In-Reply-To: <20150107133109.GM3827@bivouac.eciton.net>

On Wed, Jan 07, 2015 at 01:31:09PM +0000, Leif Lindholm wrote:
> On Wed, Jan 07, 2015 at 01:13:06PM +0000, Ard Biesheuvel wrote:
> > >> > -void __init efi_idmap_init(void)
> > >> > +void __init efi_memmap_init(void)
> > >> >  {
> > >> > +   u64 mapsize;
> > >> > +
> > >> >     if (!efi_enabled(EFI_BOOT))
> > >> >             return;
> > >> >
> > >> > +   /* replace early memmap mapping with permanent mapping */
> > >> > +   mapsize = memmap.map_end - memmap.map;
> > >> > +   memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map,
> > >> > +                                              mapsize);
> > >>
> > >> ioremap_cache() could potententially fail here if the phys_map address
> > >> doesn't have a valid pfn (not in the kernel linear ram mapping) because
> > >> some of the underlying vm support hasn't been initialized yet.
> > >
> > > Can you be more specific about the case you have in mind, please? pfn_valid
> > > uses the memblocks on arm64, and that should all have been sorted out in
> > > paging_init(). What's the issue that you're anticipating?
> > 
> > I think Mark's concern is that it is too early to call
> > __get_free_page(), which is what happens if ioremap_cache() finds that
> > the requested address is not covered by the existing linear mapping.
> > Currently, UEFI reserved RAM regions are covered by the linear
> > mapping, but that is something we intend to change in the future.
> 
> Which shouldn't be a problem, right? Since this function will be going
> away with your "stable mappings" set, and the remap call bumped down
> to an early initcall in arm64_enter_virtual_mode() (or potential
> future name for that function).

Sounds reasonable to me... Ard?

However, I'd certainly like something in the commit log and/or a comment
in the code with our reasoning.

Will

  parent reply	other threads:[~2015-01-07 19:03 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-06 13:41 [PATCH v2 0/2] arm64: don't call early_*map() post paging_init() Leif Lindholm
2015-01-06 13:41 ` Leif Lindholm
     [not found] ` <1420551673-31416-1-git-send-email-leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-06 13:41   ` [PATCH v2 1/2] arm64: don't make early_*map() calls " Leif Lindholm
2015-01-06 13:41     ` Leif Lindholm
     [not found]     ` <1420551673-31416-2-git-send-email-leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-06 20:35       ` Mark Salter
2015-01-06 20:35         ` Mark Salter
     [not found]         ` <1420576522.16211.30.camel-SI7Dh15yCUp82hYKe6nXyg@public.gmane.org>
2015-01-07 10:58           ` Will Deacon
2015-01-07 10:58             ` Will Deacon
2015-01-07 13:13             ` Ard Biesheuvel
2015-01-07 13:13               ` Ard Biesheuvel
     [not found]               ` <CAKv+Gu9NRRFZG0S6oFJqPG1+1O2-SZah4wqoi0YPofL33X3nJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-07 13:31                 ` Leif Lindholm
2015-01-07 13:31                   ` Leif Lindholm
     [not found]                   ` <20150107133109.GM3827-t77nlHhSwNqAroYi2ySoxKxOck334EZe@public.gmane.org>
2015-01-07 19:03                     ` Will Deacon [this message]
2015-01-07 19:03                       ` Will Deacon
2015-01-06 13:41   ` [PATCH v2 2/2] arm64: call early_ioremap_reset() in paging_init() Leif Lindholm
2015-01-06 13:41     ` Leif Lindholm
2015-01-06 13:59 ` [PATCH v2 0/2] arm64: don't call early_*map() post paging_init() Will Deacon
2015-01-06 13:59   ` Will Deacon
     [not found]   ` <20150106135941.GA3484-5wv7dgnIgG8@public.gmane.org>
2015-01-06 14:04     ` Ard Biesheuvel
2015-01-06 14:04       ` Ard Biesheuvel
     [not found]       ` <CAKv+Gu-nYC1VaJW6ULY0AantA681xZyxqqC+nQq91nj5t7w4OQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-06 15:52         ` Leif Lindholm
2015-01-06 15:52           ` Leif Lindholm
     [not found]           ` <20150106155208.GC3827-t77nlHhSwNqAroYi2ySoxKxOck334EZe@public.gmane.org>
2015-01-06 15:54             ` Ard Biesheuvel
2015-01-06 15:54               ` Ard Biesheuvel
2015-01-06 16:05               ` Will Deacon
2015-01-06 16:05                 ` Will Deacon
     [not found]                 ` <20150106160511.GD3484-5wv7dgnIgG8@public.gmane.org>
2015-01-06 16:23                   ` Ard Biesheuvel
2015-01-06 16:23                     ` Ard Biesheuvel
     [not found]                     ` <CAKv+Gu8nsdCiKM3fOZ6KSMKJ2-1==TyNv8W2Fo6R4jeO3AsgDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-06 19:18                       ` Will Deacon
2015-01-06 19:18                         ` Will Deacon

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=20150107190335.GX7485@arm.com \
    --to=will.deacon-5wv7dgnigg8@public.gmane.org \
    --cc=Catalin.Marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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.