Hi, I did a few more debugging and wanted to share few more information which are below:
1) I think QEMU does support EL2, because, the following code is working fine. mov \xreg1, #0x33ff msr cptr_el2, \xreg1 /* Disable coprocessor traps to EL2 */ 2) The machine is still in EL3, when its trying to write to SP_EL2. As SP_EL2 can be written from EL3 or EL2, I think there is no permission violation happening due to this. mrs \xreg, CurrentEL /* xreg is 0xc after this line*/ mov \xreg1, sp msr sp_el2, \xreg1 /* Migrate SP */ Please correct me if I am wrong. ------- Original Message ------- Sender : Rajkumar Ramasamy<rajkuma...@samsung.com> Technical Lead/SRI-Bangalore-IoTivity/Samsung Electronics Date : Jul 21, 2016 09:41 (GMT+05:30) Title : Booting armv8 Kernel on UBoot Hi, I am trying to boot ARMv8 Linux kernel using U-Boot. I have built the latest mainline kernel and U-Boot for aarch64 using defconfig. I am testing this build on QEMU V2.6.0. I have loaded the Image file at 0x80080000 "loaded file /home/shingu/workspace/linux/linux_mainline_aarch64/arch/arm64/boot/Image from 80080000 to 80B175FF, 00A97600 bytes" Just before transfering the control to the kernel, U-Boot is trying to switch the exception level to EL2 from EL3, since I have "-machine secure=on" in QEMU parameters. As soon as the stack pointer is migrated, ( mov x0, sp; msr sp_el2, x0) there is an exception occurring, [transferring control to arch/arm/cpu/armv8/exceptions.S:102] which is aborting the boot process with following message: "Synchronous Abort" handler, esr 0x02000000 ELR: fef7caa4 LR: fef7d60c x0 : 00000000fe6fa820 x1 : 0000000000000000 x2 : 00000000fef94a88 x3 : 0000000000000001 x4 : 00000000fe6fa4e0 x5 : 0000000000000020 x6 : ffffff80ffffffc8 x7 : 0000000000000000 x8 : 00000000fe6fa6e0 x9 : 0000000000000002 x10: 00000000fe6fa55b x11: 0000000000000002 x12: 0000000000000002 x13: 00000000ffffffff x14: 0000000083006fff x15: 00000000fef7c8e4 x16: 00000000fef7cb68 x17: 0000000000000000 x18: 00000000fe6fae00 x19: 00000000fefb7b40 x20: 0000000000000000 x21: 0000000080080000 x22: 0000000000000003 x23: 00000000fe6fe058 x24: 0000000000000000 x25: 00000000fefb0918 x26: 0000000000000000 x27: 00000000fef7d6d8 x28: 00000000fe6fe080 x29: 00000000fef7d5ec Resetting CPU ... resetting ... Can anyone please help me to understand what I am doing wrong? The total process is in the following code: [ http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/cpu/armv8/transition.S#l16, http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/include/asm/macro.h#138] Have a pleasant day! :) With Thanks and Regards, Rajkumar R Have a pleasant day! :) With Thanks and Regards, Rajkumar R _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot