^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) Software emulation of deprecated SWP instruction (CONFIG_SWP_EMULATE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) ---------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) ARMv6 architecture deprecates use of the SWP/SWPB instructions, and recommeds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) moving to the load-locked/store-conditional instructions LDREX and STREX.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ARMv7 multiprocessing extensions introduce the ability to disable these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) instructions, triggering an undefined instruction exception when executed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) Trapped instructions are emulated using an LDREX/STREX or LDREXB/STREXB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) sequence. If a memory access fault (an abort) occurs, a segmentation fault is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) signalled to the triggering process.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) /proc/cpu/swp_emulation holds some statistics/information, including the PID of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) the last process to trigger the emulation to be invocated. For example::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) Emulated SWP: 12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) Emulated SWPB: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) Aborted SWP{B}: 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) Last process: 314
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) when accessing uncached shared regions, LDREX/STREX rely on an external
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) transaction monitoring block called a global monitor to maintain update
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) atomicity. If your system does not implement a global monitor, this option can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) cause programs that perform SWP operations to uncached memory to deadlock, as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) the STREX operation will always fail.