nuttx/arch/arm64/src
hujun5 ed78646798 signal: fix deadlock when sigdeliver call enter_critical_section
cpu0                                 cpu1:

user_main
signest_test
sched_unlock
nxsched_merge_pending
nxsched_add_readytorun
up_cpu_pause
			             arm_sigdeliver
				     enter_critical_section

Reason:
In the SMP, cpu0 is already in the critical section and waiting for cpu1 to enter the suspended state.
However, when cpu1 executes arm_sigdeliver, it is in the irq-disabled state but not in the critical section.
At this point, cpu1 is unable to respond to interrupts and
is continuously attempting to enter the critical section, resulting in a deadlock.

Resolve:
adjust the logic, do not entering the critical section when interrupt-disabled.

test:
We can use qemu for testing.

compiling
make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20
running
qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic -machine virt,virtualization=on,gic-version=3 -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-06-22 19:35:28 -03:00
..
a64 arm64/qemu: The PSCI can be configured with CONFIG_ARM64_PSCI 2024-06-20 09:41:28 +08:00
cmake cmake:bugfix CMake compilation options settings should not use strings 2024-05-30 10:02:10 -03:00
common signal: fix deadlock when sigdeliver call enter_critical_section 2024-06-22 19:35:28 -03:00
fvp-v8r arm64/qemu: The PSCI can be configured with CONFIG_ARM64_PSCI 2024-06-20 09:41:28 +08:00
goldfish arm64/qemu: The PSCI can be configured with CONFIG_ARM64_PSCI 2024-06-20 09:41:28 +08:00
imx8 paging: Rename existing CONFIG_PAGING to CONFIG_LEGACY_PAGING 2024-03-05 09:45:49 +08:00
imx9 arm64/qemu: The PSCI can be configured with CONFIG_ARM64_PSCI 2024-06-20 09:41:28 +08:00
qemu arm64/qemu: The PSCI can be configured with CONFIG_ARM64_PSCI 2024-06-20 09:41:28 +08:00
rk3399 arm64/qemu: The PSCI can be configured with CONFIG_ARM64_PSCI 2024-06-20 09:41:28 +08:00
.gitignore
CMakeLists.txt CMake:init arm64 CMake qemu-armv8a build 2023-12-27 07:27:17 -08:00
Makefile kasan: Implementing global variable out of bounds detection 2024-04-07 23:31:13 +08:00
Toolchain.defs Add basic support for locales in order to C++ streams to build and work for simple cases (POSIX / C locale). 2024-04-29 17:34:10 +08:00