On 24.04.2018 16:13, Jan Kiszka wrote:
On 2018-04-24 15:39, [email protected] wrote:
Hi,

Using the jailhouse console from an inmate requires the cell config to
have the JAILHOUSE_CELL_DEBUG_CONSOLE flag set. If it does not, all
output is silently dropped.

Adding a jailhouse console message stating that an inmate has been
blocked accessing the console is a nice to have from a developer
standpoint but not that useful in production.

Is it worth issuing this notification?

Doable, it's just a bit of "warning: you have debugging disabled".

If so, is it a good idea to have a "DEBUG" version of jailhouse to
activate it?
It looks like there will be a need for warn_once flags in the cell
definition as we just want to warn once, not for every character sent
via the hypercall.

Well... we could attach it to CONFIG_TRACE_ERROR:

diff --git a/hypervisor/control.c b/hypervisor/control.c
index 858ffc745..5cf96c951 100644
--- a/hypervisor/control.c
+++ b/hypervisor/control.c
@@ -876,7 +876,7 @@ long hypercall(unsigned long code, unsigned long
arg1, unsigned long arg2)
        case JAILHOUSE_HC_DEBUG_CONSOLE_PUTC:
                if (!(cpu_data->cell->config->flags &
                      JAILHOUSE_CELL_DEBUG_CONSOLE))
-                       return -EPERM;
+                       return trace_error(-EPERM);
                printk("%c", (char)arg1);
                return 0;
        default:

That won't be warn_once, but it's really simple.
Yes. Actually this is good enough as it helps "keep it simple". I am not fan of adding infrastructure for warn_once until it serves multiple purposes...
I assume you already provided the patch ;-)


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.

Reply via email to