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
Unknown Object (File)
Tue, Sep 30, 12:26 AM
Unknown Object (File)
Thu, Sep 25, 9:22 PM
Unknown Object (File)
Sep 7 2025, 1:30 PM
Unknown Object (File)
Aug 31 2025, 10:07 AM
Unknown Object (File)
Aug 29 2025, 9:11 AM
Unknown Object (File)
Aug 10 2025, 9:35 AM
Unknown Object (File)
Aug 5 2025, 5:01 PM
Unknown Object (File)
Aug 3 2025, 4:27 PM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/powerpc/pseries/phyp_console.c
315 ↗(On Diff #63727)

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 ↗(On Diff #63727)

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.