linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction
@ 2017-09-13  4:51 Paul Mackerras
  2017-09-13  6:53 ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Mackerras @ 2017-09-13  4:51 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Christian Zigotzky, Michal Sojka

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 <paulus@ozlabs.org>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction
  2017-09-13  4:51 [PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction Paul Mackerras
@ 2017-09-13  6:53 ` Michael Ellerman
  2017-09-13  7:15   ` Michal Sojka
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2017-09-13  6:53 UTC (permalink / raw)
  To: linuxppc-dev, Paul Mackerras, linuxppc-dev
  Cc: Michal Sojka, Christian Zigotzky

[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]

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 <paulus@ozlabs.org> wrote:
>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 <paulus@ozlabs.org>
>---
> 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.

[-- Attachment #2: Type: text/html, Size: 1634 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction
  2017-09-13  6:53 ` Michael Ellerman
@ 2017-09-13  7:15   ` Michal Sojka
  2017-09-13 14:23     ` Christian Zigotzky
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Sojka @ 2017-09-13  7:15 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev, Paul Mackerras, linuxppc-dev
  Cc: Christian Zigotzky

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction
  2017-09-13  7:15   ` Michal Sojka
@ 2017-09-13 14:23     ` Christian Zigotzky
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Zigotzky @ 2017-09-13 14:23 UTC (permalink / raw)
  To: Michal Sojka, Michael Ellerman, linuxppc-dev, Paul Mackerras,
	linuxppc-dev

On 13 September 2017 at 09:15AM, Michal Sojka wrote:
> 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
>
It also fixes my problem. Many thanks!

-- Christian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-13 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-13  4:51 [PATCH] powerpc: Fix handling of alignment interrupt on dcbz instruction Paul Mackerras
2017-09-13  6:53 ` Michael Ellerman
2017-09-13  7:15   ` Michal Sojka
2017-09-13 14:23     ` Christian Zigotzky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).