[PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3305d

4 messages, 4 authors, 2017-09-13 · open the first message on its own page

[PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction

From: Paul Mackerras <hidden>
Date: 2017-09-13 04:51:28

This fixes the emulation of the dcbz instruction in the alignment
interrupt handler.  The error was that we were comparing just the
instruction type field of op.type rather than the whole thing,
and therefore the comparison "type != CACHEOP + DCBZ" was always
true.

Fixes: 31bfdb036f12 ("powerpc: Use instruction emulation infrastructure to handle alignment faults")
Signed-off-by: Paul Mackerras <redacted>
---
 arch/powerpc/kernel/align.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 26b9994d27ee..43ef25156480 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -341,7 +341,7 @@ int fix_alignment(struct pt_regs *regs)
 
 	type = op.type & INSTR_TYPE_MASK;
 	if (!OP_IS_LOAD_STORE(type)) {
-		if (type != CACHEOP + DCBZ)
+		if (op.type != CACHEOP + DCBZ)
 			return -EINVAL;
 		PPC_WARN_ALIGNMENT(dcbz, regs);
 		r = emulate_dcbz(op.ea, regs);
-- 
2.11.0

Re: [PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction

From: Michael Ellerman <hidden>
Date: 2017-09-13 06:53:40

Michal, Christian, can you please confirm this fixes the problems you were seeing.

cheers

On 13 September 2017 2:51:24 pm AEST, Paul Mackerras [off-list ref] wrote:
quoted hunk
This fixes the emulation of the dcbz instruction in the alignment
interrupt handler.  The error was that we were comparing just the
instruction type field of op.type rather than the whole thing,
and therefore the comparison "type != CACHEOP + DCBZ" was always
true.

Fixes: 31bfdb036f12 ("powerpc: Use instruction emulation infrastructure
to handle alignment faults")
Signed-off-by: Paul Mackerras <redacted>
---
arch/powerpc/kernel/align.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 26b9994d27ee..43ef25156480 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -341,7 +341,7 @@ int fix_alignment(struct pt_regs *regs)
	type = op.type & INSTR_TYPE_MASK;
	if (!OP_IS_LOAD_STORE(type)) {
-		if (type != CACHEOP + DCBZ)
+		if (op.type != CACHEOP + DCBZ)
			return -EINVAL;
		PPC_WARN_ALIGNMENT(dcbz, regs);
		r = emulate_dcbz(op.ea, regs);
-- 
2.11.0
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Re: [PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction

From: Michal Sojka <hidden>
Date: 2017-09-13 07:15:56

On Wed, Sep 13 2017, Michael Ellerman wrote:
Michal, Christian, can you please confirm this fixes the problems you
were seeing.
Yes, it fixes my problem. Thanks.

-Michal

[PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction

From: Christian Zigotzky <hidden>
Date: 2017-09-13 14:23:14

On 13 September 2017 at 09:15AM, Michal Sojka wrote:
On Wed, Sep 13 2017, Michael Ellerman wrote:
quoted
Michal, Christian, can you please confirm this fixes the problems you
were seeing.
Yes, it fixes my problem. Thanks.

-Michal
It also fixes my problem. Many thanks!

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