All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
	Will Deacon <will.deacon@arm.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Mark Salter <msalter@redhat.com>
Subject: Re: [PATCH 1/2] arm64: don't make early_*map() calls post paging_init()
Date: Tue, 6 Jan 2015 09:38:24 +0000	[thread overview]
Message-ID: <CAKv+Gu_EWCYYcmsLuojGGQ+6x+Lp5fWJQ+4fvR-4fqXqU2f53Q@mail.gmail.com> (raw)
In-Reply-To: <1420482835-6444-2-git-send-email-leif.lindholm@linaro.org>

On 5 January 2015 at 18:33, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> arm64 early_ioremap/iounmap/memremap/memunmap are not supported beyond
> the call to paging_init(), but arm64_enter_virtual_mode() (an early
> initcall) makes one call to unmap the UEFI memory map.
>
> Rearrange the code to unmap this region before paging_init().
>
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> ---
>  arch/arm64/kernel/efi.c   | 12 +++---------
>  arch/arm64/kernel/setup.c |  2 --
>  2 files changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
> index 6fac253..790adb5 100644
> --- a/arch/arm64/kernel/efi.c
> +++ b/arch/arm64/kernel/efi.c
> @@ -317,15 +317,8 @@ void __init efi_init(void)
>                 return;
>
>         reserve_regions();
> -}
> -
> -void __init efi_idmap_init(void)
> -{
> -       if (!efi_enabled(EFI_BOOT))
> -               return;
>
> -       /* boot time idmap_pg_dir is incomplete, so fill in missing parts */
> -       efi_setup_idmap();
> +       early_memunmap(memmap.map, params.mmap_size);
>  }
>
>  static int __init remap_region(efi_memory_desc_t *md, void **new)
> @@ -380,7 +373,6 @@ static int __init arm64_enter_virtual_mode(void)
>         }
>
>         mapsize = memmap.map_end - memmap.map;
> -       early_memunmap(memmap.map, mapsize);
>
>         if (efi_runtime_disabled()) {
>                 pr_info("EFI runtime services will be disabled.\n");
> @@ -393,6 +385,8 @@ static int __init arm64_enter_virtual_mode(void)
>                                                    mapsize);
>         memmap.map_end = memmap.map + mapsize;
>
> +       efi_setup_idmap();
> +

I think this is incorrect: we may call early_alloc() here which is
only allowed before paging_init()

>         efi.memmap = &memmap;
>
>         /* Map the runtime regions */
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index b809911..c7eb3c5 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c
> @@ -401,8 +401,6 @@ void __init setup_arch(char **cmdline_p)
>         paging_init();
>         request_standard_resources();
>
> -       efi_idmap_init();
> -
>         unflatten_device_tree();
>
>         psci_init();
> --
> 2.1.3
>

WARNING: multiple messages have this Message-ID (diff)
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm64: don't make early_*map() calls post paging_init()
Date: Tue, 6 Jan 2015 09:38:24 +0000	[thread overview]
Message-ID: <CAKv+Gu_EWCYYcmsLuojGGQ+6x+Lp5fWJQ+4fvR-4fqXqU2f53Q@mail.gmail.com> (raw)
In-Reply-To: <1420482835-6444-2-git-send-email-leif.lindholm@linaro.org>

On 5 January 2015 at 18:33, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> arm64 early_ioremap/iounmap/memremap/memunmap are not supported beyond
> the call to paging_init(), but arm64_enter_virtual_mode() (an early
> initcall) makes one call to unmap the UEFI memory map.
>
> Rearrange the code to unmap this region before paging_init().
>
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> ---
>  arch/arm64/kernel/efi.c   | 12 +++---------
>  arch/arm64/kernel/setup.c |  2 --
>  2 files changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
> index 6fac253..790adb5 100644
> --- a/arch/arm64/kernel/efi.c
> +++ b/arch/arm64/kernel/efi.c
> @@ -317,15 +317,8 @@ void __init efi_init(void)
>                 return;
>
>         reserve_regions();
> -}
> -
> -void __init efi_idmap_init(void)
> -{
> -       if (!efi_enabled(EFI_BOOT))
> -               return;
>
> -       /* boot time idmap_pg_dir is incomplete, so fill in missing parts */
> -       efi_setup_idmap();
> +       early_memunmap(memmap.map, params.mmap_size);
>  }
>
>  static int __init remap_region(efi_memory_desc_t *md, void **new)
> @@ -380,7 +373,6 @@ static int __init arm64_enter_virtual_mode(void)
>         }
>
>         mapsize = memmap.map_end - memmap.map;
> -       early_memunmap(memmap.map, mapsize);
>
>         if (efi_runtime_disabled()) {
>                 pr_info("EFI runtime services will be disabled.\n");
> @@ -393,6 +385,8 @@ static int __init arm64_enter_virtual_mode(void)
>                                                    mapsize);
>         memmap.map_end = memmap.map + mapsize;
>
> +       efi_setup_idmap();
> +

I think this is incorrect: we may call early_alloc() here which is
only allowed before paging_init()

>         efi.memmap = &memmap;
>
>         /* Map the runtime regions */
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index b809911..c7eb3c5 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c
> @@ -401,8 +401,6 @@ void __init setup_arch(char **cmdline_p)
>         paging_init();
>         request_standard_resources();
>
> -       efi_idmap_init();
> -
>         unflatten_device_tree();
>
>         psci_init();
> --
> 2.1.3
>

  reply	other threads:[~2015-01-06  9:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-05 18:33 [PATCH 0/2] arm64: don't call early_*map() post paging_init() Leif Lindholm
2015-01-05 18:33 ` Leif Lindholm
2015-01-05 18:33 ` [PATCH 1/2] arm64: don't make early_*map() calls " Leif Lindholm
2015-01-05 18:33   ` Leif Lindholm
2015-01-06  9:38   ` Ard Biesheuvel [this message]
2015-01-06  9:38     ` Ard Biesheuvel
2015-01-06 13:39     ` Leif Lindholm
2015-01-06 13:39       ` Leif Lindholm
     [not found] ` <1420482835-6444-1-git-send-email-leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-05 18:33   ` [PATCH 2/2] arm64: call early_ioremap_reset() in paging_init() Leif Lindholm
2015-01-05 18:33     ` Leif Lindholm
     [not found]     ` <1420482835-6444-3-git-send-email-leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-06  9:39       ` Ard Biesheuvel
2015-01-06  9:39         ` Ard Biesheuvel

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=CAKv+Gu_EWCYYcmsLuojGGQ+6x+Lp5fWJQ+4fvR-4fqXqU2f53Q@mail.gmail.com \
    --to=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=leif.lindholm@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=msalter@redhat.com \
    --cc=will.deacon@arm.com \
    /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.