Hi, I implemented a sysfs interface for the hypervisor console. This is useful for debugging devices without UARTs. At least as long as the root-cell doesn't crash...
Additionally, I implemented continuous reading of the hypervisor console via /dev/jailhouse, which is a pretty nice and easy way to follow the hypervisor console from Linux. I use a page in the hypervisor's memory space as ringbuffer. If the root cell has a certain permission enabled in its config, the hypervisor won't back that page with empty_page. The Linux driver may then read from that page without any interactions with the hypervisor. We do this without any signalling or locking. Otherwise we would risk starvation of the hypervisor. The producer (hypervisor debug write) only indicates ongoing writes by setting a flag. tree: https://github.com/lfd/jailhouse/tree/hvconsoleV3 PS: maybe we could think of enabling JAILHOUSE_CELL_DEBUG_CONSOLE as a default flag for our demo inmate cell configuration. As Jan already pointed out earlier, none of them is permissive. Ralf since v2: - support continuous reading on /dev/jailhouse as well as non-blocking reads - support overflows of the tail pointer - adopt userspace tool to dump the console (either by switching a command line flag or automatically on errors) - ring buffer size must be a power of two (otherwise modulo fails on tail pointer overflows) - successfully tested on Qemu and Tegra [XK]1 since v1: - refactor JAILHOUSE_CON_TYPE to JAILHOUSE_CON1_TYPE - use JAILHOUSE_CON2_TYPE_ROOTPAGE as permission flag for sysfs console - no extra section in linker file required Ralf Ramsauer (12): configs, core: Refactor JAILHOUSE_CON_TYPE to JAILHOUSE_CON1_TYPE core: declare and define structures used for virtual console core: don't hide console page driver, core: propagate offset of console page core: print console messages to the console page driver: add console sysfs attribute Documentation: add documentation for sysfs console configs: activate sysfs console driver: implement continous console reading on /dev/jailhouse driver: copy the console_page after the hypervisor is disabled tools: move helper function to the top tools: allow to follow console on jailhouse enable Documentation/debug-output.md | 37 +++-- Documentation/sysfs-entries.txt | 3 + Documentation/vga-console.txt | 2 +- TODO.md | 1 - configs/amd-seattle.c | 5 +- configs/bananapi.c | 5 +- configs/f2a88xm-hd3.c | 5 +- configs/foundation-v8.c | 5 +- configs/hikey.c | 4 +- configs/imb-a180.c | 5 +- configs/jetson-tk1.c | 5 +- configs/jetson-tx1.c | 5 +- configs/orangepi0.c | 5 +- configs/qemu-vm.c | 5 +- configs/vexpress.c | 5 +- configs/zynqmp-zcu102.c | 5 +- driver/main.c | 230 ++++++++++++++++++++++++++++- driver/main.h | 3 + driver/sysfs.c | 20 +++ hypervisor/arch/arm-common/dbg-write.c | 10 +- hypervisor/arch/x86/dbg-write.c | 6 +- hypervisor/arch/x86/uart.c | 2 +- hypervisor/hypervisor.lds.S | 6 + hypervisor/include/jailhouse/cell-config.h | 31 ++-- hypervisor/include/jailhouse/header.h | 11 ++ hypervisor/include/jailhouse/printk.h | 3 + hypervisor/paging.c | 2 +- hypervisor/printk.c | 22 ++- hypervisor/setup.c | 13 ++ tools/jailhouse-cell-linux | 2 +- tools/jailhouse-hardware-check | 2 +- tools/jailhouse.c | 78 ++++++++-- tools/root-cell-config.c.tmpl | 5 +- 33 files changed, 466 insertions(+), 82 deletions(-) -- 2.11.0 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
