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)
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
Unknown Object (File)
Dec 22 2023, 10:49 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.