From patchwork Thu Apr 4 10:40:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 233745 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 08DCE2C00A0 for ; Thu, 4 Apr 2013 22:42:04 +1100 (EST) Received: from localhost ([::1]:57254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNiYK-0001Vy-1L for incoming@patchwork.ozlabs.org; Thu, 04 Apr 2013 07:42:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNiVk-0006V9-4O for qemu-devel@nongnu.org; Thu, 04 Apr 2013 07:39:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNiVd-0003zX-Rs for qemu-devel@nongnu.org; Thu, 04 Apr 2013 07:39:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNiVd-0003zP-JB for qemu-devel@nongnu.org; Thu, 04 Apr 2013 07:39:13 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r34BdDHD002956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Apr 2013 07:39:13 -0400 Received: from redhat.com (vpn1-7-59.ams2.redhat.com [10.36.7.59]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r34BdAS4023074; Thu, 4 Apr 2013 07:39:11 -0400 Date: Thu, 4 Apr 2013 13:40:15 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org, kvm@vger.kernel.org, pbonzini@redhat.com, gleb@redhat.com, mtosatti@redhat.com Message-ID: <487d02412c9626c2b5c1c6758afb796390372239.1365071407.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 6/6] pci-testdev: add pv 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 Add ability to test the speed of PV MMIO. Signed-off-by: Michael S. Tsirkin --- hw/pci-testdev.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/pci-testdev.c b/hw/pci-testdev.c index f0ebf99..9a50631 100644 --- a/hw/pci-testdev.c +++ b/hw/pci-testdev.c @@ -19,6 +19,7 @@ typedef struct IOTest { EventNotifier notifier; bool hasnotifier; unsigned size; + bool pv; bool match_data; PCITestDevHdr *hdr; unsigned bufsize; @@ -33,7 +34,8 @@ typedef struct IOTest { static const char *iotest_test[] = { "no-eventfd", "wildcard-eventfd", - "datamatch-eventfd" + "datamatch-eventfd", + "pv-eventfd" }; static const char *iotest_type[] = { @@ -80,7 +82,7 @@ static int pci_testdev_start(IOTest *test) memory_region_add_eventfd(test->mr, le32_to_cpu(test->hdr->offset), test->size, - false, + test->pv, test->match_data, test->hdr->data, &test->notifier); @@ -95,7 +97,7 @@ static void pci_testdev_stop(IOTest *test) memory_region_del_eventfd(test->mr, le32_to_cpu(test->hdr->offset), test->size, - false, + test->pv, test->match_data, test->hdr->data, &test->notifier); @@ -237,7 +239,8 @@ static int pci_testdev_init(PCIDevice *pci_dev) 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->pv = !strcmp(IOTEST_TEST(i), "pv-eventfd"); + test->match_data = !strcmp(IOTEST_TEST(i), "datamatch-eventfd"); test->hdr->test = i; test->hdr->data = test->match_data ? IOTEST_DATAMATCH : IOTEST_NOMATCH; test->hdr->width = IOTEST_ACCESS_WIDTH;