Closed eismog closed 6 months ago
Try to Add nokaslr to cmdline bootargs = "root=/dev/vda nokaslr ";
got qemu-system-aarch64 core dumped [RM]Init completed, disabling UART qemu-system-aarch64: ../target/arm/ptw.c:301: S1_ptw_translate: Assertion `fi->type != ARMFault_None' failed. ./run-qemu.sh: line 150: 11289 Aborted (core dumped) qemu-system-aarch64 -machine virt,virtualization=on,gic-version=3,highmem=off -cpu max,sve128=on -m size=$PLATFORM_DDR_SIZE -smp cpus=8 -nographic -accel tcg,thread=multi -kernel $HYP_IMG_FOLDER/hypvm.elf -device loader,file=$IMGS_FOLDER/virt.dtb,addr=$DT_BASE -device loader,file=$IMGS_FOLDER/Image,addr=$LINUX_BASE -device loader,file=$IMGS_FOLDER/initrd.img,addr=$INITRD_BASE -append "rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=ttyAMA0 nokaslr " ${VIRTIO_BLK_DEVMAP} $ARGS (gunyah-venv) ligf@hyp-dev-env:~/mnt/workspace$
I can break at arch/arm64/kernel/head.S,
add-symbol-file ./../core-utils/build/vmlinux 0x41010000
But I still can't break at start_kernel, qemu-system-aarch64 core dumped with Assertion `fi->type != ARMFault_None' failed.
rebuild qemu-9.0.0 and I can break at pvm start_kernel
=== sudo apt install libusb-1.0-0-dev
wget https://download.qemu.org/qemu-9.0.0.tar.xz tar xvJf qemu-9.0.0.tar.xz cd qemu-9.0.0 ./configure --target-list=aarch64-softmmu --enable-libusb --enable-debug make sudo make install
=== For early debug add-symbol-file ./../core-utils/build/vmlinux 0x41010000
For normal debug add-symbol-file ./../core-utils/build/vmlinux
While debugging, I found that pvm KASLR is enabled: [ 0.000000] KASLR enabled
PVM HLOS mem info [RM]HLOS Mem Base : 40000000 [RM]HLOS Mem Size : 40000000 [RM]HLOS IPA base : 40000000 [RM]HLOS DT Ofst : f00000 [RM]RAM FS offset : 800000
start_kernel addr root@qemuarm64:~# cat /proc/kallsyms |grep start_kernel ffffde1763e27d0c T secondary_start_kernel ffffde1764fb03c0 T start_kernel root@qemuarm64:~# cat /proc/kallsyms |more ffffde1763e00000 T _text
I tried to set a breakpoint, but it didn't work: add-symbol-file ./../core-utils/build/vmlinux 0xFFFFDE1763E00000 b start_kernel