ARM: 7208/1: Add condition code checking to SWP emulation handler.
authorLeif Lindholm <leif.lindholm@arm.com>
Mon, 12 Dec 2011 18:45:24 +0000 (19:45 +0100)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 4 Jul 2013 22:54:17 +0000 (01:54 +0300)
commit1593bba2d9619e0615ec30c43a6bac4940cd9870
tree7416ec95be1db796c5621a08e41e2d36bba0ec72
parentfd3757afbebf8bf8fe5b50ba0ea86689880dd011
ARM: 7208/1: Add condition code checking to SWP emulation handler.

This patch fixes two separate issues with the SWP emulation handler:
1: Certain processors implementing ARMv7-A can (legally) take an
   undef exception even when the condition code would have meant that
   the instruction should not have been executed.
2: Opcodes with all flags set (condition code = 0xf) have been reused
   in recent, and not-so-recent, versions of the ARM architecture to
   implement unconditional extensions to the instruction set. The
   existing code would still have processed any undefs triggered by
   executing an opcode with such a value.

This patch uses the new generic ARM instruction set condition code
checks to implement proper handling of these situations.

Signed-off-by: Leif Lindholm <leif.lindholm@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/swp_emulate.c