We expect a CSS program check if the CPA of the ORB is null and access to the IRB to check it. Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxx> --- lib/s390x/css.h | 1 + lib/s390x/css_lib.c | 4 ++-- s390x/css.c | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/s390x/css.h b/lib/s390x/css.h index a5a8427..d824e34 100644 --- a/lib/s390x/css.h +++ b/lib/s390x/css.h @@ -139,6 +139,7 @@ struct irb { uint32_t ecw[8]; uint32_t emw[8]; } __attribute__ ((aligned(4))); +extern struct irb irb; #define CCW_CMD_SENSE_ID 0xe4 #define CSS_SENSEID_COMMON_LEN 8 diff --git a/lib/s390x/css_lib.c b/lib/s390x/css_lib.c index 65159aa..12ef874 100644 --- a/lib/s390x/css_lib.c +++ b/lib/s390x/css_lib.c @@ -21,6 +21,8 @@ struct schib schib; struct chsc_scsc *chsc_scsc; +struct irb irb; + static const char * const chsc_rsp_description[] = { "CHSC unknown error", @@ -411,8 +413,6 @@ bool css_disable_mb(int schid) return retry_count > 0; } -static struct irb irb; - void css_irq_io(void) { int ret = 0; diff --git a/s390x/css.c b/s390x/css.c index da21ccc..d248cac 100644 --- a/s390x/css.c +++ b/s390x/css.c @@ -91,8 +91,21 @@ static void ssch_privilege(void) check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION); } +static void ssch_orb_cpa_zero(void) +{ + uint32_t cpa = orb->cpa; + + orb->cpa = 0; + ssch(test_device_sid, orb); + tsch(test_device_sid, &irb); + report(check_io_errors(test_device_sid, 0, SCSW_SCHS_PRG_CHK), "expecting Program check"); + + orb->cpa = cpa; +} + static struct tests ssh_tests[] = { { "privilege", ssch_privilege }, + { "orb cpa zero", ssch_orb_cpa_zero }, { NULL, NULL } }; -- 2.17.1