All of lore.kernel.org
 help / color / mirror / Atom feed
* efi_loader/RISC-V: misaligned load when running grubriscv64.efi
@ 2020-07-30 10:03 Heinrich Schuchardt
  2020-07-30 10:16 ` Sean Anderson
  0 siblings, 1 reply; 12+ messages in thread
From: Heinrich Schuchardt @ 2020-07-30 10:03 UTC (permalink / raw)
  To: u-boot

Dear Sean,

when trying to run grubriscv64.efi from the
trini/u-boot-gitlab-ci-runner:bionic-20200526-18Jun2020 Docker image on
a MAIXDUINO the relocations are not naturally aligned:

lib/efi_loader/efi_image_loader.c(133) efi_loader_relocate():

    efi_reloc 000000008030a000, offset 0x101e, type 10

Here we are trying to change an u64 at 0x8030B01E:

    uint64_t *x64 = efi_reloc + offset;
    *x64 += (uint64_t)delta;

This leads to an exception in function efi_loader_relocate():

    Unhandled exception: Load address misaligned
    EPC: 00000000805a95ac RA: 00000000805a953a TVAL: 000000008030b01e
    EPC: 000000008001c5ac RA: 000000008001c53a reloc

The GRUB image is available here:

https://gist.github.com/xypron/522a91962248e9c3888d8554cb61ad2c/raw/b959661626b38a738673a9efb2f398b2fabd5c77/grubriscv64.efi

On QEMU the GRUB image is executed without problems:

https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/jobs/132919

The UEFI specification requires for the ARM platform that unaligned
support is enabled. This is why we have implemented function
allow_unaligned().

On RISC-V we have not yet implemented allow_unaligned() yet. Is there a
way to switch RISCV64 CPUs especially the Kendryte K210 into a mode
supporting unaligned access?

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-07-30 21:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 10:03 efi_loader/RISC-V: misaligned load when running grubriscv64.efi Heinrich Schuchardt
2020-07-30 10:16 ` Sean Anderson
2020-07-30 11:04   ` Heinrich Schuchardt
2020-07-30 11:04     ` Heinrich Schuchardt
2020-07-30 18:31     ` Atish Patra
2020-07-30 18:31       ` Atish Patra
2020-07-30 20:11       ` Heinrich Schuchardt
2020-07-30 20:11         ` Heinrich Schuchardt
2020-07-30 20:19         ` Heinrich Schuchardt
2020-07-30 20:19           ` Heinrich Schuchardt
2020-07-30 21:10           ` Atish Patra
2020-07-30 21:10             ` Atish Patra

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.