mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
wfe_ldrex_strex.cpp
This commit is contained in:
16
README.adoc
16
README.adoc
@@ -18634,8 +18634,6 @@ However, likely no implementation likely does (TODO confirm), since:
|
||||
|
||||
and power consumption is key in ARM applications.
|
||||
|
||||
SEV is not the only thing that can wake up a WFE, it is only an explicit software way to do it. Notably, global monitor operations on memory accesses of regions marked by LDAXR and STLXR instructions can also wake up a WFE sleeping core. This is done to allow spinlocks opens to automatically wake up WFE sleeping cores at free time without the need for a explicit SEV.
|
||||
|
||||
Quotes for the above <<armarm8-db>> G1.18.1 "Wait For Event and Send Event":
|
||||
|
||||
____
|
||||
@@ -18693,6 +18691,20 @@ The following Raspberry Pi bibliography helped us get this sample up and running
|
||||
|
||||
For how userland spinlocks and mutexes are implemented see <<userland-mutex-implementation>>.
|
||||
|
||||
====== ARM WFE global monitor events
|
||||
|
||||
link:userland/arch/aarch64/inline_asm/wfe_ldxr_stxr.cpp[]
|
||||
|
||||
SEV is not the only thing that can wake up a WFE, it is only an explicit software way to do it.
|
||||
|
||||
Notably, global monitor operations on memory accesses of regions marked by <<arm-ldxr-and-stxr-instructions,LDAXR and STLXR instructions>> can also wake up a WFE sleeping core.
|
||||
|
||||
This is done to allow spinlocks opens to automatically wake up WFE sleeping cores at free time without the need for a explicit SEV.
|
||||
|
||||
In the shown in the `wfe_ldrex_strex.cpp` example, which can only terminate in gem5 user mode simulation because due to this event.
|
||||
|
||||
Note that that program still terminates when running on top of the Linux kernel as explained at: <<wfe-from-userland>>.
|
||||
|
||||
====== WFE from userland
|
||||
|
||||
WFE and SEV are usable from userland, and are part of an efficient spinlock implementation (which userland should arguably stay away from and rather use the <<futex-system-call>> which allow for non busy sleep instead), which maybe is not something that userland should ever tho and just stick to mutexes?
|
||||
|
||||
Reference in New Issue
Block a user