diff mbox series

[kvm-unit-tests,v3,09/16] s390x: css: ssch with mis aligned ORB

Message ID 1617694853-6881-10-git-send-email-pmorel@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: Testing SSCH, CSCH and HSCH for errors | expand

Commit Message

Pierre Morel April 6, 2021, 7:40 a.m. UTC
We expect a specification exception for a misaligned ORB.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
 s390x/css.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
diff mbox series

Patch

diff --git a/s390x/css.c b/s390x/css.c
index d248cac..47452ba 100644
--- a/s390x/css.c
+++ b/s390x/css.c
@@ -103,9 +103,30 @@  static void ssch_orb_cpa_zero(void)
 	orb->cpa = cpa;
 }
 
+static void ssch_orb_alignment(void)
+{
+	void *p;
+
+	/* Prepare a Valid orb on a misaligned address*/
+	p = alloc_pages_flags(0, AREA_DMA31);
+	assert(p);
+	p += 2;
+
+	((struct orb *)p)->intparm = test_device_sid;
+	((struct orb *)p)->ctrl = ORB_CTRL_ISIC | ORB_CTRL_FMT | ORB_LPM_DFLT;
+	((struct orb *)p)->cpa = (long)ccw;
+
+	expect_pgm_int();
+	ssch(test_device_sid, p);
+	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+
+	free_pages(p - 2);
+}
+
 static struct tests ssh_tests[] = {
 	{ "privilege", ssch_privilege },
 	{ "orb cpa zero", ssch_orb_cpa_zero },
+	{ "orb alignment", ssch_orb_alignment },
 	{ NULL, NULL }
 };