On 1/9/20 5:16 PM, Claudio Imbrenda wrote: > SCLP unit test. Testing the following: > > * Correctly ignoring instruction bits that should be ignored > * Privileged instruction check > * Check for addressing exceptions > * Specification exceptions: > - SCCB size less than 8 > - SCCB unaligned > - SCCB overlaps prefix or lowcore > - SCCB address higher than 2GB > * Return codes for > - Invalid command > - SCCB too short (but at least 8) > - SCCB page boundary violation > > Signed-off-by: Claudio Imbrenda > Reviewed-by: Thomas Huth I wonder how fast this will run under z/VM and if we need to increase the timeout. Nicely done, one comment below. Acked-by: Janosch Frank Tested under LPAR, KVM and PV > --- > s390x/Makefile | 1 + > s390x/sclp.c | 472 ++++++++++++++++++++++++++++++++++++++++++++ > s390x/unittests.cfg | 8 + > 3 files changed, 481 insertions(+) > create mode 100644 s390x/sclp.c [..] > +/** > + * Test SCCBs that are not 64-bit aligned. > + */ > +static void test_sccb_unaligned(void) > +{ > + int offset; > + > + for (offset = 1; offset < 8; offset++) > + if (!test_one_simple(valid_code, offset + pagebuf, 8, 8, PGM_BIT_SPEC, 0)) > + break; > + report(offset == 8, "SCCB unaligned"); > +} > + > +/** > + * Test SCCBs whose address is in the lowcore or prefix area. > + */ > +static void test_sccb_prefix(void) > +{ > + uint8_t scratch[2 * PAGE_SIZE]; LC_SIZE? Can also be used in more places below.