CV-Bowen opened a new pull request, #22409:
URL: https://github.com/apache/nuttx/pull/22409
## Summary
Let a virtio driver ask its transport for the device's shared memory
regions (virtio 1.1 "Shared Memory Regions"), and implement it for
mmio, pci modern and rptun:
- `openamp: add get_shm_region to virtio_memory_ops` (open-amp patch
0033): `struct virtio_shm_region`, a `get_shm_region` op and the
`virtio_get_shm_region()` wrapper, which returns -ENXIO when the
transport has no op. The patch also stores the resource table index
of a vdev in `struct remoteproc_virtio`.
- `drivers/virtio/virtio-pci-modern: fix nxstyle errors`: two blank
lines after declarations in code already on master, so that the next
commit passes checkpatch. No functional change.
- `virtio: implement get_shm_region for mmio and pci modern`: mmio
reads SHMSel/SHMLen/SHMBase (version 2; a length of all ones means
no region). pci modern looks up the
`VIRTIO_PCI_CAP_SHARED_MEMORY_CFG` capability with the requested id
and maps the BAR range. pci legacy has no regions.
- `rptun: implement get_shm_region with named carveouts`: region `id`
of vdev N is the carveout `vdev<N>buffer<id>`. A region at da ANY is
cut from the pool by the driver side and its da written back, like a
vring. The device side gets memory ops for this; its buffer ops
assert the driver role.
- `vhost: add vhost_get_shm_region wrapper`.
## Impact
- New API: `virtio_get_shm_region()`, `vhost_get_shm_region()`,
`struct virtio_shm_region`, `get_shm_region` in
`virtio_memory_ops`. No in-tree driver calls them yet.
- open-amp: one more patch in `openamp/`.
- rptun: carveouts named `vdev<N>buffer<id>` were ignored before; no
in-tree table has one.
- imx93-qsb:rpmsg ITCM: see #P201 (measured together).
## 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
Every commit builds sim:rpserver, sim:rpproxy, qemu-armv8a:rpserver,
qemu-armv8a:rpproxy and qemu-armv8a:netnsh with 0 warnings.
Baseline (`test.sh`, cases: baseline.yaml):
- 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
- tested: nuttx 9a334456b39 apps f0dc662c0
- qemu-armv8a:rpserver qemu-armv8a:rpproxy built with test-only overlay:
disabled LIBC_ENVPATH BINFMT_CHECKEXEC
- sim:rpserver + sim:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
- [x] `rpmsg dump all` (proxy)
- qemu-armv8a:rpserver + qemu-armv8a:rpproxy: PASS
- [x] `uname -a` (server)
- [x] `uname -a` (proxy)
- [x] `rpmsg dump all` (server)
- [x] `rpmsg ping all 10 1024 3 0` (server)
- [x] `rpmsg ping all 10 1024 3 0` (proxy)
- [x] `mount -t rpmsgfs -o cpu=server,fs=/proc /sp` (proxy)
- [x] `cat /sp/version` (proxy)
qemu-armv8a:netnsh (virtio-mmio/pci rng, blk, net, 9p): rng and blk cases
pass; the 6 net/9p cases (`ping`, v9fs) fail the same way on origin/master,
where virtio-net stops after the first frame; apache/nuttx#22322 fixes that.
Not run: a device that exposes a shared memory region. QEMU's virtio
devices used here have none, and no in-tree rptun table defines one, so
`get_shm_region` is build-tested only; the runs above show the virtio
mmio/pci and rptun paths are otherwise unchanged.
--
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]