From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWFOu-00046U-Ml for qemu-devel@nongnu.org; Sun, 30 Aug 2015 23:04:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWFOr-00064U-Gk for qemu-devel@nongnu.org; Sun, 30 Aug 2015 23:04:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWFOr-00063v-Ai for qemu-devel@nongnu.org; Sun, 30 Aug 2015 23:04:49 -0400 Message-ID: <55E3C44A.1030805@redhat.com> Date: Mon, 31 Aug 2015 11:04:42 +0800 From: Jason Wang MIME-Version: 1.0 References: <1440671349-7106-1-git-send-email-mst@redhat.com> In-Reply-To: <1440671349-7106-1-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pci-testdev: add nodata test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Gonglei , Markus Armbruster On 08/27/2015 06:30 PM, Michael S. Tsirkin wrote: > Add nodata test where data length is ignored. > Skip it for port IO since kvm does not support it there. > > Signed-off-by: Michael S. Tsirkin > --- > hw/misc/pci-testdev.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c > index 26b9b86..b6e11d6 100644 > --- a/hw/misc/pci-testdev.c > +++ b/hw/misc/pci-testdev.c > @@ -45,6 +45,7 @@ typedef struct IOTest { > > #define IOTEST_DATAMATCH 0xFA > #define IOTEST_NOMATCH 0xCE > +#define IOTEST_NODATA 0xAB This is never used. > > #define IOTEST_IOSIZE 128 > #define IOTEST_MEMSIZE 2048 > @@ -52,7 +53,8 @@ typedef struct IOTest { > static const char *iotest_test[] = { > "no-eventfd", > "wildcard-eventfd", > - "datamatch-eventfd" > + "datamatch-eventfd", > + "nodata-eventfd" For PIO test, "nodata-eventfd" actually means "nodata-noeventfd". > }; > > static const char *iotest_type[] = { > @@ -261,12 +263,19 @@ static void pci_testdev_realize(PCIDevice *pci_dev, Error **errp) > memcpy(test->hdr->name, name, strlen(name) + 1); > g_free(name); > test->hdr->offset = cpu_to_le32(IOTEST_SIZE(i) + i * IOTEST_ACCESS_WIDTH); > - test->size = IOTEST_ACCESS_WIDTH; > - test->match_data = strcmp(IOTEST_TEST(i), "wildcard-eventfd"); > + test->size = strcmp(IOTEST_TEST(i), "nodata-eventfd") ? IOTEST_ACCESS_WIDTH : 0; > + > + test->match_data = strcmp(IOTEST_TEST(i), "wildcard-eventfd") && > + strcmp(IOTEST_TEST(i), "nodata-eventfd"); > test->hdr->test = i; > test->hdr->data = test->match_data ? IOTEST_DATAMATCH : IOTEST_NOMATCH; > test->hdr->width = IOTEST_ACCESS_WIDTH; > test->mr = IOTEST_REGION(d, i); > + > + if (!test->size && !IOTEST_IS_MEM(i)) { > + test->hasnotifier = false; > + continue; > + } > if (!strcmp(IOTEST_TEST(i), "no-eventfd")) { > test->hasnotifier = false; > continue; Since you're at this, how about introduce a test that mixes datamatch and wildcard?