public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "Ruigrok,
	Richard" <rruigrok-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org,
	timur-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	catalin.marinas-5wv7dgnIgG8@public.gmane.org
Subject: Re: [PATCH v2 1/2] efi: arm-stub: Correct FDT and initrd allocation rules for arm64
Date: Fri, 10 Feb 2017 10:05:26 +0000	[thread overview]
Message-ID: <20170210100525.GA28753@leverpostej> (raw)
In-Reply-To: <A1A268D8-2B0B-4333-9E2D-A88CE6061F22-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On Fri, Feb 10, 2017 at 06:38:11AM +0000, Ard Biesheuvel wrote:
> > On 10 Feb 2017, at 00:42, Ruigrok, Richard <rruigrok-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> wrote:
> >> On 2/9/2017 2:42 PM, Ard Biesheuvel wrote:

> >> diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h
> >> index 0b6b1633017f..342e90d6d204 100644
> >> --- a/arch/arm64/include/asm/efi.h
> >> +++ b/arch/arm64/include/asm/efi.h
> >> @@ -46,7 +46,23 @@ int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
> >>  * 2MiB so we know it won't cross a 2MiB boundary.
> >>  */
> >> #define EFI_FDT_ALIGN    SZ_2M   /* used by allocate_new_fdt_and_exit_boot() */
> >> -#define MAX_FDT_OFFSET    SZ_512M
> >> +
> >> +/* on arm64, the FDT may be located anywhere in system RAM */
> >> +static inline unsigned long efi_get_max_fdt_addr(unsigned long dram_base)
> >> +{
> >> +    return ULONG_MAX;
> >> +}
> >> +
> >> +/*
> >> + * On arm64, we have to ensure that the initrd ends up in the linear region,
> >> + * which is a 1 GB aligned region of size '1UL << (VA_BITS - 1)' that is
> >> + * guaranteed to cover the kernel Image.
> >> + */
> >> +static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base,
> >> +                            unsigned long image_addr)
> >> +{
> >> +    return (image_addr & ~(SZ_1G - 1UL)) + (1UL << (VA_BITS - 1));
> >> +}
> >> 
> > Please update booting.txt which specifies a window of 32G for ARM64
> > 
> 
> No. The efi stub is built into the kernel, so there we can be lax
> about these things.

Sure.

Given this is a source of confusion, can we drop a comment here as to
how this is deliberate? e.g.

/*
 * On arm64, we have to ensure that the initrd ends up in the linear region,
 * which is a 1 GB aligned region of size '1UL << (VA_BITS - 1)' that is
 * guaranteed to cover the kernel Image.
 *
 * Since the EFI stub is part of the kernel Image, we can relax than the
 * usual requirements in Documentation/arm64/booting.txt, which still
 * apply to other bootloaders, and are required for some kernel
 * configurations.
 */

Thanks,
Mark.

  parent reply	other threads:[~2017-02-10 10:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 21:42 [PATCH v2 1/2] efi: arm-stub: Correct FDT and initrd allocation rules for arm64 Ard Biesheuvel
2017-02-09 21:42 ` [PATCH v2 2/2] efi: arm-stub: Round up FDT allocation to mapping size Ard Biesheuvel
     [not found]   ` <a25905bb-5ad5-e10e-c14a-f01313eace2d@codeaurora.org>
     [not found]     ` <a25905bb-5ad5-e10e-c14a-f01313eace2d-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-10 14:18       ` Ard Biesheuvel
     [not found]   ` <1486676573-19237-2-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-12 20:10     ` Jeffrey Hugo
     [not found]       ` <9355065f-5782-e935-e8dc-9f6c0676b7f2-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-15 17:29         ` Ard Biesheuvel
2017-03-20 23:25     ` Timur Tabi
2017-03-20 23:40       ` Ard Biesheuvel
     [not found] ` <1486676573-19237-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-10  0:42   ` [PATCH v2 1/2] efi: arm-stub: Correct FDT and initrd allocation rules for arm64 Ruigrok, Richard
     [not found]     ` <a7058407-a770-d413-e072-ba3edd7df197-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-10  6:38       ` Ard Biesheuvel
     [not found]         ` <A1A268D8-2B0B-4333-9E2D-A88CE6061F22-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-10 10:05           ` Mark Rutland [this message]
2017-02-10 14:58             ` Ard Biesheuvel
2017-02-12 20:10   ` Jeffrey Hugo

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=20170210100525.GA28753@leverpostej \
    --to=mark.rutland-5wv7dgnigg8@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=jhugo-sgV2jX0FEOL9JmXXK+q4OQ@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=matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org \
    --cc=rruigrok-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=timur-sgV2jX0FEOL9JmXXK+q4OQ@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox