From patchwork Sun Aug 30 09:20:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 512198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9562D14027C for ; Sun, 30 Aug 2015 19:20:54 +1000 (AEST) Received: from localhost ([::1]:57772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVynE-00063K-Or for incoming@patchwork.ozlabs.org; Sun, 30 Aug 2015 05:20:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVymh-0005Sh-BH for qemu-devel@nongnu.org; Sun, 30 Aug 2015 05:20:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVymg-0000pb-Fs for qemu-devel@nongnu.org; Sun, 30 Aug 2015 05:20:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVymg-0000pX-9u for qemu-devel@nongnu.org; Sun, 30 Aug 2015 05:20:18 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id D15D48E692; Sun, 30 Aug 2015 09:20:17 +0000 (UTC) Received: from redhat.com (ovpn-116-40.ams2.redhat.com [10.36.116.40]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t7U9KEUp001877; Sun, 30 Aug 2015 05:20:15 -0400 Date: Sun, 30 Aug 2015 12:20:14 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org 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-Disposition: inline In-Reply-To: <1440926395-23540-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, Gonglei , Markus Armbruster , kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH RFC 1/3] pci-testdev: separate page for each mmio test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; }