Skip to contentSkip to conversation

s390x: add tests for diag258

PATCH Superseded Nico Boehr 1 participant 3 messages Sep 17, 2024

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Nico Boehr

author
#0 lore raw

cover s390x: add tests for diag258

Add tests for diag258 handling on s390x.

There recently was a bugfix in the kernel:
https://lore.kernel.org/r/[email protected]

This adds tests for it.

Nico Boehr (2):
s390x: add test for diag258
s390x: edat: move LC_SIZE to arch_def.h

 lib/s390x/asm/arch_def.h |   1 +
 s390x/Makefile           |   1 +
 s390x/diag258.c          | 250 +++++++++++++++++++++++++++++++++++++++
 s390x/edat.c             |   1 -
 s390x/unittests.cfg      |   3 +
 5 files changed, 255 insertions(+), 1 deletion(-)
 create mode 100644 s390x/diag258.c
Signature · 1 line
2.46.0
author
#1 lore raw

PATCH 1/2 s390x: add test for diag258

This adds a test for diag258 (page ref service/async page fault).

There recently was a virtual-real address confusion bug, so we should test:
- diag258 parameter Rx is a real adress
- crossing the end of RAM with the parameter list yields an addressing exception
- invalid diagcode in the parameter block yields an specification exception
- diag258 correctly applies prefixing.

Note that we're just testing error cases as of now.

---
 s390x/Makefile      |   1 +
 s390x/diag258.c     | 250 ++++++++++++++++++++++++++++++++++++++++++++
 s390x/unittests.cfg |   3 +
 3 files changed, 254 insertions(+)
 create mode 100644 s390x/diag258.c
s390x/Makefile +1 -0
index 23342bd64f44..66d71351caab 100644
@@ -44,6 +44,7 @@ tests += $(TEST_DIR)/exittime.elf
 tests += $(TEST_DIR)/ex.elf
 tests += $(TEST_DIR)/topology.elf
 tests += $(TEST_DIR)/sie-dat.elf
+tests += $(TEST_DIR)/diag258.elf
 
 pv-tests += $(TEST_DIR)/pv-diags.elf
 pv-tests += $(TEST_DIR)/pv-icptcode.elf
s390x/diag258.c new file +250 -0

250 lines not on this page · raw message

s390x/unittests.cfg +3 -0
index 3a9decc932f2..8131ba105d3f 100644
@@ -392,3 +392,6 @@ file = sie-dat.elf
 
 [pv-attest]
 file = pv-attest.elf
+
+[diag258]
+file = diag258.elf
Signature · 1 line
2.46.0
author
#2 lore raw

PATCH 2/2 s390x: edat: move LC_SIZE to arch_def.h

In reply to Nico Boehr

struct lowcore is defined in arch_def.h and LC_SIZE is useful to other tests as well, therefore move it to arch_def.h.

---
 lib/s390x/asm/arch_def.h | 1 +
 s390x/edat.c             | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
lib/s390x/asm/arch_def.h +1 -0
index 745a33878de5..5574a45156a9 100644
@@ -119,6 +119,7 @@ enum address_space {
 
 #define CTL2_GUARDED_STORAGE		(63 - 59)
 
+#define LC_SIZE	(2 * PAGE_SIZE)
 struct lowcore {
 	uint8_t		pad_0x0000[0x0080 - 0x0000];	/* 0x0000 */
 	uint32_t	ext_int_param;			/* 0x0080 */
s390x/edat.c +0 -1
index 16138397017c..e664b09d9633 100644
@@ -17,7 +17,6 @@
 
 #define PGD_PAGE_SHIFT (REGION1_SHIFT - PAGE_SHIFT)
 
-#define LC_SIZE	(2 * PAGE_SIZE)
 #define VIRT(x)	((void *)((unsigned long)(x) + (unsigned long)mem))
 
 static uint8_t prefix_buf[LC_SIZE] __attribute__((aligned(LC_SIZE)));
Signature · 1 line
2.46.0