Re: [kvm-unit-tests PATCH v3 12/16] s390x: css: Check ORB reserved bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 4/6/21 5:51 PM, Cornelia Huck wrote:
On Tue,  6 Apr 2021 09:40:49 +0200
Pierre Morel <pmorel@xxxxxxxxxxxxx> wrote:

Several bits of the ORB are reserved and must be zero.
Their use will trigger a operand exception.

Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxx>
---
  s390x/css.c | 21 +++++++++++++++++++++
  1 file changed, 21 insertions(+)

diff --git a/s390x/css.c b/s390x/css.c
index 56adc16..26f5da6 100644
--- a/s390x/css.c
+++ b/s390x/css.c
@@ -209,6 +209,26 @@ static void ssch_orb_midaw(void)
  	orb->ctrl = tmp;
  }
+static void ssch_orb_ctrl(void)
+{
+	uint32_t tmp = orb->ctrl;
+	char buffer[80];
+	int i;
+
+	/* Check the reserved bits of the ORB CTRL field */
+	for (i = 26; i <= 30; i++) {

This looks very magic; can we get some defines?

OK, I can use something like ORB_FIRST_RESERVED_BIT - ORB_LAST_RESERVED_BIT



+		orb->ctrl |= (0x01 << (31 - i));
+		snprintf(buffer, 80, " %d", i);
+		report_prefix_push(buffer);
+		expect_pgm_int();
+		ssch(test_device_sid, orb);
+		check_pgm_int_code(PGM_INT_CODE_OPERAND);
+		report_prefix_pop();
+
+		orb->ctrl = tmp;
+	}
+}
+
  static struct tests ssh_tests[] = {
  	{ "privilege", ssch_privilege },
  	{ "orb cpa zero", ssch_orb_cpa_zero },
@@ -217,6 +237,7 @@ static struct tests ssh_tests[] = {
  	{ "CCW access", ssch_ccw_access },
  	{ "CCW in DMA31", ssch_ccw_dma31 },
  	{ "ORB MIDAW unsupported", ssch_orb_midaw },
+	{ "ORB reserved CTRL bits", ssch_orb_ctrl },
  	{ NULL, NULL }
  };


--
Pierre Morel
IBM Lab Boeblingen



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux