public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: AKASHI, Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] efi_loader: detaching runtime
Date: Fri, 21 Jun 2019 10:49:48 +0900	[thread overview]
Message-ID: <20190621014947.GM6610@linaro.org> (raw)
In-Reply-To: <74144bea-7b94-8245-d608-5d076cedddd7@gmx.de>

On Thu, Jun 20, 2019 at 11:59:12PM +0200, Heinrich Schuchardt wrote:
> Hello Alex,
> 
> currently we have two code sections in U-Boot:
> 
> * __efi_runtime/__efi_runtime_data (mapped to EFI_RUNTIME_SERVICES_CODE)
> * all other code (mapped to EFI_LOADER_DATA by add_u_boot_and_runtime())
> 
> All code and data that is not marked as __efi_runtime or
> __efi_runtime_data lives in a memory area that the EFI application may
> reuse after ExitBootServices().
> 
> Code that is marked as __efi_runtime is relocated at SetVirtualMemoryMap().
> 
> I wonder in which section the relocation code should live.
> 
> It cannot be __efi_runtime or it will mess up itself while relocating.

What's the matter?
I think that you can build relocation code as PIC
if you pass all the necessary global addresses as parameters.

-Takahiro Akashi

> It cannot be in EFI_LOADER_DATA or it may be overwritten after
> ExitBootServices().
> 
> If this reasoning is right wouldn't we need a third code section living
> in EFI_RUNTIME_SERVICES_CODE but which is excluded from the relocation
> during SetVirtualMemoryMap()?
> 
> Another option of cause would be to put the whole U-Boot code into
> EFI_RUNTIME_SERVICES_CODE which will incur a loss of less than 1 MiB for
> the operating system.
> 
> Best regards
> 
> Heinrich

  reply	other threads:[~2019-06-21  1:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 21:59 [U-Boot] efi_loader: detaching runtime Heinrich Schuchardt
2019-06-21  1:49 ` AKASHI, Takahiro [this message]
2019-06-21  6:35   ` Heinrich Schuchardt
2019-06-21  7:36 ` Alexander Graf
2019-06-21  7:54   ` 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=20190621014947.GM6610@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=u-boot@lists.denx.de \
    /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