-
Notifications
You must be signed in to change notification settings - Fork 1.4k
drivers/rpmsg: Add rpmsg_get_signals API and rpmsg transport ops support #17554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
linguini1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though this is a new feature, it still requires testing to make sure that it does what it's supposed to. Could you please provide some testing information and logs?
|
Yes! Special care should be taken here please we already have one CVE for RPC https://nvd.nist.gov/vuln/detail/CVE-2025-35003. |
|
@linguini1 @cederom Of course, but this PR need add some transport porting patches to verify this feature, and these patches have some dependency on other patches, so I will push other patches first. |
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @CV-Bowen :-)
*rdev and/or *rpmsg may be NULL, please add checks against null pointer dereference.
8bb5780
e0ae448 to
8bb5780
Compare
|
CI check failed, but it's not related to this PR. 431cffa5d8 x86_64:fix syscall type mismatch
1914dd0820 net/socket: Check on the end of the NIC name when binding device
../nuttx/tools/checkpatch.sh -c -u -m -g d5633f75a8bff1ab7579922f5e697b2c7e767124..HEAD
❌ Commit subject missing colon (e.g. 'subsystem: msg')
❌ Missing Signed-off-by
❌ Missing git commit message
Used config files:
1: .codespellrc
/home/runner/work/nuttx/nuttx/nuttx/Documentation/ReleaseNotes/NuttX-12.12.0:57: ans ==> and
/home/runner/work/nuttx/nuttx/nuttx/Documentation/ReleaseNotes/NuttX-12.12.0:154: bootup ==> boot up, boot-up
/home/runner/work/nuttx/nuttx/nuttx/Documentation/ReleaseNotes/NuttX-12.12.0:193: writen ==> written
/home/runner/work/nuttx/nuttx/nuttx/Documentation/ReleaseNotes/NuttX-12.12.0:273: ans ==> and
/home/runner/work/nuttx/nuttx/nuttx/Documentation/applications/testing/nuts/index.rst:167: gaurd ==> guard, gourd
/home/runner/work/nuttx/nuttx/nuttx/Documentation/components/drivers/special/mtd/devices/at45db.rst:12: optin ==> option
Error: /home/runner/work/nuttx/nuttx/nuttx/crypto/rijndael.c:6:82: error: Long line found
Error: /home/runner/work/nuttx/nuttx/nuttx/include/crypto/rijndael.h:7:82: error: Long line found
All done! ✨ 🍰 ✨
1 file would be left unchanged.
Some checks failed. For contributing guidelines, see:
https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md
Error: Process completed with exit code 1. |
provide get_signals ops to the transport layer implementation. add rpmsg_get_signals API for rpmsg service to get remote core's status. Signed-off-by: Yongrong Wang <[email protected]> Signed-off-by: cuiziwei <[email protected]> Signed-off-by: Bowen Wang <[email protected]>
And set signal_running when rpmsg devices registered Now rpmsg port transport support to get the remote core's state by api rpmsg_get_signals() Signed-off-by: liaoao <[email protected]> Signed-off-by: Bowen Wang <[email protected]>
Now rpmsg dump can print the remote core's running/sleep state Signed-off-by: liaoao <[email protected]>
Use virtio-serial as the rpmsg-port-uart serial device, so we can bringup the rpmsg-port-uart in qemu platform. Server command: qemu-system-aarch64 -cpu cortex-a53 -nographic \ -machine virt,virtualization=on,gic-version=3 \ -chardev stdio,id=con,mux=on -serial chardev:con \ -object memory-backend-file,discard-data=on,id=shmmem-shmem0,mem-path=/dev/shm/my_shmem0,size=4194304,share=yes \ -device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,addr=0xb \ -device virtio-serial-device,bus=virtio-mmio-bus.0 \ -chardev socket,path=/tmp/rpmsg_port_uart_socket,server=on,wait=off,id=foo \ -device virtconsole,chardev=foo \ -mon chardev=con,mode=readline -kernel ./out/nuttx_qemu-armv8a_rpserver_ivshmem/nuttx \ -gdb tcp::7775 Proxy command: qemu-system-aarch64 -cpu cortex-a53 -nographic \ -machine virt,virtualization=on,gic-version=3 \ -chardev stdio,id=con,mux=on -serial chardev:con \ -object memory-backend-file,discard-data=on,id=shmmem-shmem0,mem-path=/dev/shm/my_shmem0,size=4194304,share=yes \ -device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,addr=0xb \ -device virtio-serial-device,bus=virtio-mmio-bus.0 \ -chardev socket,path=/tmp/rpmsg_port_uart_socket,server=off,id=foo \ -device virtconsole,chardev=foo \ -mon chardev=con,mode=readline -kernel ./out/nuttx_qemu-armv8a_rpproxy_ivshmem/nuttx \ -gdb tcp::7776 Signed-off-by: Bowen Wang <[email protected]>
Use virtio-serial as the rpmsg-port-uart serial device, so we can bringup the rpmsg-port-uart in qemu platform. And update the documents: nuttx/Documentation/platforms/arm/qemu/boards/qemu-armv7a/index.rst Signed-off-by: Bowen Wang <[email protected]>
…ents Now the qemu-armv7a:rpserver_ivshmem, qemu-armv7a:rpproxy_ivshmem and qemu-armv8a:rpserver_ivshmem, qemu-armv8a:rpproxy_ivshmem are not only based on the ivshmem device but also the virtio-serial, so remove the "_ivshmem" suffix and update documents. Signed-off-by: Bowen Wang <[email protected]>
8bb5780 to
3654a1d
Compare
|
@cederom @linguini1 Please check the last patches and test logs. |
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @CV-Bowen :-)
linguini1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the testing!
Summary
Provide rpmsg_get_signals ops to the transport layer implementation. add rpmsg_get_signals API for rpmsg services to get remote core's status.
Use flag
RPMSG_SIGNAL_RUNNINGto mark remote core is running or not and apirpmsg_is_running()can use to judge remote core is running or not.Why need this API:
In the embeded system, somes applications running on a low-power coprocessor (i.e., the Sensor) to decide whether to send data based on the sleep state of the main application processor (AP) primarily aims to achieve communication synchronization and maximize energy efficiency.
Changes
1 rpmsg: Add rpmsg_get_signals API and rpmsg transport ops support
2 rpmsg_port: add rpmsg_port_get_signals api
3 rpmsg_port: print remotes's running state in rpmsg_port_dump
4 qemu-armv8a/rpserver and rpproxy: support the rpmsg port uart
5 qemu-armv7a/rpserver and rpproxy: support the rpmsg port uart
6 qemuv7a/v8a-rpserver/proxy: remove "_ivshmem" suffix and update documents
Impact
Add new api for the rpmsg services.
Testing
Compiler Pass.
qemuv8a:rpserver and qemuv8a-rpproxy rpmsg/rptun ping and dump
server log: