[kvm-unit-tests,PULL,10/17] s390x: Fix stsi unaligned test and add selector tests
diff mbox series

Message ID 20190925163714.27519-11-thuth@redhat.com
State New
Headers show
Series
  • [kvm-unit-tests,PULL,01/17] s390x: Support PSW restart boot
Related show

Commit Message

Thomas Huth Sept. 25, 2019, 4:37 p.m. UTC
From: Janosch Frank <frankja@linux.ibm.com>

Alignment and selectors test order is not specified and so, if you
have an unaligned address and invalid selectors it's up to the
hypervisor to decide which error is presented.

Let's add valid selectors to the unalignmnet test and add selector
tests.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 s390x/stsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/s390x/stsi.c b/s390x/stsi.c
index 7232cb0..c5bd0a2 100644
--- a/s390x/stsi.c
+++ b/s390x/stsi.c
@@ -35,7 +35,7 @@  static void test_specs(void)
 
 	report_prefix_push("unaligned");
 	expect_pgm_int();
-	stsi(pagebuf + 42, 1, 0, 0);
+	stsi(pagebuf + 42, 1, 1, 1);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
 	report_prefix_pop();
 
@@ -71,6 +71,8 @@  static inline unsigned long stsi_get_fc(void *addr)
 static void test_fc(void)
 {
 	report("invalid fc",  stsi(pagebuf, 7, 0, 0) == 3);
+	report("invalid selector 1", stsi(pagebuf, 1, 0, 1) == 3);
+	report("invalid selector 2", stsi(pagebuf, 1, 1, 0) == 3);
 	report("query fc >= 2",  stsi_get_fc(pagebuf) >= 2);
 }