Skip to contentSkip to conversation

qemuarm64: cleanup and Add graphics support

RFC New Jon Mason 1 participant 3 messages Feb 28, 2019

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

cover qemuarm64: cleanup and Add graphics support

This series is dependent on the yocto-kernel-cache RFC series similarly named. See
https://lists.yoctoproject.org/pipermail/linux-yocto/2019-February/007580.html

This series cleans up the hvc0 respawning issue, by removing the reference in meta/conf/machine/qemuarm64.conf. So virtio console will not work, but I don't think it was properly working before. A bug should be opened to track this and correct it when a solution is found.

Also, graphics support is added by using the QEMU VGA device, which emulates a Bochs VGA PCI adapter. Virtio would be a superior implementation (in theory), but I was unable to get it working fully. A bug should be opened to track this and switch to using virtio when the issue(s) can be resolved.

Finally, when starting the graphics, a kernel warning is issued. It is not fatal and graphics work despite the warning. However, this might be unacceptable. For the record, it is:

[   18.370702] ------------[ cut here ]------------
[   18.382099] WARNING: CPU: 0 PID: 446 at drivers/gpu/drm/ttm/ttm_bo_vm.c:303 ttm_bo_vm_open+0x3c/0x4c
[   18.383267] Modules linked in:
[   18.383789] CPU: 0 PID: 446 Comm: Xorg Not tainted 4.19.19-yocto-standard #1
[   18.383964] Hardware name: Generic DT based system
[   18.384508] [<c021306c>] (unwind_backtrace) from [<c020d174>] (show_stack+0x20/0x24)
[   18.384719] [<c020d174>] (show_stack) from [<c09964a0>] (dump_stack+0x84/0xa4)
[   18.384904] [<c09964a0>] (dump_stack) from [<c0231dd0>] (__warn+0xe8/0x104)
[   18.385114] [<c0231dd0>] (__warn) from [<c0232180>] (warn_slowpath_null+0x4c/0x58)
[   18.385300] [<c0232180>] (warn_slowpath_null) from [<c072b408>] (ttm_bo_vm_open+0x3c/0x4c)
[   18.385499] [<c072b408>] (ttm_bo_vm_open) from [<c0230718>] (copy_process.part.3+0x13c4/0x17f0)
[   18.385703] [<c0230718>] (copy_process.part.3) from [<c0230ce8>] (_do_fork+0xc8/0x414)
[   18.385907] [<c0230ce8>] (_do_fork) from [<c0231154>] (sys_clone+0x30/0x38)
[   18.386108] [<c0231154>] (sys_clone) from [<c0201000>] (ret_fast_syscall+0x0/0x4c)
[   18.386308] Exception stack(0xde279fa8 to 0xde279ff0)
[   18.386477] 9fa0:                   b6ef7078 b6f03000 01200011 00000000 00000000 00000000
[   18.386672] 9fc0: b6ef7078 b6f03000 b6ef74d0 00000078 00000000 b6ef7010 0051b03d be9bc9fc
[   18.386857] 9fe0: 00000078 be9ba8a8 b6ad564d b6a7ac46
[   18.387096] ---[ end trace e8a5e15e3b7db8a9 ]---

Given these number of issues, I wanted to post this as a request for comment to see if this is acceptable to the community. If it is acceptable, I will open the bugs mentioned above.

I have made similar modifications to qemuarma15, and can resubmit them if the solution above is acceptable. However, I thought using qemuarm64 was a cleaner way to show what was done and start the dialog.

Thanks,
Jon

Jon Mason (2):
qemuarm64: fix hvc0 error and cleanup
qemuarm64: Add graphics support

 meta/conf/machine/qemuarm64.conf | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
Signature · 1 line
2.17.2
author
#1 lore raw

RFC 1/2 qemuarm64: fix hvc0 error and cleanup

The following error is being frequently posted
INIT: Id "hvc0" respawning too fast: disabled for 5 minutes

Remove the references to hvc0 to work around this error. Also, add some comments to describe what is going on.

---
 meta/conf/machine/qemuarm64.conf | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
meta/conf/machine/qemuarm64.conf +8 -5
index ee19385eaf..8d4a482fec 100644
@@ -7,20 +7,23 @@ require conf/machine/include/qemu.inc
 
 KERNEL_IMAGETYPE = "Image"
 
-SERIAL_CONSOLES ?= "38400;ttyAMA0 38400;hvc0"
+SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;tty1"
 
 # For runqemu
 QB_SYSTEM_NAME = "qemu-system-aarch64"
 QB_MEM = "-m 512"
 QB_MACHINE = "-machine virt"
 QB_CPU = "-cpu cortex-a57"
-QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0,38400"
-# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+# We need both ttyAMA0 and tty1 to allow for this to work in the stdio mode or the normal mode
+QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0 console=tty1"
 QB_OPT_APPEND = "-show-cursor -monitor null"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
+# Virtio Networking support
 QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
 QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
+# Virtio block device
 QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
-QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
-QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
+# Virtio serial console
+QB_SERIAL_OPT = "-device virtio-serial-device -chardev vc,id=virtcon -device virtconsole,chardev=virtcon"
+QB_TCPSERIAL_OPT = "-device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
Signature · 1 line
2.17.2
author
#2 lore raw

RFC 2/2 qemuarm64: Add graphics support

In reply to Jon Mason

Add the necessary parts to qemuarm64.conf for graphics to be shown in the SDL window, and USB so that it is possible to interact with it.

---
 meta/conf/machine/qemuarm64.conf | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/conf/machine/qemuarm64.conf +5 -1
index 8d4a482fec..e8362260b9 100644
@@ -16,7 +16,9 @@ QB_MACHINE = "-machine virt"
 QB_CPU = "-cpu cortex-a57"
 # We need both ttyAMA0 and tty1 to allow for this to work in the stdio mode or the normal mode
 QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0 console=tty1"
-QB_OPT_APPEND = "-show-cursor -monitor null"
+# For graphics to work we need to define the VGA device as well as the necessary USB devices
+QB_OPT_APPEND = "-show-cursor -device VGA"
+QB_OPT_APPEND += "-device qemu-xhci -device usb-tablet -device usb-kbd"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
 # Virtio Networking support
@@ -27,3 +29,5 @@ QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio
 # Virtio serial console
 QB_SERIAL_OPT = "-device virtio-serial-device -chardev vc,id=virtcon -device virtconsole,chardev=virtcon"
 QB_TCPSERIAL_OPT = "-device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
+
+PREFERRED_VERSION_linux-yocto ?= "4.19%"
Signature · 1 line
2.17.2