CV-Bowen opened a new pull request, #20864:
URL: https://github.com/apache/nuttx/pull/20864
## Summary
Commit fee69a20461 dropped the RESET write at virtio device init because
it hangs QEMU in virtio_gpu_reset() under icount + record/replay. Without
it, a device left configured by an earlier boot (for example after a warm
reset of the guest only) keeps a stale queue and every probe fails with
-ENOENT.
This reads the device status first and writes RESET only when it is not
0, so the power-on case keeps skipping the write that hangs QEMU, and a
previously configured device is reset again.
The first commit only fixes existing nxstyle errors in virtio-mmio.c so
that checkpatch passes on the changed file.
## Impact
virtio-mmio and virtio-pci probe only. No API or Kconfig 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
Both transports probe their devices with the change.
virtio-mmio, `qemu-armv8a:fb`:
```
qemu-system-aarch64 -cpu cortex-a53 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-global virtio-mmio.force-legacy=false \
-device virtio-gpu-device,xres=640,yres=480,bus=virtio-mmio-bus.0 \
-kernel ./nuttx
```
<details><summary>ls /dev (mmio)</summary>
```
nsh> ls /dev
/dev:
console
fb0
null
ram0
ttyS1
zero
```
</details>
virtio-pci, `qemu-armv8a:netnsh` (same device list as master):
```
qemu-system-aarch64 -cpu cortex-a53 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-global virtio-mmio.force-legacy=false \
-device virtio-rng-pci \
-device virtio-net-pci,netdev=u1 -netdev user,id=u1 \
-kernel ./nuttx
```
<details><summary>ls /dev (pci)</summary>
```
nsh> ls /dev
/dev:
console
null
pci
ram0
random
telnet
ttyS1
zero
```
</details>
The warm-reset case (device already configured when NuttX probes it)
cannot be produced with plain QEMU and is not covered here.
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]