diff mbox series

[kvm-unit-tests,GIT,PULL,09/13] s390x: emulator: Fix error path of invalid function code

Message ID 20240424105935.184138-10-nrb@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests,GIT,PULL,01/13] s390x/Makefile: simplify Secure Execution boot image generation | expand

Commit Message

Nico Boehr April 24, 2024, 10:59 a.m. UTC
From: Christian Borntraeger <borntraeger@linux.ibm.com>

When 127 is not an invalid function code we should not wait for the
program check. Move this check into the else branch.

Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
 s390x/emulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/s390x/emulator.c b/s390x/emulator.c
index 2c42f96f..5a5a3edb 100644
--- a/s390x/emulator.c
+++ b/s390x/emulator.c
@@ -130,8 +130,8 @@  static __always_inline void __test_cpacf_invalid_func(unsigned int opcode)
 		report_skip("127 not invalid");
 	} else {
 		__test_cpacf(opcode, 127, 2, 4, 6);
+		check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
 	}
-	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
 	report_prefix_pop();
 }