On 2017-01-25 13:11, Ralf Ramsauer wrote: > 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/hvconsoleV5 > > Ralf > > since v4: > - add proper function names > - minor fixes and cleanups > - move documentation to the end > > since v3: > - fix memory barriers > - improve handling of last_page > - don't increment config file revision: we using upper bits for CON2_TYPE > - minor improvements > > 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 > configs: activate sysfs console > driver: implement continous console reading on /dev/jailhouse > driver: copy the console_page after the hypervisor is disabled > tools: implement 'jailhouse console [-f]' > tools: dump error console on failures > Documentation: add documentation for sysfs console > > 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 | 5 +- > 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 | 238 > ++++++++++++++++++++++++++++- > driver/main.h | 2 + > 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 | 9 ++ > hypervisor/include/jailhouse/cell-config.h | 28 ++-- > hypervisor/include/jailhouse/header.h | 11 ++ > hypervisor/include/jailhouse/printk.h | 3 + > hypervisor/paging.c | 2 +- > hypervisor/printk.c | 24 ++- > hypervisor/setup.c | 13 ++ > tools/jailhouse.c | 47 +++++- > tools/root-cell-config.c.tmpl | 5 +- > 31 files changed, 458 insertions(+), 65 deletions(-) >
Thanks, applied to next with two minor adjustment (comment on console.busy and "__jailhouse_console_dump_delta"). Jan -- 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.
