]> Git Repo - linux.git/commitdiff
selftests/powerpc: Use proper error code to check fault address
authorHaren Myneni <[email protected]>
Fri, 10 Jul 2020 23:49:58 +0000 (16:49 -0700)
committerMichael Ellerman <[email protected]>
Wed, 15 Jul 2020 13:10:17 +0000 (23:10 +1000)
ERR_NX_TRANSLATION(CSB.CC=5) is for internal to VAS for fault handling
and should not used by OS. ERR_NX_AT_FAULT(CSB.CC=250) is the proper
error code should be reported by OS when NX encounters address
translation failure.

This patch uses CC=250 to determine the fault address when the request
is not successful.

Signed-off-by: Haren Myneni <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
tools/testing/selftests/powerpc/nx-gzip/gunz_test.c
tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c

index 6ee0fded03911011c9445f59bea232d554e9989c..7c23d3dd7d6d91f574449cd694ff7efc3f0625f7 100644 (file)
@@ -698,13 +698,13 @@ restart_nx:
 
        switch (cc) {
 
-       case ERR_NX_TRANSLATION:
+       case ERR_NX_AT_FAULT:
 
                /* We touched the pages ahead of time.  In the most common case
                 * we shouldn't be here.  But may be some pages were paged out.
                 * Kernel should have placed the faulting address to fsaddr.
                 */
-               NXPRT(fprintf(stderr, "ERR_NX_TRANSLATION %p\n",
+               NXPRT(fprintf(stderr, "ERR_NX_AT_FAULT %p\n",
                              (void *)cmdp->crb.csb.fsaddr));
 
                if (pgfault_retries == NX_MAX_FAULTS) {
index 7496a83f9c9d78b510cb3e14cf80fc9ee6bda860..02dffb65de48b6001176385fd3a4577de1a69ee5 100644 (file)
@@ -306,13 +306,13 @@ int compress_file(int argc, char **argv, void *handle)
                        lzcounts, cmdp, handle);
 
                if (cc != ERR_NX_OK && cc != ERR_NX_TPBC_GT_SPBC &&
-                   cc != ERR_NX_TRANSLATION) {
+                   cc != ERR_NX_AT_FAULT) {
                        fprintf(stderr, "nx error: cc= %d\n", cc);
                        exit(-1);
                }
 
                /* Page faults are handled by the user code */
-               if (cc == ERR_NX_TRANSLATION) {
+               if (cc == ERR_NX_AT_FAULT) {
                        NXPRT(fprintf(stderr, "page fault: cc= %d, ", cc));
                        NXPRT(fprintf(stderr, "try= %d, fsa= %08llx\n",
                                  fault_tries,
This page took 0.056828 seconds and 4 git commands to generate.