bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #43632] GRUB crashes on the Raspberry Pi


From: David Kozub
Subject: [bug #43632] GRUB crashes on the Raspberry Pi
Date: Tue, 18 Nov 2014 19:56:58 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.2.0

URL:
  <http://savannah.gnu.org/bugs/?43632>

                 Summary: GRUB crashes on the Raspberry Pi
                 Project: GNU GRUB
            Submitted by: zub
            Submitted on: Tue 18 Nov 2014 07:56:57 PM GMT
                Category: Booting
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: Git master
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

My environment:

* Raspbbery Pi B 2.0
* U-boot master (commit bdf1638)
* GRUB master (commit 004a2b1)
* toolchain gcc-linaro-arm-linux-gnueabihf-raspbian-x64 from
git://github.com/raspberrypi/tools.git (commit b0c3db7)
* I compiled grub with ./configure --target=arm-linux-gnueabihf but I've also
tested native build (with toolchain that comes with raspbian) with the same
result
* I'm loading GRUB like this: usb start;fatload mmc 0:1 0x20000
${fdtfile};tftp 0x40000 core.img;bootm 0x40000 - 0x20000

What I see on the serial is:

---
## Booting kernel from Legacy Image at 00040000 ...
   Image Name:   
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    269020 Bytes = 262.7 KiB
   Load Address: 08000000
   Entry Point:  08000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 00020000
   Booting using the fdt blob at 0x020000
   Loading Kernel Image ... OK
   Loading Device Tree to 1eb47000, end 1eb4af7a ... OK

Starting kernel ...

0 crossers
MMU tables generated
enabling MMU
MMU enabled
data abort
pc : [<080092dc>]          lr : [<08054d54>]
sp : 08054d38  ip : 00000000     fp : 00000000
r10: 1eb4d644  r9 : 1eb4cef8     r8 : 80000000
r7 : 00000000  r6 : 00000000     r5 : 00000000  r4 : 00000008
r3 : 00000000  r2 : 0000000d     r1 : 00000000  r0 : 000000c7
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...
---

I think the issue is an unaligned 64bit local variable in __aeabi_uidivmod()
(in grub-core/kern/arm/misc.S).

__aeabi_uidivmod() calls grub_divmod64(), passing it a pointer to
grub_uint64_t as the last argument. At least with my toolchain grub_divmod64()
uses the STRD instruction to store a value into the 64bit variable. But as the
value is not aligned at 8 bytes, an exception occurrs.

Attached is a patch that solves this for me.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 18 Nov 2014 07:56:57 PM GMT  Name:
0001-grub-core-kern-arm-misc.S-fix-unaligned-grub_uint64_.patch  Size: 2kB  
By: zub
Proposed patch.
<http://savannah.gnu.org/bugs/download.php?file_id=32466>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43632>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]