incubator-nuttx/include
ligd 2241969e5a SMP: fix crash when switch to new task which is still running
cpu0 thread0:                        cpu1:
sched_yield()
nxsched_set_priority()
nxsched_running_setpriority()
nxsched_reprioritize_rtr()
nxsched_add_readytorun()
up_cpu_pause()
                                     IRQ enter
                                     arm64_pause_handler()
                                     enter_critical_section() begin
                                     up_cpu_paused() pick thread0
                                     arm64_restorestate() set thread0 tcb->xcp.regs to CURRENT_REGS
up_switch_context()
  thread0 -> thread1
arm64_syscall()
    case SYS_switch_context
     change thread0 tcb->xcp.regs
    restore_critical_section()
                                     enter_critical_section() done
                                     leave_critical_section()
                                     IRQ leave with restore CURRENT_REGS
                                     ERROR !!!

Reason:
As descript above, cpu0 swith task: thread0 -> thread1, and the
syscall() execute slowly, this time cpu1 pick thread0 to run at
up_cpu_paused(). Then cpu0 syscall execute, cpu1 IRQ leave error.

Resolve:
Move arm64_restorestate() after enter_critical_section() done

This is a continued fix with:
https://github.com/apache/nuttx/pull/6833

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-01 21:05:00 +09:00
..
android
arpa
crypto crypto/rsa_verify: export rsa verify via /dev/crypto 2023-10-18 12:23:13 +08:00
cxx
net ioctl: add definitions related to ethtool 2023-11-03 22:37:50 +08:00
netinet Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
netpacket Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
nuttx SMP: fix crash when switch to new task which is still running 2024-03-01 21:05:00 +09:00
ssp
sys make 64-bit time_t back to unsigned 2023-12-30 08:48:43 -08:00
.gitignore
aio.h aio: change aio_fildes int type 2023-09-08 00:59:31 +03:00
alloca.h libs/alloca: add alloca implement for MSVC 2023-08-28 11:10:08 -03:00
assert.h assert/panic: disable panic message to save the code size 2024-02-27 10:33:43 -03:00
byteswap.h
ctype.h libs/ctype/toupper_l: Implement function toupper_l instead of macro 2023-08-22 00:07:16 +08:00
debug.h rpmsg/debug: add debug configs and macros 2024-02-15 19:53:55 -08:00
dirent.h
dlfcn.h
dsp.h libdsp: update LP_FILTER comment 2023-10-19 21:38:45 +08:00
dspb16.h libdsp: update LP_FILTER comment 2023-10-19 21:38:45 +08:00
elf.h arch/arm64: support relocate for aarch64 2023-10-30 18:20:22 +08:00
elf32.h
elf64.h Fix loading of ET_DYN type of shared objects 2023-09-20 09:35:28 -04:00
endian.h
err.h
errno.h
execinfo.h
fcntl.h
fixedmath.h fixedmath: add abs and sign operations 2023-10-07 21:25:56 +08:00
fnmatch.h
ftw.h
getopt.h
glob.h
grp.h
hex2bin.h libs/libc/hex2bin: enhance 64-bit compatibility 2023-08-11 19:43:37 +08:00
iconv.h
ifaddrs.h
inttypes.h
iso646.h
langinfo.h The character U+ff0c "," could be confused with the ASCII character U+002c ",", which is more common in source code. 2023-10-03 16:53:12 -04:00
libgen.h
libintl.h
limits.h clock: replace all up_perf_xx with perf_xx 2023-10-02 16:11:43 +02:00
locale.h
lzf.h
malloc.h mm: record the maximum system memory usage 2023-11-09 09:08:49 +08:00
mqueue.h
netdb.h
nl_types.h
nxflat.h
obstack.h
poll.h
pthread.h pthread_once: g_lock may lead deadlock 2023-09-26 10:13:00 +08:00
pty.h
pwd.h
regex.h
resolv.h
sched.h sched: Define sched_getcpu return 0 when CONFIG_SMP equals n 2023-08-06 11:28:49 +02:00
search.h hsearch_r: add DELETE action 2024-02-21 13:29:36 -03:00
semaphore.h
signal.h sigaction: Expand si_user for non-kernel signals 2023-11-22 08:00:43 -08:00
spawn.h libs/libc/spawn: Add minimal implementation for posix_spawnattr_destory. 2023-10-31 13:42:00 +08:00
stdbool.h
stddef.h
stdint.h
stdio.h libc: add support for open_memstream 2023-11-29 02:13:19 -08:00
stdlib.h
stdnoreturn.h
string.h
strings.h Revert "libc/lib_bzero:Add bzero prototype." 2023-11-21 07:56:52 -08:00
syscall.h
syslog.h
termios.h
threads.h Fix typo in mtx_timedlock 2024-02-02 09:03:18 -08:00
time.h include: move clockid_t and time[r]_t define to sys/types.h 2023-08-19 09:08:40 +03:00
unistd.h fs_lock:Implementing file locks 2024-02-21 13:29:36 -03:00
utime.h
uuid.h
wchar.h libs/libc/wchar: add ungetwc implementation 2023-12-17 01:39:06 -08:00
wctype.h