summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/traps.c
diff options
context:
space:
mode:
authorJames Yang <James.Yang@freescale.com>2013-07-03 16:26:47 -0500
committerScott Wood <scottwood@freescale.com>2013-10-16 18:51:18 -0500
commit9863c28a2af90a56c088f5f6288d7f6d2c923c14 (patch)
tree8c78c0eec82bcb7f1c2fd616c3a3c5f25f508588 /arch/powerpc/kernel/traps.c
parentc58ce397a62ec14b7b06c407a4173ed667e20d5f (diff)
downloadop-kernel-dev-9863c28a2af90a56c088f5f6288d7f6d2c923c14.zip
op-kernel-dev-9863c28a2af90a56c088f5f6288d7f6d2c923c14.tar.gz
powerpc: Emulate sync instruction variants
Reserved fields of the sync instruction have been used for other instructions (e.g. lwsync). On processors that do not support variants of the sync instruction, emulate it by executing a sync to subsume the effect of the intended instruction. Signed-off-by: James Yang <James.Yang@freescale.com> [scottwood@freescale.com: whitespace and subject line fix] Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r--arch/powerpc/kernel/traps.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index f0a6814..36a1f95 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1018,6 +1018,13 @@ static int emulate_instruction(struct pt_regs *regs)
return emulate_isel(regs, instword);
}
+ /* Emulate sync instruction variants */
+ if ((instword & PPC_INST_SYNC_MASK) == PPC_INST_SYNC) {
+ PPC_WARN_EMULATED(sync, regs);
+ asm volatile("sync");
+ return 0;
+ }
+
#ifdef CONFIG_PPC64
/* Emulate the mfspr rD, DSCR. */
if ((((instword & PPC_INST_MFSPR_DSCR_USER_MASK) ==
OpenPOWER on IntegriCloud