Add support to parse and log control memory access
error for pseries.
Signed-off-by: Ganesh Goudar <redacted>
---
v2: No changes in this patch.
---
arch/powerpc/platforms/pseries/ras.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
@@ -0,0 +1,42 @@+// SPDX-License-Identifier: GPL-2.0-or-later+#include<stdio.h>+#include<unistd.h>+#include<string.h>+#include<errno.h>+#include<sys/stat.h>+#include<sys/types.h>+#include<fcntl.h>+#include<sys/ioctl.h>+#include<sys/mman.h>+#include"vas-api.h"++intmain(void)+{+intfd,ret;+int*paste_addr;+structvas_tx_win_open_attrattr;+char*devname="/dev/crypto/nx-gzip";++memset(&attr,0,sizeof(attr));+attr.version=1;+attr.vas_id=0;++fd=open(devname,O_RDWR);+if(fd<0){+fprintf(stderr,"Failed to open device %s\n",devname);+return-errno;+}+ret=ioctl(fd,VAS_TX_WIN_OPEN,&attr);+if(ret<0){+fprintf(stderr,"ioctl() n %d, error %d\n",ret,errno);+ret=-errno;+gotoout;+}+paste_addr=mmap(NULL,4096,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0ULL);+/* The following assignment triggers exception */+*paste_addr=1;+ret=0;+out:+close(fd);+returnret;+}
@@ -0,0 +1,18 @@+#!/bin/bash+# SPDX-License-Identifier: GPL-2.0-or-later++if[[!-w/dev/crypto/nx-gzip]];then+echo"WARN: Can't access /dev/crypto/nx-gzip, skipping"+exit0+fi++timeout5./inject-ra-err++# 128 + 7 (SIGBUS) = 135, 128 is a exit code with special meaning.+if[$?-ne135];then+echo"FAILED: Real address or Control memory access error not handled"+exit$?+fi++echo"OK: Real address or Control memory access error is handled"+exit0
To avoid ambiguity, modify the strings in real address error
logging messages to "foreign/control memory" from "foreign",
Since the error discriptions in P9 user manual and P10 user
manual are different for same type of errors.
P9 User Manual for MCE:
DSISR:59 Host real address to foreign space during translation.
DSISR:60 Host real address to foreign space on a load or store
access.
P10 User Manual for MCE:
DSISR:59 D-side tablewalk used a host real address in the
control memory address range.
DSISR:60 D-side operand access to control memory address space.
Signed-off-by: Ganesh Goudar <redacted>
---
v2: No changes in this patch.
---
arch/powerpc/kernel/mce.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Hi mpe, Any comments on this patchset?
On 8/5/21 2:50 PM, Ganesh Goudar wrote:
quoted hunk
Add support to parse and log control memory access
error for pseries.
Signed-off-by: Ganesh Goudar <redacted>
---
v2: No changes in this patch.
---
arch/powerpc/platforms/pseries/ras.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-08-24 06:40:52
Hi Ganesh,
Some comments below ...
Ganesh Goudar [off-list ref] writes:
quoted hunk
Add support to parse and log control memory access
error for pseries.
Signed-off-by: Ganesh Goudar <redacted>
---
v2: No changes in this patch.
---
arch/powerpc/platforms/pseries/ras.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-08-24 12:49:11
Ganesh Goudar [off-list ref] writes:
Add test for real address or control memory address access
error handling, using NX-GZIP engine.
The error is injected by accessing the control memory address
using illegal instruction, on successful handling the process
attempting to access control memory address using illegal
instruction receives SIGBUS.
@@ -0,0 +1,18 @@+#!/bin/bash+# SPDX-License-Identifier: GPL-2.0-or-later++if[[!-w/dev/crypto/nx-gzip]];then+echo"WARN: Can't access /dev/crypto/nx-gzip, skipping"+exit0+fi++timeout5./inject-ra-err++# 128 + 7 (SIGBUS) = 135, 128 is a exit code with special meaning.+if[$?-ne135];then+echo"FAILED: Real address or Control memory access error not handled"+exit$?+fi++echo"OK: Real address or Control memory access error is handled"+exit0
I don't think we really need the shell script, we should be able to do
all that in the C code.
Can you try this?
cheers
Hi Ganesh,
Some comments below ...
Ganesh Goudar [off-list ref] writes:
quoted
Add support to parse and log control memory access
error for pseries.
Signed-off-by: Ganesh Goudar <redacted>
---
v2: No changes in this patch.
---
arch/powerpc/platforms/pseries/ras.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
Add test for real address or control memory address access
error handling, using NX-GZIP engine.
The error is injected by accessing the control memory address
using illegal instruction, on successful handling the process
attempting to access control memory address using illegal
instruction receives SIGBUS.
@@ -0,0 +1,18 @@+#!/bin/bash+# SPDX-License-Identifier: GPL-2.0-or-later++if[[!-w/dev/crypto/nx-gzip]];then+echo"WARN: Can't access /dev/crypto/nx-gzip, skipping"+exit0+fi++timeout5./inject-ra-err++# 128 + 7 (SIGBUS) = 135, 128 is a exit code with special meaning.+if[$?-ne135];then+echo"FAILED: Real address or Control memory access error not handled"+exit$?+fi++echo"OK: Real address or Control memory access error is handled"+exit0
I don't think we really need the shell script, we should be able to do
all that in the C code.
Can you try this?
it works!, We need to set timeout, with 120 sec timeout we may flood the dmesg.
Thanks.
On Wed, Aug 25, 2021 at 05:06:29PM +0530, Ganesh wrote:
On 8/25/21 2:54 AM, Segher Boessenkool wrote:
quoted
On Tue, Aug 24, 2021 at 04:39:57PM +1000, Michael Ellerman wrote:
quoted
quoted
+ case MC_ERROR_CTRL_MEM_ACCESS_PTABLE_WALK:
+ mce_err.u.ra_error_type =
+ MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN;
That name is ridiculously long, but I guess that's not your fault :)
We can fix it up in a later patch.
It also has surprisingly little information content for the 47 chars
length it has :-) What does this even mean?!
It means control memory access error/real address error is detected during
page
table walk.
This isn't obvious from the name. The name contains some words your
explanation does not, as well: LOAD, STORE, FOREIGN. Most importantly,
the name is just a jumble of words, with no apparent connection between
them.
I didn't ask for an explanation, sorry if you misunderstood. I was just
exploring the many ways this name is baffling :-)
Segher
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-08-26 02:37:34
Ganesh [off-list ref] writes:
On 8/24/21 12:09 PM, Michael Ellerman wrote:
quoted
Ganesh Goudar [off-list ref] writes:
quoted
Add support to parse and log control memory access
error for pseries.
Signed-off-by: Ganesh Goudar <redacted>
---
v2: No changes in this patch.
---
arch/powerpc/platforms/pseries/ras.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-08-26 03:28:54
Ganesh [off-list ref] writes:
On 8/24/21 6:18 PM, Michael Ellerman wrote:
quoted
Ganesh Goudar [off-list ref] writes:
quoted
Add test for real address or control memory address access
error handling, using NX-GZIP engine.
The error is injected by accessing the control memory address
using illegal instruction, on successful handling the process
attempting to access control memory address using illegal
instruction receives SIGBUS.
@@ -0,0 +1,18 @@+#!/bin/bash+# SPDX-License-Identifier: GPL-2.0-or-later++if[[!-w/dev/crypto/nx-gzip]];then+echo"WARN: Can't access /dev/crypto/nx-gzip, skipping"+exit0+fi++timeout5./inject-ra-err++# 128 + 7 (SIGBUS) = 135, 128 is a exit code with special meaning.+if[$?-ne135];then+echo"FAILED: Real address or Control memory access error not handled"+exit$?+fi++echo"OK: Real address or Control memory access error is handled"+exit0
I don't think we really need the shell script, we should be able to do
all that in the C code.
Can you try this?
it works!, We need to set timeout, with 120 sec timeout we may flood the dmesg.
Hmm. Does it keep faulting? The regs->nip += 4 is meant to avoid that.
cheers
Add test for real address or control memory address access
error handling, using NX-GZIP engine.
The error is injected by accessing the control memory address
using illegal instruction, on successful handling the process
attempting to access control memory address using illegal
instruction receives SIGBUS.
@@ -0,0 +1,18 @@+#!/bin/bash+# SPDX-License-Identifier: GPL-2.0-or-later++if[[!-w/dev/crypto/nx-gzip]];then+echo"WARN: Can't access /dev/crypto/nx-gzip, skipping"+exit0+fi++timeout5./inject-ra-err++# 128 + 7 (SIGBUS) = 135, 128 is a exit code with special meaning.+if[$?-ne135];then+echo"FAILED: Real address or Control memory access error not handled"+exit$?+fi++echo"OK: Real address or Control memory access error is handled"+exit0
I don't think we really need the shell script, we should be able to do
all that in the C code.
Can you try this?
it works!, We need to set timeout, with 120 sec timeout we may flood the dmesg.
Hmm. Does it keep faulting? The regs->nip += 4 is meant to avoid that.
Yes, it keeps faulting, if we fail to handle and not send SIGBUS to the process.