From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44884 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727750AbfLBSZS (ORCPT ); Mon, 2 Dec 2019 13:25:18 -0500 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB2ILjGZ078251 for ; Mon, 2 Dec 2019 13:25:17 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wm6s5hmhb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 02 Dec 2019 13:25:16 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 2 Dec 2019 18:25:14 -0000 Subject: Re: [kvm-unit-tests PATCH v2 9/9] s390x: css: ping pong References: <1574945167-29677-1-git-send-email-pmorel@linux.ibm.com> <1574945167-29677-10-git-send-email-pmorel@linux.ibm.com> <20191202160341.5e96fb81.cohuck@redhat.com> From: Pierre Morel Date: Mon, 2 Dec 2019 19:25:11 +0100 MIME-Version: 1.0 In-Reply-To: <20191202160341.5e96fb81.cohuck@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Message-Id: <0ee2ac68-04a8-c804-a280-04f273489a0a@linux.ibm.com> Sender: linux-s390-owner@vger.kernel.org List-ID: To: Cornelia Huck Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, thuth@redhat.com On 2019-12-02 16:03, Cornelia Huck wrote: > On Thu, 28 Nov 2019 13:46:07 +0100 > Pierre Morel wrote: > >> To test a write command with the SSCH instruction we need a QEMU device, >> with control unit type 0xC0CA. The PONG device is such a device. > > "We want to test some read/write ccws via the SSCH instruction with a > QEMU device with control unit type 0xC0CA." ? > >> >> This type of device respond to PONG_WRITE requests by incrementing an > > s/respond/responds/ oiiinnnn..... but yes > >> integer, stored as a string at offset 0 of the CCW data. >> >> This is only a success test, no error expected. > > Nobody expects the Spanish Inquisition^W^W^W an error :) > >> >> Signed-off-by: Pierre Morel >> --- >> s390x/css.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- >> 1 file changed, 45 insertions(+), 1 deletion(-) >> >> diff --git a/s390x/css.c b/s390x/css.c >> index 534864f..0761e70 100644 >> --- a/s390x/css.c >> +++ b/s390x/css.c >> @@ -23,6 +23,10 @@ >> #define SID_ONE 0x00010000 >> #define PSW_PRG_MASK (PSW_MASK_IO | PSW_MASK_EA | PSW_MASK_BA) >> >> +/* Local Channel Commands */ > > /* Channel commands for the PONG device */ > > ? better, thanks > >> +#define PONG_WRITE 0x21 /* Write */ >> +#define PONG_READ 0x22 /* Read buffer */ >> + >> struct lowcore *lowcore = (void *)0x0; >> >> static struct schib schib; >> @@ -31,7 +35,8 @@ static struct ccw ccw[NB_CCW]; >> #define NB_ORB 100 >> static struct orb orb[NB_ORB]; >> static struct irb irb; >> -static char buffer[0x1000] __attribute__ ((aligned(8))); >> +#define BUF_SZ 0x1000 >> +static char buffer[BUF_SZ] __attribute__ ((aligned(8))); > > Merge this with the introduction of this variable? yes, better too > >> static struct senseid senseid; >> >> static const char *Channel_type[3] = { >> @@ -224,6 +229,44 @@ static void test_sense(void) >> report("cu_type: expect c0ca, got %04x", 0, senseid.cu_type); >> } >> >> +static void test_ping(void) >> +{ >> + int success, result; >> + int cnt = 0, max = 4; >> + >> + if (senseid.cu_type != PONG_CU) { >> + report_skip("No PONG, no ping-pong"); > > :D > >> + return; >> + } >> + >> + enable_io_irq(); > > Hasn't that been enabled already for doing SenseID? Yes, but same remark as before, the sub tests here are independant, started from the test[] table. If the sense test is commented out, the... > >> + >> + while (cnt++ < max) { >> +report_info("cnt..: %08x", cnt); > > Wrong indentation? wrong report ! forgotten from a test. Thanks for the review, Regards, Pierre -- Pierre Morel IBM Lab Boeblingen