All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1715296] [NEW] qemu: invalid serial port configuration
@ 2017-09-06  5:39 Tomasz Rostanski
  2017-09-06  5:40 ` [Qemu-devel] [Bug 1715296] " Tomasz Rostanski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tomasz Rostanski @ 2017-09-06  5:39 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

The tty_serial_init() function sets the port c_oflags as follows:
tty.c_oflag |= OPOST not clearing ONLCR, ONLRET and others.
The result is that the postprocess output is enabled and host translates 0xa (LF) to 0xd 0xa (CR LF) which breaks the binary transmissions on serial port even if you set the port to raw mode (no matters if on host and/or guest).
The issue has been reported 11 years ago on qemu-devel mailing list:
https://lists.nongnu.org/archive/html/qemu-devel/2006-06/msg00196.html
There was also a FreeBSD patch including the fix:
https://lists.freebsd.org/pipermail/freebsd-ports/2006-October/036390.html

I think the correct port configuration is:
tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IMAXBEL);
tty.c_oflag &= ~OPOST;

In such case the host will perform no output processing and will pass the data as is.
And the guest will be able to configure input/output processing exactly as it wants.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1715296

Title:
  qemu: invalid serial port configuration

Status in QEMU:
  New

Bug description:
  The tty_serial_init() function sets the port c_oflags as follows:
  tty.c_oflag |= OPOST not clearing ONLCR, ONLRET and others.
  The result is that the postprocess output is enabled and host translates 0xa (LF) to 0xd 0xa (CR LF) which breaks the binary transmissions on serial port even if you set the port to raw mode (no matters if on host and/or guest).
  The issue has been reported 11 years ago on qemu-devel mailing list:
  https://lists.nongnu.org/archive/html/qemu-devel/2006-06/msg00196.html
  There was also a FreeBSD patch including the fix:
  https://lists.freebsd.org/pipermail/freebsd-ports/2006-October/036390.html

  I think the correct port configuration is:
  tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IMAXBEL);
  tty.c_oflag &= ~OPOST;

  In such case the host will perform no output processing and will pass the data as is.
  And the guest will be able to configure input/output processing exactly as it wants.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1715296/+subscriptions

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-15  7:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06  5:39 [Qemu-devel] [Bug 1715296] [NEW] qemu: invalid serial port configuration Tomasz Rostanski
2017-09-06  5:40 ` [Qemu-devel] [Bug 1715296] " Tomasz Rostanski
2018-06-04 12:33 ` Thomas Huth
2018-08-15  7:25 ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.