mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 02:04:05 +08:00
bd35a4adc4
The SWP instruction was deprecated in the ARMv6 architecture. The ARMv7 multiprocessing extensions mandate that SWP/SWPB instructions are treated as undefined from reset, with the ability to enable them through the System Control Register SW bit. With ARMv8, the option to enable these instructions through System Control Register was dropped as well. To support legacy applications using these instructions, port the emulation of the SWP and SWPB instructions from the arm port to arm64. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
41 lines
1.5 KiB
Plaintext
41 lines
1.5 KiB
Plaintext
The arm64 port of the Linux kernel provides infrastructure to support
|
|
emulation of instructions which have been deprecated, or obsoleted in
|
|
the architecture. The infrastructure code uses undefined instruction
|
|
hooks to support emulation. Where available it also allows turning on
|
|
the instruction execution in hardware.
|
|
|
|
The emulation mode can be controlled by writing to sysctl nodes
|
|
(/proc/sys/abi). The following explains the different execution
|
|
behaviours and the corresponding values of the sysctl nodes -
|
|
|
|
* Undef
|
|
Value: 0
|
|
Generates undefined instruction abort. Default for instructions that
|
|
have been obsoleted in the architecture, e.g., SWP
|
|
|
|
* Emulate
|
|
Value: 1
|
|
Uses software emulation. To aid migration of software, in this mode
|
|
usage of emulated instruction is traced as well as rate limited
|
|
warnings are issued. This is the default for deprecated
|
|
instructions, .e.g., CP15 barriers
|
|
|
|
* Hardware Execution
|
|
Value: 2
|
|
Although marked as deprecated, some implementations may support the
|
|
enabling/disabling of hardware support for the execution of these
|
|
instructions. Using hardware execution generally provides better
|
|
performance, but at the loss of ability to gather runtime statistics
|
|
about the use of the deprecated instructions.
|
|
|
|
The default mode depends on the status of the instruction in the
|
|
architecture. Deprecated instructions should default to emulation
|
|
while obsolete instructions must be undefined by default.
|
|
|
|
Supported legacy instructions
|
|
-----------------------------
|
|
* SWP{B}
|
|
Node: /proc/sys/abi/swp
|
|
Status: Obsolete
|
|
Default: Undef (0)
|