Hi Claudio, On 03/08/2017 01:37 PM, Claudio Scordino wrote: > Hi Ralf, > > sorry, I didn't recall the discussion on list. > > Using the config currently generated by "jailhouse config create", our > i7 prints junk on the console, unless we manually add such divider. > If this is the intended behavior and we are supposed to add it, then I'm fine. > However, I'm afraid that several newbies could flood the list > complaining that their serial "doesn't work" if we don't properly > document such information. Usually we make the assumption that Linux initialises UARTs beforehand. Setting the divider (or enabling clock gates) is as far as I understand (Jan, please correct me if I'm wrong) an optional feature that can be used, if the root cell doesn't properly setup UARTs (e.g., because it's missing the driver).
What happens if you 'stty -F /dev/ttyS0 115200' before enabling jailhouse? Still garbage? Or just 'stty -F /dev/ttyS0' to see what baudrate your device is currently set to before enabling Jailhouse. You told me off-list that you receive garbage on your serial line -- so I suppose the problem is that Linux set your baudrate just to something else than 115k2. Junk on the serial line is in almost all cases baudrate related. Ralf > > Many thanks and best regards, > > Claudio > > 2017-03-08 20:03 GMT+01:00 Ralf Ramsauer <[email protected]>: >> On 03/08/2017 07:55 AM, Jan Kiszka wrote: >>> On 2017-03-08 15:57, Claudio Scordino wrote: >>>> This patch fixes a regression introduced by commit >>>> 2a7c8733b6a3d47fb507eca4de5a33433199424c >>>> which by default does not initialize the UART divider to 0x1 >>>> on the x86 platform. >> Isn't this intended behaviour? I remember that we had discussions on >> that on the list, and according to the commit message, >> >> ... >> If the divider is zero, the hypervisor will skip UART initialisation and >> assume that the UART was already initialised by Linux. >> ... >> >> All we do on x86 is to skip those four instructions if the divider is zero: >> uart_reg_out(UART_LCR, UART_LCR_DLAB); >> uart_reg_out(UART_DLL, divider & 0xff); >> uart_reg_out(UART_DLM, (divider >> 8) & 0xff); >> uart_reg_out(UART_LCR, UART_LCR_8N1); >> >> which should in deed be done by Linux before, if this is what we define >> default behaviour. >>>> >>>> Signed-off-by: Claudio Scordino <[email protected]> >>>> Signed-off-by: Michele Pes <[email protected]> >>>> --- >>>> tools/root-cell-config.c.tmpl | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/tools/root-cell-config.c.tmpl b/tools/root-cell-config.c.tmpl >>>> index 11956b7..a971f56 100644 >>>> --- a/tools/root-cell-config.c.tmpl >>>> +++ b/tools/root-cell-config.c.tmpl >>>> @@ -62,6 +62,7 @@ struct { >>>> }, >>>> .debug_console = { >>>> .address = 0x3f8, >>>> + .divider = 0x1, >> I'd rather insert this as a comment. >>>> .flags = JAILHOUSE_CON1_TYPE_UART_X86 | >>>> JAILHOUSE_CON1_FLAG_PIO | >>>> JAILHOUSE_CON2_TYPE_ROOTPAGE, >>>> >>> >>> We probably want this fixed for the in-tree x86 configs as well, namely >>> >>> configs/f2a88xm-hd3.c >>> configs/imb-a180.c >>> configs/qemu-vm.c >> Just tested qemu, on my VM everything works fine. >> >> Ralf >>> >>> Ralf, am I right? >>> >>> 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.
