Seems that this patch is a step forward for arm-efi (32 bits), and doesn't affect others EFI targets (arm64-efi, i386-efi and x86_64-efi are still working fine, including the aarch64-laptop). So it's definitely better than nothing. However, for arm-efi (32 bits), as opposed to the previously suggested revert, this patch fails with some QEMU firmwares :

 * --target=arm-linux-gnueabihf  --with-platform=efi
     o fine with u-boot
     o fine with https://efi.akeo.ie/QEMU_EFI/
     o *not running fine* with "AAVMF32_code.fd" available into Debian
       "qemu-efi-arm" package (buster and sid) : continuous rain of
       Exception messages
     o *not running fine* with recent versions of :
       
http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-ARM/
       Welcome to Grub! Followed by 2 exception messages

 * --target=aarch64-linux-gnu --with-platform=efi
     o fine with QEMU
     o fine with Asus NovaGo TP370QL (Qualcomm Snapdragon 835)

 * --target=i386  --with-platform=efi
     o fine with QEMU

 * --target=x86_64  --with-platform=efi
     o fine with QEMU
     o fine with an Asus R510JK-DM086H (Intel Core-i5 4200H)

Screencap of the arm-efi error is attached, with a "Debug" firmware, in case it's possible to learn something from the displayed error. Instructions I followed to create the efi files, and to run QEMU against an USB stick image containing those files, are attached too. I can confirm that the previously suggested revert works fine with arm-efi and the same firmware, _so the failure is linked to the new alignment_.

May be something more in the code should be changed somewhere else to follow the new alignment ? Or some differences between firmwares involved in the test ?

Best regards,
Julien


On 4/29/19 11:07 AM, Daniel Kiper wrote:
On Sun, Apr 28, 2019 at 12:55:42AM +0200, Alexander Graf wrote:
The arm relocation code has a manual special case for EFI binaries to
add the natural alignment to its own relocation awareness.

Since commit a51f953f4ee87 ("mkimage: Align efi sections on 4k
boundary") we changed that alignment from 0x400 to 0x1000 bytes. Reflect
the change in that branch that we forgot as well.

This fixes running 32bit arm grub efi binaries for me again.

Fixes: a51f953f4ee87 ("mkimage: Align efi sections on 4k boundary")
Reported-by: Heinrich Schuchardt<[email protected]>
Reported-by: Steve McIntyre<[email protected]>
Signed-off-by: Alexander Graf<[email protected]>
Reviewed-by: Daniel Kiper<[email protected]>

However, I will apply this patch if I get some Tested-by and I am sure
that other EFI targets are not affected.

Daniel

PS FYI, I am on vacation this week. So, I will take care about
    urgent stuff only. Sorry about that.
#arm-efi build
cd grub && ./bootstrap && ./configure --target=arm-linux-gnueabihf 
--with-platform=efi --prefix=/home/user/Desktop/grub-arm-32/ && make -j 8 && 
make install && /home/user/Desktop/grub-arm-32/bin/grub-mkstandalone -o 
bootarm.efi -O arm-efi --directory 
/home/user/Desktop/grub-arm-32/lib/grub/arm-efi/

#arm64-efi build
cd grub && ./bootstrap && ./configure --target=aarch64-linux-gnu 
--with-platform=efi --prefix=/home/user/Desktop/grub-arm-64/ && make -j 8 && 
make install && /home/user/Desktop/grub-arm-64/bin/grub-mkstandalone -o 
bootaa64.efi -O arm64-efi --directory 
/home/user/Desktop/grub-arm-64/lib/grub/arm64-efi/

#i386-efi build
cd grub && ./bootstrap && ./configure --target=i386 --with-platform=efi 
--prefix=/home/user/Desktop/grub-x86_32/ && make -j 8 && make install && 
/home/user/Desktop/grub-x86_32/bin/grub-mkstandalone -o bootia32.efi -O 
i386-efi --directory /home/user/Desktop/grub-x86_32/lib/grub/i386-efi/

#x86_64-efi build
cd grub && ./bootstrap && ./configure --target=x86_64 --with-platform=efi 
--prefix=/home/user/Desktop/grub-x86_64/ && make -j 8 && make install && 
/home/user/Desktop/grub-x86_64/bin/grub-mkstandalone -o bootx64.efi -O 
x86_64-efi --directory /home/user/Desktop/grub-x86_64/lib/grub/x86_64-efi/


#arm-efi test :
wget 
http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-ARM/RELEASE_GCC5/QEMU_EFI.fd
#renamed QEMU_EFI_ARM.fd
qemu-system-arm -M virt -m 512 -net none -monitor none -parallel none -L ./ 
-bios QEMU_EFI_ARM.fd -drive format=raw,file=../grub-efi-esp-arm-intel-32-64.img
#Work with u-boot and akeo - problem with others

#arm64-efi test :
wget 
http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd
#renamed QEMU_EFI_AA64.fd
qemu-system-aarch64 -M virt -cpu cortex-a57 -m 2048 -monitor none -parallel 
none -L ./ -bios QEMU_EFI_AA64.fd -drive 
format=raw,file=../grub-efi-esp-arm-intel-32-64.img

#i386-efi test :
#https://www.kraxel.org/repos/jenkins/edk2/edk2.git-ovmf-ia32-0-20190308.1033.ge2d3a25f1a.noarch.rpm
#Extracted OVMF-pure-efi.fd
qemu-system-i386 -m 2048 -smp 4 -L ./ -bios OVMF-pure-efi.fd -vga virtio -drive 
format=raw,file=../grub-efi-esp-arm-intel-32-64.img

#x86_64-efi test :
apt install ovmf
qemu-system-x86_64 -m 2048 -smp 4 -L /usr/share/ovmf -bios OVMF.fd -vga virtio 
-drive format=raw,file=../grub-efi-esp-arm-intel-32-64.img
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to