Bug 1145646 - grub 2.04 fails to boot on armv6 (Raspberry Pi 1)
grub 2.04 fails to boot on armv6 (Raspberry Pi 1)
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Bootloader
Current
Other openSUSE Factory
: P5 - None : Normal (vote)
: ---
Assigned To: Chester Lin
Jiri Srain
:
Depends on: 1104833 1122614
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-14 14:39 UTC by Guillaume GARDET
Modified: 2019-12-17 14:25 UTC (History)
14 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
armv6 data abort after kernel and initrd are loaded (640 bytes, text/plain)
2019-08-14 14:39 UTC, Guillaume GARDET
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume GARDET 2019-08-14 14:39:00 UTC
Created attachment 814015 [details]
armv6 data abort after kernel and initrd are loaded

+++ This bug was initially created as a clone of Bug #1122614 +++

grub 2.04 fails to boot on armv6 with a data abort error.
See attachment for the log.
Comment 1 Michael Chang 2019-09-26 08:15:43 UTC
The data abort error was reporting the program counter pointing to the second UEFI image at offset 0x7fb0 that has gone past grub as the first image.
Comment 2 Joey Lee 2019-09-26 08:21:54 UTC
Assigned to Chester Lin that Michael mentioned the kernel be loaded by grub2.
Comment 3 Chester Lin 2019-10-08 07:11:44 UTC
The data abort message was printed by u-boot so I guess this issue might occur in a very early stage of EFIStub since there was no "EFI stub:" message output on the console.
Comment 4 Guillaume GARDET 2019-10-30 16:53:15 UTC
@Chester, how to debug this problem?
Comment 5 Chester Lin 2019-11-12 04:44:08 UTC
(In reply to Guillaume GARDET from comment #4)
> @Chester, how to debug this problem?

Hi Guillaume,

I don't have an ARM11-based board on hand but I've made a test kernel which includes some debug messages in efi_entry(). Could you help me to try it on your rpi-1 so that we can see whether the efi_entry can be reached or not? Here is the repo link:

https://download.opensuse.org/repositories/home:/clin:/branches:/openSUSE:/ARM:/bsc1145646/ARM/

After installing the package please make the following changes to the kernel command line:

1. Change the loglevel to "ignore_loglevel"
2. Add "earlyprintk=ttyAMA0,115200n8"

Let's narrow down this issue first, thanks.
Comment 6 Guillaume GARDET 2019-11-12 15:29:51 UTC
@Chester, could you rebase on kernel:HEAD 5.4-rc7 please, because 5.3 does not boot on RPi1. See: https://lists.opensuse.org/opensuse-arm/2019-11/msg00022.html
Comment 7 Chester Lin 2019-11-14 07:05:21 UTC
(In reply to Guillaume GARDET from comment #6)
> @Chester, could you rebase on kernel:HEAD 5.4-rc7 please, because 5.3 does
> not boot on RPi1. See:
> https://lists.opensuse.org/opensuse-arm/2019-11/msg00022.html

Done. I have re-based to 5.4-rc7 and the download link is the same as #Comment5(In reply to Guillaume GARDET from comment #6)
> @Chester, could you rebase on kernel:HEAD 5.4-rc7 please, because 5.3 does
> not boot on RPi1. See:
> https://lists.opensuse.org/opensuse-arm/2019-11/msg00022.html

Done. I have re-based to 5.4-rc7 and the download link is the same as #comment5(In reply to Guillaume GARDET from comment #6)
> @Chester, could you rebase on kernel:HEAD 5.4-rc7 please, because 5.3 does
> not boot on RPi1. See:
> https://lists.opensuse.org/opensuse-arm/2019-11/msg00022.html

Done. I have re-based to 5.4-rc7 and the download link is the same as #comment5
Comment 8 Guillaume GARDET 2019-11-19 07:41:58 UTC
I got a patch this morning that fixes this problem in u-boot: https://raw.githubusercontent.com/xypron/u-boot-patches/efi-next/0001-arm-arm11-allow-unaligned-memory-access.patch

The fix is already in hardware:boot/u-boot and it is on the way to Factory: https://build.opensuse.org/request/show/749424
Comment 9 Chester Lin 2019-11-19 08:42:10 UTC
(In reply to Guillaume GARDET from comment #8)
> I got a patch this morning that fixes this problem in u-boot:
> https://raw.githubusercontent.com/xypron/u-boot-patches/efi-next/0001-arm-
> arm11-allow-unaligned-memory-access.patch
> 
> The fix is already in hardware:boot/u-boot and it is on the way to Factory:
> https://build.opensuse.org/request/show/749424

It's good to know. I got a Pi Zero W this week and it could reproduce this issue as well. I found the data abort was triggered in efi_get_memory_map() of efistub.

Here is the call sequence:

efi_entry(..)->
  ......
  efi_convert_cmdline(..)->
    ....
    efi_high_alloc(..)->
      efi_get_memory_map(..)

In efi_get_memory_map(..), the data abort should occur before calling the boot_service allocate_pool. I tried enabling debug print on u-boot and I didn't see a call to allocate_pool after entering into efi_get_memory_map(..)
Comment 10 Chester Lin 2019-11-19 08:57:39 UTC
(In reply to Chester Lin from comment #9)
> (In reply to Guillaume GARDET from comment #8)
> > I got a patch this morning that fixes this problem in u-boot:
> > https://raw.githubusercontent.com/xypron/u-boot-patches/efi-next/0001-arm-
> > arm11-allow-unaligned-memory-access.patch
> > 
> > The fix is already in hardware:boot/u-boot and it is on the way to Factory:
> > https://build.opensuse.org/request/show/749424
> 
> It's good to know. I got a Pi Zero W this week and it could reproduce this
> issue as well. I found the data abort was triggered in efi_get_memory_map()
> of efistub.
> 
> Here is the call sequence:
> 
> efi_entry(..)->
>   ......
>   efi_convert_cmdline(..)->
>     ....
>     efi_high_alloc(..)->
>       efi_get_memory_map(..)
> 
> In efi_get_memory_map(..), the data abort should occur before calling the
> boot_service allocate_pool. I tried enabling debug print on u-boot and I
> didn't see a call to allocate_pool after entering into efi_get_memory_map(..)

I have tested and confirmed that the patch from #Comment8 works fine on my Pi-Zero-W.

U-Boot: 2019.10
grub: 2.04
Kernel: 5.4.0-rc7
Comment 12 Guillaume GARDET 2019-12-17 14:25:21 UTC
Fixed u-boot is in Factory.
kernel 5.4 is also in Factory: https://build.opensuse.org/request/show/757388