walnux/include/nuttx
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
..
1wire
analog drivers/analog/hx711.c: Add driver for hx711 adc 2024-02-26 19:16:51 -03:00
audio audio: add amr format support 2023-10-25 13:33:21 +08:00
binfmt coredump: support coredump save to block device when crash 2023-12-10 07:02:03 -08:00
can Add new ioctls 2023-10-27 13:52:28 -03:00
clk clk:fix some issues when use rpmsg clk 2023-09-22 08:47:23 +08:00
contactless
crypto Added NXP SE05x support (secure element) 2023-09-09 15:54:08 +08:00
dma dma: support source/destination address auto step 2023-09-27 00:47:02 +08:00
drivers driver/tee: add optee client driver module 2023-11-23 06:25:48 -08:00
eeprom Add MTD for AT25 eeprom 2024-01-04 09:25:52 -08:00
efuse Add ATSAMA5D2/D4 Secure Fuse Controller (SFC) driver 2023-05-12 16:29:48 -03:00
fs rptun ioctl: Strip rpmsg ioctl and rptun ioctl. 2024-02-19 02:15:45 -08:00
himem xtensa/esp32s3: Add SPIRAM high memory support 2023-11-29 06:33:51 -08:00
hwspinlock hwspinlock: Fix typo error(spin_lock_restore to spin_unlock_irqrestore) 2023-07-25 13:03:31 +02:00
i2c Added I2C Slave to RP2040 2022-07-16 01:56:52 +08:00
input input/touchscreen: Bring up TSIOC_[SET|GET]CALIB macro 2023-09-20 20:51:38 +08:00
ioexpander ioexpander: add support for iC-JX expander 2024-01-23 17:15:25 -03:00
lcd sim_lcd: add open & close 2023-12-18 09:06:29 -08:00
leds drivers/leds/ws2812: Fix WS2812 pixel size 2023-12-24 16:38:06 -08:00
lib libs/log2ceil: Move implementation of log2ceil to a common place 2023-12-14 08:46:12 -08:00
math math/mpi: add mpi driver in math 2023-10-17 13:43:43 +08:00
mbox drivers/mbox: Don't reference the nonexistent CONFIG_MBOX 2022-11-07 10:14:20 +01:00
mm drivers/rmt: Implement an upper-half RMT character driver 2023-12-24 16:38:06 -08:00
modem drivers/modem/alt1250: Add LTE_CMDID_RESTARTAPI command 2024-02-07 22:19:03 -08:00
motor drivers/foc: add support for drv8301 power-stage driver 2023-11-18 17:07:20 -08:00
mtd Add MTD for AT25 eeprom 2024-01-04 09:25:52 -08:00
net Support to ARP Address Conflict Detection 2024-01-25 11:25:03 -03:00
note note: remove remaining event code 2023-10-17 09:07:06 +08:00
nx Indent the define statement by two spaces 2023-05-21 09:52:08 -03:00
pci cosmetic changes after pci code rebase 2024-01-25 09:09:30 -08:00
power support pm runtime base function 2023-09-16 14:44:08 +08:00
rc
regmap nuttx/drivers: add regmap subsystems support. 2023-09-27 00:46:51 +08:00
reset Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
rf
rmt drivers/rmt: Implement an upper-half RMT character driver 2023-12-24 16:38:06 -08:00
rpmsg include/rpmsg/rpmsg.h: remove temp define RPMSGIOC_START, RPMSGIOC_STOP, RPMSGIOC_RESET 2024-02-21 12:42:07 +08:00
rptun rptun ioctl: remove rptun_panic and rptun_dump_all 2024-02-21 21:38:05 -08:00
segger c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
sensors sensors: Remove duplicated defnitions from bmi160.h 2024-02-27 13:00:23 +01:00
serial support gdbstub use serial. 2023-12-11 08:43:26 -08:00
spi docs: revising comments and documents 2024-01-24 23:38:52 -08:00
syslog syslog: add syslog channel filtering function 2023-07-13 01:04:07 +08:00
timers pwm: add option to set channel output polarity with IOCTL command 2023-08-24 18:25:47 -03:00
usb drivers/usbhost: Add a USB bluetooth driver. 2024-01-16 16:02:15 +01:00
usrsock move usrsock to kernel space 2023-01-11 15:14:03 +08:00
video drivers/goldfish_fb: optimize goldfish fb register 2023-12-18 09:08:32 -08:00
virt cosmetic changes after pci code rebase 2024-01-25 09:09:30 -08:00
virtio virtio.h: add virtio_has_feature api for virtio driver 2023-12-10 21:54:56 -08:00
wireless arch/nrf52: add initial support for IEEE 802.15.4 2024-02-18 07:40:41 -08:00
.gitignore
addrenv.h mm_heap: mm dump and panic only valid for the heap own by OS 2023-08-02 06:11:59 -07:00
allsyms.h libc/symtab: Don't include symtab.h in the header files 2023-07-10 23:03:17 +03:00
arch.h SMP: fix crash when switch to new task which is still running 2024-03-01 21:05:00 +09:00
ascii.h
atexit.h libc: Implement quick_exit and at_quick_exit 2023-01-25 14:31:37 +02:00
bits.h Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
board.h assert: add regs parameter to board_crashdump function 2023-06-13 09:42:27 +08:00
cache.h armv7/8 cache: add up_get_xcache_size() support 2023-07-15 15:11:07 +08:00
can.h stm32h7: socket CAN error handling. 2023-01-30 11:22:49 +08:00
cancelpt.h task/pthread_cancelpt: Move cancel point handling to libc, data to TLS 2023-11-15 08:52:04 -08:00
clock.h clock.h: use CONFIG_DEBUG_SCHED to test init ticks 2023-11-21 04:01:39 -08:00
compiler.h toolchain/tasking: add dependencies rules for tasking compiler 2024-02-19 03:36:43 -08:00
crc8.h libc/crc: Add full suffix to avoid the the penitential symbol collision 2022-08-29 18:06:53 +02:00
crc16.h arm64/a64: Add driver for MIPI DSI 2022-12-14 22:37:32 +08:00
crc32.h libc/crc: Add full suffix to avoid the the penitential symbol collision 2022-08-29 18:06:53 +02:00
crc64.h libc/crc: Add full suffix to avoid the the penitential symbol collision 2022-08-29 18:06:53 +02:00
elf.h riscv/arch_elf.c: Handle PCREL_HI20/LO12_I/S relocations correctly 2023-12-12 17:32:36 -08:00
environ.h
envpath.h
ethtool.h Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
fdcheck.h libc/fdcheck: add fdcheck module 2023-06-10 02:19:58 +08:00
fdt.h fdt: Add initial FDT support and procfs for userspace export 2023-08-05 12:41:06 -07:00
gdbstub.h support gdbstub use serial. 2023-12-11 08:43:26 -08:00
hashtable.h hashtable.h: Added a hashtable implementation 2022-12-22 20:20:12 +08:00
init.h support stm32f429i-disco run open flash loader 2023-08-05 12:40:02 -07:00
instrument.h libc: add instrument api support 2023-12-11 02:06:51 -08:00
ipcc.h stm32wl5: fix unbuffered mode and other possible bugs 2022-08-18 11:46:38 +08:00
irq.h arch:Mark key functions to prohibit instrumentation to prevent recursive calls 2023-12-11 02:06:51 -08:00
kmalloc.h mm: include malloc.h in mm/mm.h 2023-06-11 19:37:04 +03:00
kthread.h sched/spawn: Support task_spawnattr_[set|get]stackaddr 2022-10-31 12:46:58 +09:00
lirc.h
list.h nuttx/list: rename container_of to list_container_of from public header 2024-02-29 19:44:54 +08:00
memoryregion.h coredump: support coredump save to block device when crash 2023-12-10 07:02:03 -08:00
mmcsd.h Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
module.h
mqueue.h Indent the define statement by two spaces 2023-05-21 09:52:08 -03:00
mutex.h misc/mutex: fix assertion if nxmutex_reset() before nxmutex_unlock() 2023-02-04 02:13:15 +08:00
notifier.h notifier: add BLOCKING_INIT_NOTIFIER_HEAD support 2023-09-19 09:32:17 +08:00
nuttx.h sched: move etc romfs mount from nsh to sched/init 2024-01-09 21:29:46 -03:00
page.h PAGESIZE and PAGEMASK seems as common macro 2023-09-10 18:18:15 +08:00
panic_notifier.h assert: add more information to panic notifier 2023-08-03 03:17:22 -07:00
pgalloc.h
progmem.h
pthread.h sched/tls: remove PTHREAD_CLEANUP from Kconfig 2023-06-14 12:00:48 +08:00
queue.h queue.h: Implement double link list queue split 2023-09-12 22:09:00 +08:00
random.h
reboot_notifier.h reboot: Remove SYS_DOWN to avoid the confusion 2023-04-21 20:37:59 +03:00
rwsem.h misc/rwlock:Implementing read/write locks. 2023-12-02 19:43:19 -08:00
sched.h sched/tls: inline group info in flat mode to improve performance 2024-03-01 17:27:26 +08:00
sched_note.h note: delete sched_note_flatten 2023-11-12 23:52:10 -08:00
scsi.h
sdio.h mmcsd/sdio: fix potential race condition in sdio 2023-03-21 14:40:44 -03:00
sdio_slave.h Add the module of SDIO Slave 2023-08-22 20:28:24 +08:00
semaphore.h semaphore/_SEM_XX: Remove the _SEM redirection macros as unnecessary 2023-11-27 04:52:54 -08:00
signal.h style: fix multiple style issues and remove unused 2023-09-16 14:17:47 +08:00
spawn.h sched/taskfiles: skip unnecessary file open/close operations to improve performance 2023-11-16 07:30:36 -08:00
spinlock.h spinlock: Move the inclusion of stdatomic.h to source file 2023-11-19 20:22:50 +01:00
streams.h libc/stream: add file out stream 2023-12-25 16:54:16 -03:00
symtab.h libc/symtab: Move SYMTAB_XXX from unistd/Kconfig to symtab/Kconfig 2023-07-10 13:09:47 -03:00
tee.h Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
tls.h sched/tls: inline group info in flat mode to improve performance 2024-03-01 17:27:26 +08:00
trace.h trace: replace SCHED_NOTE_BEGIN to sched_note_begin 2023-04-19 02:53:34 +08:00
userspace.h
vt100.h
wdog.h libc: Move queue.h from include to include/nuttx 2022-09-26 08:04:58 +02:00
wqueue.h wqueue: add work_cancel_sync() support 2023-09-19 15:52:48 +08:00
zoneinfo.h