LoginSignup
0
0

More than 3 years have passed since last update.

Software emulation of deprecated SWP instruction (CONFIG_SWP_EMULATE)

Last updated at Posted at 2020-05-20

Software emulation of deprecated SWP instruction (CONFIG_SWP_EMULATE)

ARMv6 architecture deprecates use of the SWP/SWPB instructions, and recommeds moving to the load-locked/store-conditional instructions LDREX and STREX.

ARMv6 architecture では、SWP/SWPB命令の利用が廃止されていて、load-locked/store-conditional 命令としては、LDREX/STREXを使うことが推奨されている。

ARMv7 multiprocessing extensions introduce the ability to disable these instructions, triggering an undefined instruction exception when executed. Trapped instructions are emulated using an LDREX/STREX or LDREXB/STREXB sequence. If a memory access fault (an abort) occurs, a segmentation fault is signalled to the triggering process.

ARMv7マルチプロセッシング拡張機能は、これらの命令を無効にする機能を導入し、実行時に未定義命令例外をトリガーします。 トラップされた命令では、LDREX/STREX、または、LDREXV/STREXBシーケンスを用いて、エミュレーションされます。もし、memory access fault (an abort)が発生した場合、セグメンテーションエラーが、トリガープロセスに伝達されます。

/proc/cpu/swp_emulation holds some statistics/information, including the PID of the last process to trigger the emulation to be invocated. For example:

/proc/cpu/swp_emulationには、呼び出されるエミュレーションをトリガーする最後のプロセスのPIDを含む、いくつかの統計的/情報が保持されています。例えば:

Emulated SWP:         12
Emulated SWPB:                0
Aborted SWP{B}:               1
Last process:         314

NOTE:

when accessing uncached shared regions, LDREX/STREX rely on an external transaction monitoring block called a global monitor to maintain update atomicity.

キャッシュされていない共有領域にアクセスするとき、LDREX/STREXは、更新の原子性を維持するために、グローバルモニターと呼ばれる外部トランザクション監視ブロックに依存します。

If your system does not implement a global monitor, this option can cause programs that perform SWP operations to uncached memory to deadlock, as the STREX operation will always fail.

システムがグローバルモニターを実装していない場合、STREX操作は常に失敗するため、キャッシュされていないメモリに対してSWP操作を実行するプログラムがこのオプションによってデッドロックする可能性があります。


もともと、Linux Kernelのソースコードの一部なので、GPLv2扱いになる(はずの認識)。

https://www.kernel.org/doc/html/latest/index.html

Licensing documentation

The following describes the license of the Linux kernel source code (GPLv2), how to properly mark the license of individual files in the source tree, as well as links to the full license text.

https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0