Thread (21 messages) 21 messages, 7 authors, 2013-10-28

Re: [PATCH] [RFC] Emulate "lwsync" to run standard user land on e500 cores

From: Kumar Gala <hidden>
Date: 2013-10-24 04:06:30

On Oct 23, 2013, at 5:15 AM, Scott Wood wrote:
On Wed, 2013-10-23 at 00:07 -0500, Kumar Gala wrote:
quoted
On Oct 18, 2013, at 2:38 AM, Wolfgang Denk wrote:
quoted
diff --git a/arch/powerpc/kernel/traps.c =
b/arch/powerpc/kernel/traps.c
quoted
quoted
index f783c93..f330374 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -986,6 +986,13 @@ static int emulate_instruction(struct pt_regs =
*regs)
quoted
quoted
		return 0;
	}
=20
+	/* Emulating the lwsync insn as a sync insn */
+	if (instword =3D=3D PPC_INST_LWSYNC) {
+		PPC_WARN_EMULATED(lwsync, regs);
+		asm volatile("sync" : : : "memory");
=20
Do we really need the inline asm?  Doesn't the fact of just taking an =
exception and returning from it equate to a sync.
=20
No, it doesn't equate to a sync.  See the discussion here:
http://patchwork.ozlabs.org/patch/256747/
=20
Thanks.=20

I'm not sure I'm a fan of doing this as it silently hides a significant =
performance impact.

Could we possible re-write the userspace instruction to be a 'sync' when =
we hit this?

- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help