From: "Michael S. Tsirkin" Subject: [PATCH RFC 1/3] pci-testdev: separate page for each mmio test Date: Sun, 30 Aug 2015 12:20:14 +0300 Message-ID: <1440926395-23540-2-git-send-email-mst@redhat.com> References: <1440926395-23540-1-git-send-email-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: pbonzini@redhat.com, kvm@vger.kernel.org, Markus Armbruster , Gonglei To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54220 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751714AbbH3JUR (ORCPT ); Sun, 30 Aug 2015 05:20:17 -0400 Content-Disposition: inline In-Reply-To: <1440926395-23540-1-git-send-email-mst@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: note: this makes BAR > 4K, which requires kvm unit test patch to support such BAR. Do we need to worry about old kvm unit test binaries? I'm guessing not ... Signed-off-by: Michael S. Tsirkin --- hw/misc/pci-testdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index b6e11d6..6edc1cd 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -48,7 +48,7 @@ typedef struct IOTest { #define IOTEST_NODATA 0xAB #define IOTEST_IOSIZE 128 -#define IOTEST_MEMSIZE 2048 +#define IOTEST_MEMSIZE 0x10000 static const char *iotest_test[] = { "no-eventfd", @@ -262,7 +262,7 @@ static void pci_testdev_realize(PCIDevice *pci_dev, Error **errp) test->hdr = g_malloc0(test->bufsize); 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->hdr->offset = cpu_to_le32(IOTEST_SIZE(i) + i * (IOTEST_IS_MEM(i) ? 0x1000 : IOTEST_ACCESS_WIDTH)); test->size = strcmp(IOTEST_TEST(i), "nodata-eventfd") ? IOTEST_ACCESS_WIDTH : 0; test->match_data = strcmp(IOTEST_TEST(i), "wildcard-eventfd") && @@ -273,6 +273,7 @@ static void pci_testdev_realize(PCIDevice *pci_dev, Error **errp) test->mr = IOTEST_REGION(d, i); if (!test->size && !IOTEST_IS_MEM(i)) { + test->hdr->width = 0; test->hasnotifier = false; continue; } -- MST