[PATCH RFC 1/3] pci-testdev: separate page for each mmio test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <mst@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux