CV-Bowen opened a new pull request, #22289:
URL: https://github.com/apache/nuttx/pull/22289

   ## Summary
   
   `boards/sim: enable the virtio serial device in rpserver and rpproxy`:
   the sim rptun resource table has a virtio serial vdev (virtio-serial on
   the master, vhost-serial on the slave, forwarded to the slave's
   `/dev/ttyVH0`), but neither sim rpmsg config enabled a driver for it.
   The server never set `DRIVER_OK` on that vdev, so the proxy's rptun
   thread kept polling for it until the link went down, and the device was
   unusable.
   
   - sim:rpserver: `DRIVERS_VIRTIO_SERIAL`, which registers `/dev/ttyV0`.
   - sim:rpproxy: `DRIVERS_VHOST_SERIAL`, plus a sim UART registered as
     `/dev/ttyVH0` and backed by a host pseudoterminal
     (`SIM_UART_NUMBER=1`, `SIM_UART_PTY`, `SIM_UART0_NAME`), which is where
     vhost-serial forwards the data.
   
   ## Impact
   
   - sim:rpserver gets `/dev/ttyV0`; sim:rpproxy opens one host pty and
     runs two vhost-serial threads.
   - The proxy's rptun thread now finishes once all four vdevs are up
     instead of polling for the serial one.
   - Only these two defconfigs change.
   
   ## Testing
   
   Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu 
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU 
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
   
   sim:rpserver and sim:rpproxy build with 0 warnings.
   
   `ls /dev` on the server and `ps` on the proxy (through `cu
   /dev/ttyproxy`), 5 s after boot:
   
   | | before | after |
   |---|---|---|
   | server `/dev/ttyV0` | missing | present |
   | proxy threads | `rptun server` still running, `Waiting Signal` (the retry 
sleep) | no `rptun` thread; `vhost_serial_rx_/dev/ttyVH0` and 
`vhost_serial_tx_/dev/ttyVH0` |
   
   Data across the cores (after): the server writes `/dev/ttyV0` and the
   host reads the proxy's pty, then the host writes the pty and the server
   reads `/dev/ttyV0`:
   
   ```
   server> echo p146-to-proxy > /dev/ttyV0
   host read from pty: b'p146-to-proxy\n'
   server> dd if=/dev/ttyV0 of=/dev/console bs=13 count=1
   p146-to-serv
   13 bytes (1 blocks) copied, 999706 usec, 0 KB/s
   ```
   
   No regression in rpmsg: sim:rpserver/rpproxy and 
qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping, 
rpmsgfs; 15/15). qemu-armv8a was built with LIBC_ENVPATH and BINFMT_CHECKEXEC 
disabled, which current master needs for nxinit to start nsh there; unrelated 
to this change.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to