diff mbox series

[kvm-unit-tests,v3,13/16] s390x: css: checking for CSS extensions

Message ID 1617694853-6881-14-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 verify that these extensions are not install before running simple
tests.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
 lib/s390x/css.h |  2 ++
 s390x/css.c     | 31 +++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

Comments

Cornelia Huck April 6, 2021, 3:50 p.m. UTC | #1
On Tue,  6 Apr 2021 09:40:50 +0200
Pierre Morel <pmorel@linux.ibm.com> wrote:

> We verify that these extensions are not install before running simple

s/not install/installed/ ?

Testing extensions that are not installed does not make that much sense
:)

> tests.
> 
> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> ---
>  lib/s390x/css.h |  2 ++
>  s390x/css.c     | 31 +++++++++++++++++++++++++++++++
>  2 files changed, 33 insertions(+)
> 
> diff --git a/lib/s390x/css.h b/lib/s390x/css.h
> index d824e34..08b2974 100644
> --- a/lib/s390x/css.h
> +++ b/lib/s390x/css.h
> @@ -338,7 +338,9 @@ struct chsc_scsc {
>  	uint8_t reserved[9];
>  	struct chsc_header res;
>  	uint32_t res_fmt;
> +#define CSSC_ORB_EXTENSIONS		0
>  #define CSSC_EXTENDED_MEASUREMENT_BLOCK 48
> +#define CSSC_FC_EXTENSIONS		88
>  	uint64_t general_char[255];
>  	uint64_t chsc_char[254];
>  };
> diff --git a/s390x/css.c b/s390x/css.c
> index 26f5da6..f8c6688 100644
> --- a/s390x/css.c
> +++ b/s390x/css.c
> @@ -229,6 +229,35 @@ static void ssch_orb_ctrl(void)
>  	}
>  }
>  
> +static void ssch_orb_extension(void)
> +{
> +	if (!css_test_general_feature(CSSC_ORB_EXTENSIONS)) {
> +		report_skip("ORB extensions not installed");
> +		return;
> +	}
> +	/* Place holder for checking ORB extensions */
> +	report_info("ORB extensions installed but not tested");
> +}
> +
> +static void ssch_orb_fcx(void)
> +{
> +	uint32_t tmp = orb->ctrl;
> +
> +	if (!css_test_general_feature(CSSC_FC_EXTENSIONS)) {
> +		report_skip("Fibre-channel extensions not installed");
> +		return;
> +	}
> +
> +	report_prefix_push("Channel-Program Type Control");
> +	orb->ctrl |= ORB_CTRL_CPTC;
> +	expect_pgm_int();
> +	ssch(test_device_sid, orb);
> +	check_pgm_int_code(PGM_INT_CODE_OPERAND);
> +	report_prefix_pop();

I don't quite understand what you're testing here; shouldn't the device
accept a transport-mode orb if fcx is installed? The problem would be
if the program consists of ccws instead, so it's more a malformed block
handling test?

> +
> +	orb->ctrl = tmp;
> +}
> +
>  static struct tests ssh_tests[] = {
>  	{ "privilege", ssch_privilege },
>  	{ "orb cpa zero", ssch_orb_cpa_zero },
> @@ -238,6 +267,8 @@ static struct tests ssh_tests[] = {
>  	{ "CCW in DMA31", ssch_ccw_dma31 },
>  	{ "ORB MIDAW unsupported", ssch_orb_midaw },
>  	{ "ORB reserved CTRL bits", ssch_orb_ctrl },
> +	{ "ORB extensions", ssch_orb_extension},
> +	{ "FC extensions", ssch_orb_fcx},
>  	{ NULL, NULL }
>  };
>
Pierre Morel April 7, 2021, 10:42 a.m. UTC | #2
On 4/6/21 5:50 PM, Cornelia Huck wrote:
> On Tue,  6 Apr 2021 09:40:50 +0200
> Pierre Morel <pmorel@linux.ibm.com> wrote:
> 
>> We verify that these extensions are not install before running simple
> 
> s/not install/installed/ ?
> 
> Testing extensions that are not installed does not make that much sense
> :)
> 
>> tests.
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---
>>   lib/s390x/css.h |  2 ++
>>   s390x/css.c     | 31 +++++++++++++++++++++++++++++++
>>   2 files changed, 33 insertions(+)
>>
>> diff --git a/lib/s390x/css.h b/lib/s390x/css.h
>> index d824e34..08b2974 100644
>> --- a/lib/s390x/css.h
>> +++ b/lib/s390x/css.h
>> @@ -338,7 +338,9 @@ struct chsc_scsc {
>>   	uint8_t reserved[9];
>>   	struct chsc_header res;
>>   	uint32_t res_fmt;
>> +#define CSSC_ORB_EXTENSIONS		0
>>   #define CSSC_EXTENDED_MEASUREMENT_BLOCK 48
>> +#define CSSC_FC_EXTENSIONS		88
>>   	uint64_t general_char[255];
>>   	uint64_t chsc_char[254];
>>   };
>> diff --git a/s390x/css.c b/s390x/css.c
>> index 26f5da6..f8c6688 100644
>> --- a/s390x/css.c
>> +++ b/s390x/css.c
>> @@ -229,6 +229,35 @@ static void ssch_orb_ctrl(void)
>>   	}
>>   }
>>   
>> +static void ssch_orb_extension(void)
>> +{
>> +	if (!css_test_general_feature(CSSC_ORB_EXTENSIONS)) {
>> +		report_skip("ORB extensions not installed");
>> +		return;
>> +	}
>> +	/* Place holder for checking ORB extensions */
>> +	report_info("ORB extensions installed but not tested");
>> +}
>> +
>> +static void ssch_orb_fcx(void)
>> +{
>> +	uint32_t tmp = orb->ctrl;
>> +
>> +	if (!css_test_general_feature(CSSC_FC_EXTENSIONS)) {
>> +		report_skip("Fibre-channel extensions not installed");
>> +		return;
>> +	}
>> +
>> +	report_prefix_push("Channel-Program Type Control");
>> +	orb->ctrl |= ORB_CTRL_CPTC;
>> +	expect_pgm_int();
>> +	ssch(test_device_sid, orb);
>> +	check_pgm_int_code(PGM_INT_CODE_OPERAND);
>> +	report_prefix_pop();
> 
> I don't quite understand what you're testing here; shouldn't the device
> accept a transport-mode orb if fcx is installed? The problem would be
> if the program consists of ccws instead, so it's more a malformed block
> handling test?

Yes, OK, non sense.
I let fall this test.
diff mbox series

Patch

diff --git a/lib/s390x/css.h b/lib/s390x/css.h
index d824e34..08b2974 100644
--- a/lib/s390x/css.h
+++ b/lib/s390x/css.h
@@ -338,7 +338,9 @@  struct chsc_scsc {
 	uint8_t reserved[9];
 	struct chsc_header res;
 	uint32_t res_fmt;
+#define CSSC_ORB_EXTENSIONS		0
 #define CSSC_EXTENDED_MEASUREMENT_BLOCK 48
+#define CSSC_FC_EXTENSIONS		88
 	uint64_t general_char[255];
 	uint64_t chsc_char[254];
 };
diff --git a/s390x/css.c b/s390x/css.c
index 26f5da6..f8c6688 100644
--- a/s390x/css.c
+++ b/s390x/css.c
@@ -229,6 +229,35 @@  static void ssch_orb_ctrl(void)
 	}
 }
 
+static void ssch_orb_extension(void)
+{
+	if (!css_test_general_feature(CSSC_ORB_EXTENSIONS)) {
+		report_skip("ORB extensions not installed");
+		return;
+	}
+	/* Place holder for checking ORB extensions */
+	report_info("ORB extensions installed but not tested");
+}
+
+static void ssch_orb_fcx(void)
+{
+	uint32_t tmp = orb->ctrl;
+
+	if (!css_test_general_feature(CSSC_FC_EXTENSIONS)) {
+		report_skip("Fibre-channel extensions not installed");
+		return;
+	}
+
+	report_prefix_push("Channel-Program Type Control");
+	orb->ctrl |= ORB_CTRL_CPTC;
+	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 },
@@ -238,6 +267,8 @@  static struct tests ssh_tests[] = {
 	{ "CCW in DMA31", ssch_ccw_dma31 },
 	{ "ORB MIDAW unsupported", ssch_orb_midaw },
 	{ "ORB reserved CTRL bits", ssch_orb_ctrl },
+	{ "ORB extensions", ssch_orb_extension},
+	{ "FC extensions", ssch_orb_fcx},
 	{ NULL, NULL }
 };