Page MenuHomeFreeBSD

[PPC] Remove extra \0 char inserted on vty by QEMU
ClosedPublic

Authored by luporl on Oct 28 2019, 12:50 PM.
Tags
None
Referenced Files
F82759250: D22171.diff
Thu, May 2, 8:58 AM
Unknown Object (File)
Mon, Apr 15, 2:07 AM
Unknown Object (File)
Mon, Apr 15, 1:58 AM
Unknown Object (File)
Mon, Apr 15, 1:52 AM
Unknown Object (File)
Mon, Apr 15, 1:52 AM
Unknown Object (File)
Mon, Apr 15, 1:28 AM
Unknown Object (File)
Feb 2 2024, 6:36 AM
Unknown Object (File)
Jan 30 2024, 8:07 AM
Subscribers

Details

Summary

Since version 2.11.0, QEMU became bug-compatible with
PowerVM's vty implementation, by inserting a \0 after
every \r going to the guest. Guests are expected to
workaround this issue by removing every \0 immediately
following a \r.

Test Plan

How to reproduce the issue:

  1. Start a FreeBSD VM with QEMU >= 2.11.0, appending -serial pty to its command line.
  2. On the VM, run minicom -H -D /dev/cuauX
  3. On the host, run minicom -H -D /dev/pts/Y
  4. On the host, type something and hit ENTER

The minicom running on the VM will then show an extra 00 char after 0d.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27766
Build 25956: arc lint + arc unit

Event Timeline

sys/powerpc/pseries/phyp_console.c
315–338

Since you're already reading one character at a time, why not copy as you read, instead of the sequence of memmove() operations?

  • Merge branch 'master' into luporl-fix-vty
  • Address review comments
luporl added inline comments.
sys/powerpc/pseries/phyp_console.c
315–338

Ok, done, it looks better now.

I've also added the if (hdr == 1) condition, because the removal of \0's should only be done once per hypervisor read, to avoid removing valid \0's after \r's, when phyp_inbuf is consumed by small reads.

This revision is now accepted and ready to land.Nov 28 2019, 11:17 PM
This revision was automatically updated to reflect the committed changes.