Skip to content

Commit f0479c4

Browse files
hmynenimpe
authored andcommitted
selftests/powerpc: Use proper error code to check fault address
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]
1 parent 6068e1a commit f0479c4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/testing/selftests/powerpc/nx-gzip/gunz_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,13 +698,13 @@ int decompress_file(int argc, char **argv, void *devhandle)
698698

699699
switch (cc) {
700700

701-
case ERR_NX_TRANSLATION:
701+
case ERR_NX_AT_FAULT:
702702

703703
/* We touched the pages ahead of time. In the most common case
704704
* we shouldn't be here. But may be some pages were paged out.
705705
* Kernel should have placed the faulting address to fsaddr.
706706
*/
707-
NXPRT(fprintf(stderr, "ERR_NX_TRANSLATION %p\n",
707+
NXPRT(fprintf(stderr, "ERR_NX_AT_FAULT %p\n",
708708
(void *)cmdp->crb.csb.fsaddr));
709709

710710
if (pgfault_retries == NX_MAX_FAULTS) {

tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ int compress_file(int argc, char **argv, void *handle)
306306
lzcounts, cmdp, handle);
307307

308308
if (cc != ERR_NX_OK && cc != ERR_NX_TPBC_GT_SPBC &&
309-
cc != ERR_NX_TRANSLATION) {
309+
cc != ERR_NX_AT_FAULT) {
310310
fprintf(stderr, "nx error: cc= %d\n", cc);
311311
exit(-1);
312312
}
313313

314314
/* Page faults are handled by the user code */
315-
if (cc == ERR_NX_TRANSLATION) {
315+
if (cc == ERR_NX_AT_FAULT) {
316316
NXPRT(fprintf(stderr, "page fault: cc= %d, ", cc));
317317
NXPRT(fprintf(stderr, "try= %d, fsa= %08llx\n",
318318
fault_tries,

0 commit comments

Comments
 (0)