CV-Bowen opened a new pull request, #22284:
URL: https://github.com/apache/nuttx/pull/22284
## Summary
How a core handles the status bits its peer sets in the shared resource
table:
- `continue ioctl foreach on failure instead of break`: one core whose
ioctl failed stopped `rptun_ioctl_foreach()`, so the panic and reboot
notifiers skipped the cores after it. Every core is tried now and the
last error is returned.
- `remember the peer status bits already handled`: a status bit stays
set after it is handled, so every later notification ran the same
handling again, and a core panicked by its peer sent the PANIC back.
The reasons this core has handled are kept in a new `lstatus`.
- `ignore PAUSE on a TrustZone secure core`: with
`ARCH_TRUSTZONE_SECURE` both worlds share the CPU, so a secure side
that busy-waits on PAUSE also stalls the non-secure side that is
printing its panic.
- `do not reset when a PAUSE is not followed by a PANIC`: after
`CONFIG_RPTUN_STATUS_TIMEOUT_MS` without a PANIC the core took the
PAUSE bit as a reset reason and reset itself.
## Impact
- Only `drivers/rptun/rptun.c`. No API, Kconfig or shared memory
layout change.
- A PAUSE that times out is logged instead of resetting the core.
- A core that panics on its peer's request no longer panics that peer
again.
## 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 and
qemu-armv8a:rpproxy with 0 warnings, plus qemu-armv8a:rpserver with
`CONFIG_ARCH_TRUSTZONE_SECURE=y` and sim:rpserver with
`CONFIG_RPTUN_AUTO_RESET_DISABLE=y`.
qemu-armv8a:rpserver + qemu-armv8a:rpproxy (ivshmem rptun) with
`CONFIG_RPTUN_AUTO_RESET_IN_PANIC_NOTIFIER=y`, master vs this PR:
| server nsh | master | this PR |
|---|---|---|
| `rptun reset /dev/rptun/proxy 9` (PAUSE, no PANIC follows) | proxy after 5
s: `FATAL: Reset by remote core: server reason: 9` | proxy after 5 s: `FATAL:
Timeout waiting for remote core panic: server`, keeps running |
| then `rptun reset /dev/rptun/proxy 2` (PANIC) | proxy panics, then its
panic notifier panics the server: `[server] ... Assertion failed Panic by
remote core: proxy` | only the proxy panics |
```
master:
[ 10.375490] [ 0] [ EMERG] [proxy] FATAL: Reset by remote core: server
reason: 9
[ 21.658741] [ 0] [ EMERG] [proxy] dump_assert_info: Assertion failed
Panic by remote core: server: at file: /drivers/rptun/rptun.c:987 task:
Idle_Task process: Kernel 0x404ad818
[ 21.960195] [ 0] [ EMERG] [server] dump_assert_info: Assertion failed
Panic by remote core: proxy: at file: /drivers/rptun/rptun.c:987 task:
Idle_Task process: Kernel 0x402ad690
this PR:
[ 10.378159] [ 0] [ EMERG] [proxy] rptun_check_peer_status: FATAL: Timeout
waiting for remote core panic: server
[ 21.606299] [ 0] [ EMERG] [proxy] dump_assert_info: Assertion failed
Panic by remote core: server: at file: /drivers/rptun/rptun.c:1001 task:
Idle_Task process: Kernel 0x404ad818
```
Not tested: the TrustZone secure path at runtime (build only), and the
foreach change with more than one peer.
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]