linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/5] Legacy instruction emulation for arm64
@ 2014-10-01 12:07 Punit Agrawal
  2014-10-01 12:07 ` [PATCHv2 1/5] arm64: Add support for hooks to handle undefined instructions Punit Agrawal
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Punit Agrawal @ 2014-10-01 12:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

This is the second posting of the legacy instruction support for
arm64. The previous posting can be found at [1].

The patchset ports the infrastructure to register hooks for undefined
instruction abort and uses this to adds support for the emulation of
SWP{B} and CP15 Barrier instructions from ARMv7 to the v8 port of
Linux.

Via sysctl, it is possible to control the runtime state of emulation
* Off
  sysctl value: 0
  Generates undefined instruction abort. Default for instructions that
  have been obsoleted in the architecture, e.g., SWP

* Emulate
  sysctl 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

* Enable
  sysctl 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.

Patches 1-2/5 add infrastructure code to add support for undefined
instruction hooks and decoding condition checks.

Patch 3-4/6 adds support for SWP and CP15 barriers respectively. They
also provide the ability to control the emulation by writing one of
the above three values to /proc/sys/abi file nodes.

Patch 6/6 introduces a trace point to log instruction emulation and then
uses this to trace the usage of the above instructions when using
emulation.

Although not in a merge window, the intention of the posting is to
allow early access to the code to reduce divergenece in product
kernels where additional features are being worked on.

Cheers,
Punit

Changes since [1]:
* Added support for Thumb instructions when registering undefined
hooks as well
* Emulation support is now added to armv8_deprecated.c (was previously
v7_obsolete.c)
* Instruction support level - Off, Emulate or Enable (when supported
in hardware) - is now controlled through sysctl
* Using trace points instead of debugfs for stats reporting


[1] http://thread.gmane.org/gmane.linux.ports.arm.kernel/351054

Punit Agrawal (5):
  arm64: Add support for hooks to handle undefined instructions
  arm64: Add AArch32 instruction set condition code checks
  arm64: Port SWP/SWPB emulation support from arm
  arm64: Emulate CP15 Barrier instructions
  arm64: Trace emulation of AArch32 legacy instructions

 arch/arm64/Kconfig                   |   54 ++++
 arch/arm64/include/asm/insn.h        |   10 +
 arch/arm64/include/asm/opcodes.h     |    1 +
 arch/arm64/include/asm/traps.h       |   16 ++
 arch/arm64/kernel/Makefile           |    5 +-
 arch/arm64/kernel/armv8_deprecated.c |  489 ++++++++++++++++++++++++++++++++++
 arch/arm64/kernel/insn.c             |   26 ++
 arch/arm64/kernel/traps.c            |   68 +++++
 include/trace/events/emulation.h     |   35 +++
 9 files changed, 703 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/include/asm/opcodes.h
 create mode 100644 arch/arm64/kernel/armv8_deprecated.c
 create mode 100644 include/trace/events/emulation.h

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-10-14 16:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-01 12:07 [PATCHv2 0/5] Legacy instruction emulation for arm64 Punit Agrawal
2014-10-01 12:07 ` [PATCHv2 1/5] arm64: Add support for hooks to handle undefined instructions Punit Agrawal
2014-10-01 12:07 ` [PATCHv2 2/5] arm64: Add AArch32 instruction set condition code checks Punit Agrawal
2014-10-01 12:07 ` [PATCHv2 3/5] arm64: Port SWP/SWPB emulation support from arm Punit Agrawal
2014-10-01 12:07 ` [PATCHv2 4/5] arm64: Emulate CP15 Barrier instructions Punit Agrawal
2014-10-01 12:07 ` [PATCHv2 5/5] arm64: Trace emulation of AArch32 legacy instructions Punit Agrawal
2014-10-01 14:40   ` Steven Rostedt
2014-10-14 16:18     ` Punit Agrawal
2014-10-01 13:37 ` [PATCHv2 0/5] Legacy instruction emulation for arm64 Punit Agrawal
2014-10-01 13:37   ` [PATCHv2 1/5] arm64: Add support for hooks to handle undefined instructions Punit Agrawal
2014-10-01 13:37   ` [PATCHv2 2/5] arm64: Add AArch32 instruction set condition code checks Punit Agrawal
2014-10-01 13:37   ` [PATCHv2 3/5] arm64: Port SWP/SWPB emulation support from arm Punit Agrawal
2014-10-06 10:52     ` Will Deacon
2014-10-01 13:37   ` [PATCHv2 4/5] arm64: Emulate CP15 Barrier instructions Punit Agrawal
2014-10-01 13:37   ` [PATCHv2 5/5] arm64: Trace emulation of AArch32 legacy instructions Punit Agrawal
2014-10-06 10:22   ` [PATCHv2 0/5] Legacy instruction emulation for arm64 Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).