Skip to contentSkip to conversation

s390x: Add prefixes to pgm interrupt checks

PATCH Thomas Huth 1 participant 1 message Sep 19, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Thomas Huth

author Reviewed-by
#1 lore raw
Quoted 140 lines · Janosch Frank

We need the information about which of the checks failed if there are more than one and the prefixes provide that.

---
 s390x/cmm.c    |  4 ++++
 s390x/diag10.c | 23 +++++++++++++++++++++++
 s390x/gs.c     |  8 ++++++++
 s390x/iep.c    |  2 ++
 s390x/pfmf.c   |  2 ++
 s390x/skey.c   |  7 +++++++
 6 files changed, 46 insertions(+)
s390x/cmm.c +4 -0
index 42dfda2..fe4d9df 100644
@@ -29,17 +29,21 @@ static unsigned long essa(uint8_t state, unsigned long paddr)
 
 static void test_params(void)
 {
+	report_prefix_push("invalid ORC 8");
 	expect_pgm_int();
 	essa(8, (unsigned long)pagebuf);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+	report_prefix_pop();
 }
 
 static void test_priv(void)
 {
+	report_prefix_push("privileged");
 	expect_pgm_int();
 	enter_pstate();
 	essa(0, (unsigned long)pagebuf);
 	check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION);
+	report_prefix_pop();
 }
 
 /* Unfortunately the availability is not indicated by stfl bits, but
s390x/diag10.c +23 -0
index 806ebc6..7ee8945 100644
@@ -32,43 +32,66 @@ static inline void diag10(unsigned long start, unsigned long end)
 /* Try freeing the prefix */
 static void test_prefix(void)
 {
+	report_prefix_push("lowcore freeing");
+
+	report_prefix_push("0x0000/0x0000");
 	expect_pgm_int();
 	diag10(0, 0);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+	report_prefix_pop();
 
+
+	report_prefix_push("0x1000/0x1000");
 	expect_pgm_int();
 	diag10(0x1000, 0x1000);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+	report_prefix_pop();
 
+	report_prefix_push("0x0000/0x1000");
 	expect_pgm_int();
 	diag10(0, 0x1000);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+	report_prefix_pop();
+
+	report_prefix_pop();
 }
 
 static void test_params(void)
 {
+	report_prefix_push("start/end");
+
 	/* end < start */
+	report_prefix_push("end < start");
 	expect_pgm_int();
 	diag10(page1, page0);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+	report_prefix_pop();
 
 	/* Unaligned start */
+	report_prefix_push("unaligned start");
 	expect_pgm_int();
 	diag10((unsigned long) pagebuf + 42, page1);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+	report_prefix_pop();
 
 	/* Unaligned end */
+	report_prefix_push("unaligned end");
 	expect_pgm_int();
 	diag10(page0, (unsigned long) pagebuf + PAGE_SIZE + 42);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
+	report_prefix_pop();
+
+	report_prefix_pop();
 }
 
 static void test_priv(void)
 {
+	report_prefix_push("privileged");
 	expect_pgm_int();
 	enter_pstate();
 	diag10(page0, page0);
 	check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION);
+	report_prefix_pop();
 }
 
 int main(void)
s390x/gs.c +8 -0
index bddc2b4..26f22e8 100644
@@ -128,12 +128,20 @@ static void test_load(void)
 /* Test gs instructions without enablement resulting in an exception */
 static void test_special(void)
 {
+	report_prefix_push("disabled gs");
+	report_prefix_push("load gs");
 	expect_pgm_int();
 	load_gs_cb(&gs_cb);
 	check_pgm_int_code(PGM_INT_CODE_SPECIAL_OPERATION);
+	report_prefix_pop();
+
+	report_prefix_push("store gs");
 	expect_pgm_int();
 	store_gs_cb(&gs_cb);
 	check_pgm_int_code(PGM_INT_CODE_SPECIAL_OPERATION);
+	report_prefix_pop();
+
+	report_prefix_pop();
 }
 
 static void init(void)
s390x/iep.c +0 -0
index 8c1ea8f..9f98b09 100644

s390x/iep.c static void test_iep(void) · line 45

Quoted 8 lines
s390x/iep.c +2 -0
@@ -38,7 +38,9 @@ static void test_iep(void)
 	expect_pgm_int();
 	/* Jump into protected page */
 	fn();
+	report_prefix_push("iep protection");
 	check_pgm_int_code(PGM_INT_CODE_PROTECTION);
+	report_prefix_pop();
 	unprotect_page(iepbuf, PAGE_ENTRY_IEP);
 	ctl_clear_bit(0, 20);

Don't you want to put the report_prefix_push before the expect_pgm_int here, too, as you do it in the other spots?

Anyway: