nuttx/arch/arm/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
..
a1x arch: Fix style warnings regarding included header files 2024-03-05 09:45:49 +08:00
am335x arch/arm/src/am335x: Fix incorrect signedness of variable 2024-04-04 11:50:36 +08:00
arm paging: Rename existing CONFIG_PAGING to CONFIG_LEGACY_PAGING 2024-03-05 09:45:49 +08:00
armv6-m signal: fix deadlock when sigdeliver call enter_critical_section 2024-06-22 19:35:28 -03:00
armv7-a signal: fix deadlock when sigdeliver call enter_critical_section 2024-06-22 19:35:28 -03:00
armv7-m signal: fix deadlock when sigdeliver call enter_critical_section 2024-06-22 19:35:28 -03:00
armv7-r signal: fix deadlock when sigdeliver call enter_critical_section 2024-06-22 19:35:28 -03:00
armv8-m signal: fix deadlock when sigdeliver call enter_critical_section 2024-06-22 19:35:28 -03:00
armv8-r signal: fix deadlock when sigdeliver call enter_critical_section 2024-06-22 19:35:28 -03:00
at32 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
c5471 net/ip: print ip addresses using ip4_addrN macro 2023-08-19 13:28:21 -03:00
cmake cmake:bugfix CMake compilation options settings should not use strings 2024-05-30 10:02:10 -03:00
common Add flags for building shared objects for architectures supporting dynamic loading 2024-06-12 23:21:16 -03:00
cxd32xx arch: cxd32xx: Add cxd32xx SoC support 2024-06-04 22:21:56 +08:00
cxd56xx arch: Remove xxx_intstack_top and xxx_intstack_alloc 2024-04-09 16:59:00 -03:00
dm320 arch/arm: Disable -Warray-bound for rp2040, dm320 and lpc31xx 2023-12-19 08:36:49 +08:00
efm32 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
eoss3 arch/arm:add up_debugpoint api 2023-12-11 08:43:26 -08:00
fvp-v8r-aarch32 fix nxstyle 2024-04-15 15:33:17 -03:00
gd32f4 Fix Kconfig style 2024-05-29 17:15:57 -03:00
goldfish arch: Remove xxx_intstack_top and xxx_intstack_alloc 2024-04-09 16:59:00 -03:00
imx1 Indent the define statement by two spaces 2023-05-21 09:52:08 -03:00
imx6 arm/imx6: we use spin_lock_irqsave replace enter_critical_section to protect gpio init 2024-05-09 13:45:02 +08:00
imxrt Replace all asserts in kernel code with ASSERT 2024-05-17 10:18:16 -03:00
kinetis up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
kl up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
lc823450 Replace all asserts in kernel code with ASSERT 2024-05-17 10:18:16 -03:00
lpc17xx_40xx lpc17_40 i2c: Fix I2C driver state desynchronization. 2024-04-25 01:24:40 +08:00
lpc31xx arch: Fix style warnings regarding included header files 2024-03-05 09:45:49 +08:00
lpc43xx lpc43xx/usb: Fix gcc13.2 compiler error 2023-12-19 08:36:49 +08:00
lpc54xx up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
lpc214x Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
lpc2378 Fix nuttx coding style 2023-07-11 02:33:45 +08:00
max326xx arch/arm:add up_debugpoint api 2023-12-11 08:43:26 -08:00
moxart arch: move non arm g_current_regs defintion to common place 2022-09-21 22:23:11 +02:00
mps mps3:Support NuttX running on qemu cortex-m55 2024-04-26 18:42:35 -03:00
mx8mp arch/mx8mp: add rptun/rpmsg client support 2024-04-30 11:30:02 -03:00
nrf52 fix nxstyle 2024-05-03 14:15:56 -03:00
nrf53 fix nxstyle 2024-05-03 14:15:56 -03:00
nrf91 arch/nrf91: enable FPU 2024-04-28 08:49:46 +08:00
nuc1xx drivers/serial: Fix docstrings on UART interrupt handlers 2023-02-07 04:41:36 +08:00
phy62xx Replace all asserts in kernel code with ASSERT 2024-05-17 10:18:16 -03:00
qemu qemu/trustzone: add secure memory config 2024-04-14 12:07:59 -03:00
rp2040 Fix Kconfig style 2024-05-29 17:15:57 -03:00
rtl8720c Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
s32k1xx Disable interrupt during FTFC operation 2024-03-06 13:31:48 -03:00
s32k3xx arch/arm/src/s32k3xx: Fix incorrect check for invalid port or pin number 2024-04-04 11:53:06 +08:00
sam34 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
sama5 Fix Kconfig style 2024-05-29 17:15:57 -03:00
samd2l2 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
samd5e5 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
samv7 samv7: add support for user signature area in embedded flash 2024-05-28 16:28:33 -03:00
stm32 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
stm32f0l0g0 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
stm32f7 stm32l4, stm32f7, stm32h7: fix qspi (unused) register addresses 2024-06-22 19:26:14 -03:00
stm32h7 stm32l4, stm32f7, stm32h7: fix qspi (unused) register addresses 2024-06-22 19:26:14 -03:00
stm32l4 stm32l4, stm32f7, stm32h7: fix qspi (unused) register addresses 2024-06-22 19:26:14 -03:00
stm32l5 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
stm32u5 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
stm32wb up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
stm32wl5 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
str71x fix nxstyle 2024-05-03 14:15:56 -03:00
tiva Replace all asserts in kernel code with ASSERT 2024-05-17 10:18:16 -03:00
tlsr82 arch: Remove xxx_intstack_top and xxx_intstack_alloc 2024-04-09 16:59:00 -03:00
tms570 up_putc: int up_putc, enter_critical_section may be called 2024-05-09 13:45:02 +08:00
xmc4 arch/xmc4 uart driver fix 2024-06-18 00:17:07 +08:00
.gitignore arch/arm: Add support for boot stage2 from Raspberry Pi Pico SDK 2021-02-20 03:45:24 -08:00
CMakeLists.txt cmake: move NUTTX_CHIP_ABS_DIR before common src 2023-11-07 17:39:03 +01:00
Makefile kasan: Implementing global variable out of bounds detection 2024-04-07 23:31:13 +08:00