Jonas Meurer
2013-May-13 15:58 UTC
[Pkg-xen-devel] Serial Passthrough broken in Debian Wheezy?
Hello, I just discovered a strange bug with serial passthrough in xen 4.1 on Debian Wheezy. The Dom0 has a GSM modem connected to serial port. The serial port is passed through to a DomU with options 'irq = [ 4 ]' and 'ioports = [ '3f8-3ff ]'. This worked as expected on Debian Squeeze with Xen 4.0 and Linux kernel 2.6.32 (both for Dom0 and DomU). On Debian Wheezy with Xen 4.1 and Linux kernel 3.2.0 the passthrough seems to work as well (/dev/ttyS0 appears in dmesg of DomU), but something is wrong. The GSM modem doesn't behave as expected. The smstools daemon errors out with 'Cannot open serial port /dev/ttyS0, error: Function not implemented'. It took me hours to find the difference, but it seems like the guest (domU) kernel is the problem. The setup keeps working when Dom0 is upgraded to Debian Wheezy with Xen 4.1 and linux kernel 3.2.0. It even keeps working if the DomU userland is upgraded to Debian Wheezy. Only if I upgrade the DomU linux kernel to 3.2.0 from Wheezy as well, smstools stops working. I don't expect this to be a smstools bug. More likely, something regarding serial pass through functions of xen is broken in 3.2.0 kernel from Debian Wheezy. Did anybody else discover similar issues yet? Kind regards, jonas PS: I'm not subscribed to pkg-xen-devel at lists.alioth.debian.org, please cc me on that list.
Jonas Meurer
2013-May-14 12:56 UTC
[Pkg-xen-devel] [Xen-users] Serial Passthrough broken in Debian Wheezy?
Hey again, Am 13.05.2013 17:58, schrieb Jonas Meurer:> I just discovered a strange bug with serial passthrough in xen 4.1 on > Debian Wheezy. The Dom0 has a GSM modem connected to serial port. The > serial port is passed through to a DomU with options 'irq = [ 4 ]' > and > 'ioports = [ '3f8-3ff ]'.While searching the list archives I found out, that latest Xen 4.1 has several issues with passthrough. But so far it seems to me like nobody else described my exact issue before. Apparently, the other passthrough issues have been introduced by a hypervisor update. My problem appeared after a kernel upgrade. And for me, DomU creation still works. As described, the passed through serial even exists in DomU. Only it doesn't behave as expected. Just wanted to share those additional observations. Kind regards, jonas> > This worked as expected on Debian Squeeze with Xen 4.0 and Linux > kernel > 2.6.32 (both for Dom0 and DomU). On Debian Wheezy with Xen 4.1 and > Linux kernel 3.2.0 the passthrough seems to work as well (/dev/ttyS0 > appears in dmesg of DomU), but something is wrong. The GSM modem > doesn't behave as expected. The smstools daemon errors out with > 'Cannot > open serial port /dev/ttyS0, error: Function not implemented'. > > It took me hours to find the difference, but it seems like the guest > (domU) kernel is the problem. The setup keeps working when Dom0 is > upgraded to Debian Wheezy with Xen 4.1 and linux kernel 3.2.0. It > even > keeps working if the DomU userland is upgraded to Debian Wheezy. Only > if I upgrade the DomU linux kernel to 3.2.0 from Wheezy as well, > smstools stops working. > > I don't expect this to be a smstools bug. More likely, something > regarding serial pass through functions of xen is broken in 3.2.0 > kernel from Debian Wheezy. > > Did anybody else discover similar issues yet? > > Kind regards, > jonas > > PS: I'm not subscribed to pkg-xen-devel at lists.alioth.debian.org, > please > cc me on that list. > > _______________________________________________ > Xen-users mailing list > Xen-users at lists.xen.org > http://lists.xen.org/xen-users
Hello, did anybody else discover issue with serial passthrough on Linux 3.2.0 from Debbian Wheezy? Kind redgards, jonas Am 2013-05-14 14:56, schrieb Jonas Meurer:> Hey again, > > Am 13.05.2013 17:58, schrieb Jonas Meurer: >> I just discovered a strange bug with serial passthrough in xen 4.1 on >> Debian Wheezy. The Dom0 has a GSM modem connected to serial port. The >> serial port is passed through to a DomU with options ''irq = [ 4 ]'' and >> ''ioports = [ ''3f8-3ff ]''. > > While searching the list archives I found out, that latest Xen 4.1 has > several issues with passthrough. But so far it seems to me like nobody > else described my exact issue before. Apparently, the other passthrough > issues have been introduced by a hypervisor update. My problem appeared > after a kernel upgrade. And for me, DomU creation still works. As > described, the passed through serial even exists in DomU. Only it > doesn''t behave as expected. > > Just wanted to share those additional observations. > > Kind regards, > jonas > >> >> This worked as expected on Debian Squeeze with Xen 4.0 and Linux >> kernel >> 2.6.32 (both for Dom0 and DomU). On Debian Wheezy with Xen 4.1 and >> Linux kernel 3.2.0 the passthrough seems to work as well (/dev/ttyS0 >> appears in dmesg of DomU), but something is wrong. The GSM modem >> doesn''t behave as expected. The smstools daemon errors out with >> ''Cannot >> open serial port /dev/ttyS0, error: Function not implemented''. >> >> It took me hours to find the difference, but it seems like the guest >> (domU) kernel is the problem. The setup keeps working when Dom0 is >> upgraded to Debian Wheezy with Xen 4.1 and linux kernel 3.2.0. It even >> keeps working if the DomU userland is upgraded to Debian Wheezy. Only >> if I upgrade the DomU linux kernel to 3.2.0 from Wheezy as well, >> smstools stops working. >> >> I don''t expect this to be a smstools bug. More likely, something >> regarding serial pass through functions of xen is broken in 3.2.0 >> kernel from Debian Wheezy. >> >> Did anybody else discover similar issues yet? >> >> Kind regards, >> jonas >> >> PS: I''m not subscribed to pkg-xen-devel@lists.alioth.debian.org, >> please >> cc me on that list. >> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xen.org >> http://lists.xen.org/xen-users > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users
On Mon, 2013-06-03 at 17:25 +0200, Jonas Meurer wrote:> Hello, > > did anybody else discover issue with serial passthrough on Linux 3.2.0 > from Debbian Wheezy?I haven''t, but Squeeze was based on the out of tree xen.git kernel while Wheezy uses the mainline pvops support, so this is probably an issue with the mainline kernel. I can''t quite imagine what it would be though. Are you able to try an newer upstream kernel in your domU? Either a newer version from Debian Sid or wheezy-backports or a self compiled one. Ian.> > Kind redgards, > jonas > > > Am 2013-05-14 14:56, schrieb Jonas Meurer: > > Hey again, > > > > Am 13.05.2013 17:58, schrieb Jonas Meurer: > >> I just discovered a strange bug with serial passthrough in xen 4.1 on > >> Debian Wheezy. The Dom0 has a GSM modem connected to serial port. The > >> serial port is passed through to a DomU with options ''irq = [ 4 ]'' and > >> ''ioports = [ ''3f8-3ff ]''. > > > > While searching the list archives I found out, that latest Xen 4.1 has > > several issues with passthrough. But so far it seems to me like nobody > > else described my exact issue before. Apparently, the other passthrough > > issues have been introduced by a hypervisor update. My problem appeared > > after a kernel upgrade. And for me, DomU creation still works. As > > described, the passed through serial even exists in DomU. Only it > > doesn''t behave as expected. > > > > Just wanted to share those additional observations. > > > > Kind regards, > > jonas > > > >> > >> This worked as expected on Debian Squeeze with Xen 4.0 and Linux > >> kernel > >> 2.6.32 (both for Dom0 and DomU). On Debian Wheezy with Xen 4.1 and > >> Linux kernel 3.2.0 the passthrough seems to work as well (/dev/ttyS0 > >> appears in dmesg of DomU), but something is wrong. The GSM modem > >> doesn''t behave as expected. The smstools daemon errors out with > >> ''Cannot > >> open serial port /dev/ttyS0, error: Function not implemented''. > >> > >> It took me hours to find the difference, but it seems like the guest > >> (domU) kernel is the problem. The setup keeps working when Dom0 is > >> upgraded to Debian Wheezy with Xen 4.1 and linux kernel 3.2.0. It even > >> keeps working if the DomU userland is upgraded to Debian Wheezy. Only > >> if I upgrade the DomU linux kernel to 3.2.0 from Wheezy as well, > >> smstools stops working. > >> > >> I don''t expect this to be a smstools bug. More likely, something > >> regarding serial pass through functions of xen is broken in 3.2.0 > >> kernel from Debian Wheezy. > >> > >> Did anybody else discover similar issues yet? > >> > >> Kind regards, > >> jonas > >> > >> PS: I''m not subscribed to pkg-xen-devel@lists.alioth.debian.org, > >> please > >> cc me on that list. > >> > >> _______________________________________________ > >> Xen-users mailing list > >> Xen-users@lists.xen.org > >> http://lists.xen.org/xen-users > > > > > > _______________________________________________ > > Xen-users mailing list > > Xen-users@lists.xen.org > > http://lists.xen.org/xen-users > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users
Jonas Meurer
2013-Jun-19 15:13 UTC
Re: Bug#708344: Serial Passthrough broken in Debian Wheezy?
Hello Ian, first, thanks for the advices to further debug this issue. Your help is really appreciated! Am 2013-06-05 12:11, schrieb Ian Campbell:> Thanks. I''m taking this to xen-devel and moving the other two lists to > bcc. For xen-devel the background can be found at > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708344 > > The gist is that with: > irq = [ 4 ] > ioports = [ ''3f8-3ff'' ] > > in the guest config the serial port used to work with Jeremy''s xen.git > (used in Squeeze) but doesn''t work with Wheezy (3.2 based) or a 3.9 > kernel. The smstools daemon fails with: > Cannot open serial port /dev/ttyS0, error: Function not > implemented > > Jonas'' dmesg shows: > [ 0.196892] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled > [ 0.217565] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > > and /proc/ioports shows the region but /proc/interrupts does not > AFAICT. > I can''t see any interrupt related errors. Jonas can you confirm that > the > dmesg includes the logs resulting from an attempt to open the device?No, unfortunately I can not. With any new kernel (3.2 or 3.9), no messages appear in dmesg when either smsd or picocom try to connect to the serial port.> Jonas, could you try a few more experiments, if you don''t mind:Sure. Unfortunately I don''t have much experiences with serial ports, so you might need to give more advices.> Can you use something simpler (like picocom) rather than smsdaemon and > see if that works.I tried to open with picocom (''picocom /dev/ttyS0''). It resulted in the following error output: # picocom /dev/ttyS0 picocom v1.7 port is : /dev/ttyS0 flowcontrol : none baudrate is : 9600 parity is : none databits are : 8 escape is : C-a local echo is : no noinit is : no noreset is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv imap is : omap is : emap is : crcrlf,delbs, FATAL: failed to add device /dev/ttyS0: Filedes is not a tty> Assuming not could you strace it so we can see what > is actually failing. If those attempts result in anything extra in the > dmesg please can you post it.I tried ''strace -o strace.log -ff -s 1024 -v smsd -u smsd -g dialout -t''. All resulting strace.log.* Logfiles are attached. I guess that strace.log.4521 is the interesting one. At least this is the only logfile that contains ''ttyS0''.> It ought to be possible to set the port to polled mode, I think by > setting the IRQ to -1 with setserial or I think it should be possible > on > the command line but I can''t seem to figure out how... Anyway, if you > can get that to work it might be interesting...Sorry, don''t know nothing about this. What is ''polled mode''? I''m happy to do more testing, but would need more detailed advices ;) Kind regards, jonas _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Jonas Meurer
2013-Jul-04 22:03 UTC
Re: Bug#708344: Serial Passthrough broken in Debian Wheezy?
Hey again, any news on that? Maybe someone has advice for me on how to go on with debugging the issue? I''d love to help squashing that bug, but simply don''t know what do do next. Kind regards, jonas Am 19.06.2013 17:13, schrieb Jonas Meurer:> first, thanks for the advices to further debug this issue. Your help is > really appreciated! > > Am 2013-06-05 12:11, schrieb Ian Campbell: >> Thanks. I''m taking this to xen-devel and moving the other two lists to >> bcc. For xen-devel the background can be found at >> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708344 >> >> The gist is that with: >> irq = [ 4 ] >> ioports = [ ''3f8-3ff'' ] >> >> in the guest config the serial port used to work with Jeremy''s xen.git >> (used in Squeeze) but doesn''t work with Wheezy (3.2 based) or a 3.9 >> kernel. The smstools daemon fails with: >> Cannot open serial port /dev/ttyS0, error: Function not >> implemented >> >> Jonas'' dmesg shows: >> [ 0.196892] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled >> [ 0.217565] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >> >> and /proc/ioports shows the region but /proc/interrupts does not AFAICT. >> I can''t see any interrupt related errors. Jonas can you confirm that the >> dmesg includes the logs resulting from an attempt to open the device? > > No, unfortunately I can not. With any new kernel (3.2 or 3.9), no > messages appear in dmesg when either smsd or picocom try to connect to > the serial port. > >> Jonas, could you try a few more experiments, if you don''t mind: > > Sure. Unfortunately I don''t have much experiences with serial ports, so > you might need to give more advices. > >> Can you use something simpler (like picocom) rather than smsdaemon and >> see if that works. > > I tried to open with picocom (''picocom /dev/ttyS0''). It resulted in the > following error output: > > # picocom /dev/ttyS0 > picocom v1.7 > > port is : /dev/ttyS0 > flowcontrol : none > baudrate is : 9600 > parity is : none > databits are : 8 > escape is : C-a > local echo is : no > noinit is : no > noreset is : no > nolock is : no > send_cmd is : sz -vv > receive_cmd is : rz -vv > imap is : > omap is : > emap is : crcrlf,delbs, > > > FATAL: failed to add device /dev/ttyS0: Filedes is not a tty > >> Assuming not could you strace it so we can see what >> is actually failing. If those attempts result in anything extra in the >> dmesg please can you post it. > > I tried ''strace -o strace.log -ff -s 1024 -v smsd -u smsd -g dialout > -t''. All resulting strace.log.* Logfiles are attached. I guess that > strace.log.4521 is the interesting one. At least this is the only > logfile that contains ''ttyS0''. > >> It ought to be possible to set the port to polled mode, I think by >> setting the IRQ to -1 with setserial or I think it should be possible on >> the command line but I can''t seem to figure out how... Anyway, if you >> can get that to work it might be interesting... > > Sorry, don''t know nothing about this. What is ''polled mode''? I''m happy > to do more testing, but would need more detailed advices ;) > > Kind regards, > jonas > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users >