From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: [PATCH 8/9] pci-assign: Use MSIX_PAGE_SIZE Date: Sat, 28 Jan 2012 07:22:22 -0700 Message-ID: <20120128142221.25681.82807.stgit@bling.home> References: <20120128142104.25681.93072.stgit@bling.home> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: alex.williamson@redhat.com, jan.kiszka@siemens.com, shashidhar.patil@gmail.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:61868 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753682Ab2A1OW1 (ORCPT ); Sat, 28 Jan 2012 09:22:27 -0500 In-Reply-To: <20120128142104.25681.93072.stgit@bling.home> Sender: kvm-owner@vger.kernel.org List-ID: We've already got it defined, use it. Signed-off-by: Alex Williamson --- hw/device-assignment.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index a6d3a5b..7e52615 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -1471,7 +1471,7 @@ static void msix_reset(AssignedDevice *dev) return; } - memset(dev->msix_table, 0, 0x1000); + memset(dev->msix_table, 0, MSIX_PAGE_SIZE); for (i = 0, entry = dev->msix_table; i < dev->msix_max; i++, entry++) { entry->ctrl = 0x1; /* Masked */ @@ -1480,7 +1480,7 @@ static void msix_reset(AssignedDevice *dev) static int assigned_dev_register_msix_mmio(AssignedDevice *dev) { - dev->msix_table = mmap(NULL, 0x1000, PROT_READ|PROT_WRITE, + dev->msix_table = mmap(NULL, MSIX_PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, 0, 0); if (dev->msix_table == MAP_FAILED) { fprintf(stderr, "fail allocate msix_table! %s\n", strerror(errno)); @@ -1502,7 +1502,7 @@ static void assigned_dev_unregister_msix_mmio(AssignedDevice *dev) memory_region_destroy(&dev->mmio); - if (munmap(dev->msix_table, 0x1000) == -1) { + if (munmap(dev->msix_table, MSIX_PAGE_SIZE) == -1) { fprintf(stderr, "error unmapping msix_table! %s\n", strerror(errno)); }