CV-Bowen opened a new pull request, #21333:
URL: https://github.com/apache/nuttx/pull/21333
## Summary
`rptun_bmp_get_resource()` waits for a non-zero version in the shared
resource table before using it. The table lives in memory that survives
a soft reset, so after a reboot the version written in the previous boot
is still there: the waiting core sees it at once and parses a table the
owner has not set up again yet.
Register a reboot notifier that writes 0 to the version, so the waiting
side holds off until the table is initialized again. The error paths in
`rptun_bmp_init()` now unregister it.
## Impact
The resource table version is cleared on reboot. 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
No in-tree board uses rptun_bmp. It was run on an out-of-tree QEMU
armv7-a TrustZone setup (`-machine virt,secure=on`; the secure world is
the rptun_bmp slave and sets up the table, the non-secure world is the
master), built from a tree that contains this change. `reboot` on the
non-secure side resets the machine without clearing RAM; after it comes
back the link is up again and rpmsg works across it:
<details><summary>console</summary>
```
NuttX 12.7.2 8a20ba1ce60-dirty Sep 22 2026 11:37:35 arm ap
[ 5] [ INFO] [tee] D/TC:0 5 call_initcalls:40 level 3 tee_cryp_init()
[ 5] [ INFO] [tee] D/TC:0 5 call_initcalls:40 level 4
tee_fs_init_key_manager()
[ 6.439684] [12] [ EMERG] [ap] rpmsg_ping: core info: ap <-> tee
[ 6.439721] [12] [ EMERG] [ap] rpmsg_ping: ping times: 3
__REBOOT__
NuttX 12.7.2 8a20ba1ce60-dirty Sep 22 2026 11:37:35 arm ap
[ 5] [ INFO] [tee] D/TC:0 5 call_initcalls:40 level 3 tee_cryp_init()
[ 5] [ INFO] [tee] D/TC:0 5 call_initcalls:40 level 4
tee_fs_init_key_manager()
ls /dev/rptun
/dev/rptun:
tee
[ 26.658855] [12] [ EMERG] [ap] rpmsg_ping: core info: ap <-> tee
[ 26.658894] [12] [ EMERG] [ap] rpmsg_ping: ping times: 3
```
</details>
`rptun_bmp.c` was also built for qemu-armv8a:rpserver with
`CONFIG_RPTUN_BMP=y` added, without warnings. Baseline:
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 75b8e2abe8c apps d40132fba
- qemu-armv8a 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)
--
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]