提交 9863c28a 编写于 作者: J James Yang 提交者: Scott Wood

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: NJames Yang <James.Yang@freescale.com>
[scottwood@freescale.com: whitespace and subject line fix]
Signed-off-by: NScott Wood <scottwood@freescale.com>
上级 c58ce397
...@@ -143,6 +143,8 @@ ...@@ -143,6 +143,8 @@
#define PPC_INST_LSWX 0x7c00042a #define PPC_INST_LSWX 0x7c00042a
#define PPC_INST_LWARX 0x7c000028 #define PPC_INST_LWARX 0x7c000028
#define PPC_INST_LWSYNC 0x7c2004ac #define PPC_INST_LWSYNC 0x7c2004ac
#define PPC_INST_SYNC 0x7c0004ac
#define PPC_INST_SYNC_MASK 0xfc0007fe
#define PPC_INST_LXVD2X 0x7c000698 #define PPC_INST_LXVD2X 0x7c000698
#define PPC_INST_MCRXR 0x7c000400 #define PPC_INST_MCRXR 0x7c000400
#define PPC_INST_MCRXR_MASK 0xfc0007fe #define PPC_INST_MCRXR_MASK 0xfc0007fe
......
...@@ -1018,6 +1018,13 @@ static int emulate_instruction(struct pt_regs *regs) ...@@ -1018,6 +1018,13 @@ static int emulate_instruction(struct pt_regs *regs)
return emulate_isel(regs, instword); 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 #ifdef CONFIG_PPC64
/* Emulate the mfspr rD, DSCR. */ /* Emulate the mfspr rD, DSCR. */
if ((((instword & PPC_INST_MFSPR_DSCR_USER_MASK) == if ((((instword & PPC_INST_MFSPR_DSCR_USER_MASK) ==
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册