On 4/27/25 14:53, 刘聪 wrote: > Hi Dmitry, > > The virglrender patch can fix the virgl issue, but the native context still > fails to run on my machine. > I'm not sure if anyone has successfully run it on an ARM64 machine before.
Thanks for the testing! > When running with Venus, the virtual machine can successfully run vkcube. > However, when using the native context, a KVM error is triggered. Both my > guest and host kernels are already updated to version 6.14. > > Here are the commands and error messages I encountered: > > ``` > phytium@ubuntu:~/working/virglrenderer$ > /opt/native-context-v11/bin/qemu-system-aarch64 --machine > virt,accel=kvm,memory-backend=mem1 -cpu host -smp 4 -m 4G -drive > file=/home/phytium/working/ubuntu24.04-aarch64-native-context,format=raw,if=virtio > -bios /usr/share/AAVMF/AAVMF_CODE.ms.fd -netdev user,id=net0 -device > virtio-net-pci,netdev=net0 -device virtio-gpu-gl,hostmem=4G,blob=on,venus=on > -object memory-backend-memfd,id=mem1,size=4G -display > sdl,gl=on,show-cursor=on -device usb-ehci,id=usb -device usb-mouse,bus=usb.0 > -device usb-kbd,bus=usb.0 > phytium@ubuntu:~/working/virglrenderer$ > phytium@ubuntu:~/working/virglrenderer$ > /opt/native-context-v11/bin/qemu-system-aarch64 --machine > virt,accel=kvm,memory-backend=mem1 -cpu host -smp 4 -m 4G -drive > file=/home/phytium/working/ubuntu24.04-aarch64-native-context,format=raw,if=virtio > -bios /usr/share/AAVMF/AAVMF_CODE.ms.fd -netdev user,id=net0 -device > virtio-net-pci,netdev=net0 -device > virtio-gpu-gl,hostmem=4G,blob=on,drm_native_context=on -object > memory-backend-memfd,id=mem1,size=4G -display sdl,gl=on,show-cursor=on > -device usb-ehci,id=usb -device usb-mouse,bus=usb.0 -device usb-kbd,bus=usb.0 > error: kvm run failed Bad address > PC=0000e2bcbbf31ab0 X00=0000e2bc9c3ae060 X01=0000e2bc7c02af00 > X02=0000000000000014 X03=0000e2bc9c3ae000 X04=0000e2bc7c02af14 > X05=0000e2bc9c3ae074 X06=0000000000000200 X07=0000e2bc7c02a8f8 > X08=00000000000000de X09=0000000000000200 X10=0000000000001000 > X11=0000000000000004 X12=0000e2bc7c0000b0 X13=0000000000000001 > X14=0000000000000020 X15=0000e2bc9e465f93 X16=0000e2bcad6a01f0 > X17=0000e2bcbbf31a80 X18=0000000000000093 X19=0000000000000060 > X20=0000000000000074 X21=0000e2bc9e46c5f0 X22=0000e2bc9c3ae000 > X23=0000000000000074 X24=0000c02241da83b0 X25=0000c02241da85a0 > X26=0000c02241da85a0 X27=0000000000000014 X28=0000e2bc9e46c5f0 > X29=0000e2bc9e46c610 X30=0000e2bcac809c38 SP=0000e2bc9e46c510 > PSTATE=20001000 --C- EL0t > phytium@ubuntu:~/working/virglrenderer$ uname -a > Linux ubuntu 6.14.1-061401-generic #202504071048 SMP PREEMPT_DYNAMIC Mon Apr > 7 11:34:37 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux > ``` Alex Bennée reported the very same problem with KVM on ARM + native ctx AMD dGPU in the past. You may try to add error messages to virt/kvm/kvm_main.c of host Linux kernel to find from where KVM error originates. Sounds like page refcounting may be not working properly on ARM. +CC: Sean Christopherson -- Best regards, Dmitry