grub-devel
[Top][All Lists]
Advanced

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

Re: GRUB unexpected trap in Itanium


From: Frank Scheiner
Subject: Re: GRUB unexpected trap in Itanium
Date: Fri, 11 Aug 2023 11:24:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Dear Vladimir,

On 11.08.23 03:01, Vladimir 'phcoder' Serbinenko wrote:
Le ven. 11 août 2023, 02:17, Pedro Miguel Justo <pmsjt@texair.net <mailto:pmsjt@texair.net>> a écrit :

    I have bisected the issue and it resulted into the following change:

    ```
    06edd40db76bb78457ac26156ed5f7b62381bbe8 is the first bad commit
    commit 06edd40db76bb78457ac26156ed5f7b62381bbe8
    Author: Oliver Steffen <osteffen@redhat.com
    <mailto:osteffen@redhat.com>>
    Date:   Fri May 26 13:35:43 2023 +0200

         guid: Unify GUID types

         There are 3 implementations of a GUID in GRUB. Replace them with
         a common one, placed in types.h.

         It uses the "packed" flavor of the GUID structs, the alignment
    attribute
         is dropped, since it is not required.

         Signed-off-by: Oliver Steffen <osteffen@redhat.com
    <mailto:osteffen@redhat.com>>
         Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com
    <mailto:daniel.kiper@oracle.com>>
    ```

    The issue is most likely related with an unaligned memory access
    exception resulting from may global GUID variables being changed
    from `grub_efi_guid_t` (which are decorated with `__attribute__
    ((aligned(8)))`) to the new and unified `grub_guid_t` type (now
    decorated with `__attribute__ ((packed))`).

    Do you concur?

That makes perfect sense. Thank you for the analysis. When passing GUID to EFI we need it to be aligned. I propose to partially revert the commit and keep efi_guid either completely separate or to include common guid type as the only structure in it.

Linux actually uses a minimum alignment of 32 bits, see for example [1].

[1]: https://github.com/torvalds/linux/blob/master/include/linux/efi.h#L60-L78

Would that make sense for GRUB, too?

Cheers,
Frank

reply via email to

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