CV-Bowen opened a new pull request, #22335:
URL: https://github.com/apache/nuttx/pull/22335

   ## Summary
   
   Make the rptun core BMP aware.
   
   apache/nuttx#22261 (BMP part 1) added `CONFIG_BMP`, where every CPU runs
   its own kernel instance from one shared image, and
   `include/nuttx/percpu.h` with `DEFINE_PER_CPU_BMP()`,
   `DEFINE_PER_CPU_BSS_BMP()` and `this_cpu_var_bmp()` for data that must
   be private to each CPU. Without `CONFIG_BMP` the macros expand to the
   plain variable, so nothing changes for existing configurations.
   
   - `drivers/rptun: keep the instance list and its lock per CPU in BMP
     mode`: each CPU registers its own rptun instances, so `g_rptun_priv`
     and `g_rptun_lock` become per CPU. The list is a `dq_queue_t`, valid
     when zeroed.
   - `drivers/rptun: register the panic and reboot notifiers per CPU in BMP
     mode`: each CPU registers `g_rptun_panic_nb` and `g_rptun_reboot_nb`
     on its own notifier chains, and one `notifier_block` cannot be linked
     into several chains.
   - `drivers/rptun: reset the peers from the reboot notifier by default in
     BMP mode`: in BMP mode every CPU dumps its own core, so the default
     `RPTUN_AUTO_RESET` becomes `RPTUN_AUTO_RESET_IN_REBOOT_NOTIFIER` there,
     which stops the peers after the local coredump rather than before it.
   
   ## Impact
   
   - No change without `CONFIG_BMP`.
   - With `CONFIG_BMP`: per-CPU rptun instances and notifiers, and the
     reboot-notifier reset mode by default.
   
   ## 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.
   
   **BMP on (compile only).** qemu-armv8a:rpserver and qemu-armv8a:rpproxy with 
`CONFIG_BMP=y`, `CONFIG_PERCPU_SECTION=y` and `CONFIG_SMP_NCPUS=2`: every 
source file compiles with 0 errors and 0 warnings. The link cannot complete on 
current master: no in-tree linker script places `.data..percpu`, and 
`arm64_boot.c` references `_sdata_percpu` without a declaration, so no BMP 
image can be built yet. The objects of the changed files show the variables in 
`.data..percpu` / `.bss..percpu`.
   
   imx93-qsb:rpmsg (BMP off, arm-gnu-toolchain 13.2, make): ITCM 127592 bytes, 
unchanged.
   
   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]

Reply via email to