zephyr/arch/arc/core
Andy Ross eefd3daa81 kernel/smp: arch/x86_64: Address race with CPU migration
Use of the _current_cpu pointer cannot be done safely in a preemptible
context.  If a thread is preempted and migrates to another CPU, the
old CPU record will be wrong.

Add a validation assert to the expression that catches incorrect
usages, and fix up the spots where it was wrong (most important being
a few uses of _current outside of locks, and the arch_is_in_isr()
implementation).

Note that the resulting _current expression now requires locking and
is going to be somewhat slower.  Longer term it's going to be better
to augment the arch API to allow SMP architectures to implement a
faster "get current thread pointer" action than this default.

Note also that this change means that "_current" is no longer
expressible as an lvalue (long ago, it was just a static variable), so
the places where it gets assigned now assign to _current_cpu->current
instead.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-02-08 08:51:04 -05:00
..
mpu arch: arc: fix the bug where buffer validate should be atomic 2020-02-05 08:49:10 -08:00
offsets headers: Refactor kernel and arch headers. 2019-11-06 16:07:32 -08:00
secureshield arch: Simplify private header include path configuration. 2019-11-06 16:07:32 -08:00
arc_connect.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
arc_smp.c kernel/smp: arch/x86_64: Address race with CPU migration 2020-02-08 08:51:04 -05:00
cache.c arch: arc: build cache.c conditionally 2019-07-04 10:04:27 -04:00
CMakeLists.txt extensions.cmake: Replace TEXT_START with ROM_START 2020-01-23 03:22:59 -08:00
cpu_idle.S arch: arc: do not use sleep instruction for nsim smp 2019-11-13 12:04:18 -08:00
fast_irq.S arch: arc: fix the bug where firq comes out in user mode 2020-02-05 08:49:10 -08:00
fatal.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
fault_s.S arc: rename some arc-specific functions 2019-11-07 15:21:46 -08:00
fault.c arc: rename some arc-specific functions 2019-11-07 15:21:46 -08:00
irq_manage.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
irq_offload.c global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
isr_wrapper.S arc: remove old macro used for event logger 2020-01-09 11:21:19 -05:00
prep_c.c arch: arc: add initial support of SMP 2019-08-07 12:21:00 +02:00
regular_irq.S arch: arc: fix the bug where regular irq comes out in user mode 2020-02-05 08:49:10 -08:00
reset.S arch: arc: split codes for SMP and codes for multicore 2019-11-13 12:04:18 -08:00
switch.S arch: arc: fix the bug where regular irq comes out in user mode 2020-02-05 08:49:10 -08:00
thread_entry_wrapper.S kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
thread.c kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
timestamp.c kernel/sys_clock.h: Deprecate and convert uses of old conversions 2019-11-08 11:08:58 +01:00
userspace.S kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
vector_table.c global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
vector_table.ld arc: linker.ld: Port vector table to zephyr_linker_sources() 2019-12-20 08:54:53 -05:00