zephyr/include
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
..
app_memory kernel: fix k_mem_partition data types 2019-12-12 14:48:42 -08:00
arch arch/x86_64: make sysapic.h available for x86_64 as well 2020-02-07 14:14:53 -08:00
audio include: respect line limit in api pointer initialization 2019-12-16 21:14:08 -05:00
bluetooth Bluetooth: Mesh: Support reliable sending when publishing 2020-02-07 20:42:15 +02:00
canbus can: isotp: Add ISO-TP library 2020-02-06 10:16:29 +02:00
cmsis_rtos_v1
cmsis_rtos_v2 global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
console
crypto include: crypto: Add Galois/Counter Mode (GCM) support 2020-02-08 13:40:33 +02:00
data treewide: avoid address-of-compound-literal idiom in headers 2019-12-18 21:53:17 +01:00
debug kernel: overhaul unused stack measurement 2020-02-08 10:02:35 +02:00
dfu include: dfu: Add extern "C" in mcuboot.h 2020-01-15 12:18:59 -06:00
disk
display
drivers drivers: clock_control: Add subsys argument to the callback 2020-02-05 17:07:01 +01:00
dt-bindings gpio: support logic-level output at initialization 2020-02-05 12:00:36 +01:00
fs fs: remove NFFS subsystem 2020-01-21 15:32:47 +01:00
linker tracing: add infrastructure for collection of tracing data 2020-02-05 23:54:26 -05:00
logging logging: Added explicit casts of buffer in hexdump delegates 2020-01-28 17:20:15 -05:00
mgmt
net net: sockets: Remove socket offloading interface 2020-01-31 11:36:02 -05:00
posix pthread: wrap header with extern C 2020-02-08 10:21:01 +02:00
power power: add system power management direct force mode. 2020-01-24 21:37:40 -05:00
random subsys/random: Add cryptographically secure and bulk fill functions 2019-11-05 19:36:42 +01:00
settings doc/subsys/settings: improve settings API doc 2020-01-31 07:45:52 -05:00
shell shell: Fix SHELL_COND_CMD_ARG_REGISTER macro with NULL handler 2020-02-01 08:10:06 -05:00
stats
storage doc: fix flash_area_get_sectors doc 2019-10-25 16:40:12 -05:00
sys kernel: move timing externs to public header 2020-02-06 23:07:37 -05:00
toolchain include: gcc.h: Add a __WARN() macro with a custom warning on expansion 2020-02-01 08:48:17 -05:00
tracing tracing: move headers under include/tracing 2020-02-07 15:58:05 -05:00
usb usb: make usb descriptor power options configurable 2019-12-20 19:46:16 -05:00
zephyr include: Remove compat include headers 2019-12-10 08:39:37 -05:00
cache.h
device.h power: device: deduplicate suspending code 2020-02-02 09:05:15 -05:00
devicetree.h dts: Rename generated_dts_board*.{h,conf} to devicetree*.{h,conf} 2020-01-17 17:57:59 +01:00
exc_handle.h kernel: rename z_arch_ to arch_ 2019-11-07 15:21:46 -08:00
fatal.h doc: fix misspelling in API doxygen comments 2019-10-29 06:00:14 +01:00
generated_dts_board.h dts: Add include/generated_dts_board.h for backwards compatibility 2020-01-17 17:57:59 +01:00
init.h kernel: move test of kernel startup state to more visible location 2020-01-06 13:55:31 -05:00
irq_nextlevel.h include: respect line limit in api pointer initialization 2019-12-16 21:14:08 -05:00
irq_offload.h kernel: sychronize irq_offload() access 2019-11-08 15:16:43 -08:00
irq.h irq: add note about irq_lock/unlock access 2020-01-08 08:20:48 -05:00
kernel_includes.h headers: Refactor kernel and arch headers. 2019-11-06 16:07:32 -08:00
kernel_structs.h kernel/smp: arch/x86_64: Address race with CPU migration 2020-02-08 08:51:04 -05:00
kernel_version.h
kernel.h kernel: overhaul unused stack measurement 2020-02-08 10:02:35 +02:00
ptp_clock.h include: respect line limit in api pointer initialization 2019-12-16 21:14:08 -05:00
sched_priq.h
shared_irq.h include: respect line limit in api pointer initialization 2019-12-16 21:14:08 -05:00
spinlock.h kernel: show what spinlock was used incorrectly 2020-01-13 10:17:16 -05:00
sw_isr_table.h
sys_clock.h sys_clock: Fix typo in SYS_CLOCK_HW_CYCLES_TO_NS64() macro 2019-12-17 13:06:55 -05:00
syscall_handler.h kernel: fix 64-bit issues in syscall_handler.h 2019-12-12 14:48:42 -08:00
syscall.h global: Remove leading/trailing blank lines in files 2019-12-11 19:17:27 +01:00
timeout_q.h kernel: include: Fix warning when !CONFIG_SYS_CLOCK_EXISTS 2019-11-07 08:22:59 -05:00
toolchain.h
wait_q.h headers: Refactor kernel and arch headers. 2019-11-06 16:07:32 -08:00
zephyr.h