Exception occur when start ubuntu 22.04 using qemu on arm64
jongwu opened this issue · comments
When boot ubuntu 22.04 using qemu on arm64, exception occurs:
FSOpen: Open '\EFI\BOOT\fbaa64.efi' Success
FSOpen: Open '\EFI\BOOT\fbaa64.efi' Success
SetMemoryAttributes: BaseAddress == 0x13C6F0000, Length == 0x19000, Attributes == 0x4000
ClearMemoryAttributes: BaseAddress == 0x13C6F0000, Length == 0x19000, Attributes == 0x22000
Synchronous Exception at 0x000000013C6F4000
Synchronous Exception at 0x000000013C6F4000
PC 0x00013C6F4000
PC 0x00013C7593F4
PC 0x00013C759608
PC 0x00013C75A32C
PC 0x00013C757030
PC 0x00004786A468 (0x000047863000+0x00007468) [ 1] DxeCore.dll
PC 0x00013FCDC688 (0x00013FCD6000+0x00006688) [ 2] BdsDxe.dll
PC 0x00013FCDF670 (0x00013FCD6000+0x00009670) [ 2] BdsDxe.dll
PC 0x00004786CD88 (0x000047863000+0x00009D88) [ 3] DxeCore.dll
[ 1] /root/jong/firmware/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll
[ 2] /root/jong/firmware/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/MdeModulePkg/Universal/BdsDxe/BdsDxe/DEBUG/BdsDxe.dll
[ 3] /root/jong/firmware/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll
X0 0x000000013F2A3498 X1 0x000000013FFD0018 X2 0x000000013C6F4000 X3 0x0000000000000000
X4 0x000000013FD4C0E8 X5 0x0000000047862400 X6 0x000000008000004F X7 0x0000000000000000
X8 0x00000000478623D0 X9 0x000000013C6F0000 X10 0x0000000000000003 X11 0x0000000000000000
X12 0x0000000000000002 X13 0x0000000000000002 X14 0x0000000000000001 X15 0x0000000000000002
X16 0x000000013FD45324 X17 0x00000000C19CD528 X18 0x0000000000000011 X19 0x000000013C7D8000
X20 0x0000000000000000 X21 0x000000013F2A3498 X22 0x000000013C7EC930 X23 0x0000000000000001
X24 0x000000013C7EC000 X25 0x000000013C7EC9F8 X26 0x000000013C7ECA00 X27 0x000000013C7ECA08
X28 0x000000013C7ECA10 FP 0x0000000047862740 LR 0x000000013C7593F4
V0 0xAFAFAFAFAFAFAFAF AFAFAFAFAFAFAFAF V1 0x0000000000000000 0000000000000000
V2 0x0000000000000000 0000000000000000 V3 0x0000000000000000 0000000000000000
V4 0x0000000000000000 0000000000000000 V5 0x0000000000000000 0000000000000000
V6 0x0000000000000000 0000000000000000 V7 0x0000000000000000 0000000000000000
V8 0x0000000000000000 0000000000000000 V9 0x0000000000000000 0000000000000000
V10 0x0000000000000000 0000000000000000 V11 0x0000000000000000 0000000000000000
V12 0x0000000000000000 0000000000000000 V13 0x0000000000000000 0000000000000000
V14 0x0000000000000000 0000000000000000 V15 0x0000000000000000 0000000000000000
V16 0x0000000000000000 0000000000000000 V17 0x0000000000000000 0000000000000000
V18 0x0000000000000000 0000000000000000 V19 0x0000000000000000 0000000000000000
V20 0x0000000000000000 0000000000000000 V21 0x0000000000000000 0000000000000000
V22 0x0000000000000000 0000000000000000 V23 0x0000000000000000 0000000000000000
V24 0x0000000000000000 0000000000000000 V25 0x0000000000000000 0000000000000000
V26 0x0000000000000000 0000000000000000 V27 0x0000000000000000 0000000000000000
V28 0x0000000000000000 0000000000000000 V29 0x0000000000000000 0000000000000000
V30 0x0000000000000000 0000000000000000 V31 0x0000000000000000 0000000000000000
SP 0x0000000047862740 ELR 0x000000013C6F4000 SPSR 0x60000205 FPSR 0x00000000
ESR 0x8600000F FAR 0x000000013C6F4000
ESR : EC 0x21 IL 0x1 ISS 0x0000000F
Instruction abort: Permission fault, third level
Stack dump:
0000047862640: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
0000047862660: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
0000047862680: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
00000478626A0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
00000478626C0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
00000478626E0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
0000047862700: 0000000000000000 0000000000000000 000000013FD49A74 0000000040000304
0000047862720: 0000000000000000 000000008600000F 000000013C6F4000 000000013C709098
> 0000047862740: 00000000478627A0 000000013C759608 0000000000000001 000000013C7D8000
0000047862760: 000000013F2A3498 0000000000000000 00016018478627A0 000000013C6F4000
0000047862780: 000000013C6F0000 0000000000000019 000000013CB41D18 000000013C709018
00000478627A0: 0000000047862800 000000013C75A32C 0000000000000000 000000013C757428
00000478627C0: 000000013C7EC9DF 000000013F2A3498 0000000047862870 000000013C75A2F0
00000478627E0: 000000013E6CF040 000000013F234030 000000013F2466A0 000000013E6CE6A0
0000047862800: 00000000478628A0 000000013C757030 0000000000000000 0000000000000000
0000047862820: 000000013FCEE000 0000000000000000 0000000000000001 000000013FCEE1B8
ASSERT [ArmCpuDxe] /root/jong/firmware/edk2/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c(333): ((BOOLEAN)(0==1))
Hello,
After some more debugging, @jongwu was able to pinpoint the problem to an issue that was fixed previously:
#539
Essentially update_mem_attrs
was being called with size
parameter that was unaligned to PAGE_SIZE
(due to the segment size being unaligned) which failed. A subsequent call was then attempted to non-executable code.
This bug can be closed as a duplicate, that's already been fixed thankfully :-)
We'll follow up on the distro side.
Cheers,
Steve
Thanks @stevecapperarm -, I will close this.