From: Alex Williamson <alex.williamson@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 03/11] vfio: cpu: Use "real" page size API
Date: Mon, 06 Jul 2015 12:34:54 -0600 [thread overview]
Message-ID: <20150706183454.15635.2149.stgit@gimli.home> (raw)
In-Reply-To: <20150706183311.15635.76314.stgit@gimli.home>
From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
This is system level code, and should only depend on the host page
size, not the target page size.
Note that HOST_PAGE_SIZE is misleadingly lead and is really aligning
to both host and target page size. Hence it's replacement with
REAL_HOST_PAGE_SIZE.
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
hw/vfio/pci.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index b8fa4ac..66d4223 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2388,7 +2388,7 @@ static void vfio_map_bar(VFIOPCIDevice *vdev, int nr)
* potentially insert a direct-mapped subregion before and after it.
*/
if (vdev->msix && vdev->msix->table_bar == nr) {
- size = vdev->msix->table_offset & qemu_host_page_mask;
+ size = vdev->msix->table_offset & qemu_real_host_page_mask;
}
strncat(name, " mmap", sizeof(name) - strlen(name) - 1);
@@ -2401,8 +2401,9 @@ static void vfio_map_bar(VFIOPCIDevice *vdev, int nr)
if (vdev->msix && vdev->msix->table_bar == nr) {
uint64_t start;
- start = HOST_PAGE_ALIGN((uint64_t)vdev->msix->table_offset +
- (vdev->msix->entries * PCI_MSIX_ENTRY_SIZE));
+ start = REAL_HOST_PAGE_ALIGN((uint64_t)vdev->msix->table_offset +
+ (vdev->msix->entries *
+ PCI_MSIX_ENTRY_SIZE));
size = start < bar->region.size ? bar->region.size - start : 0;
strncat(name, " msix-hi", sizeof(name) - strlen(name) - 1);
next prev parent reply other threads:[~2015-07-06 19:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 18:34 [Qemu-devel] [PULL 00/11] VFIO updates for 2.4-rc0 Alex Williamson
2015-07-06 18:34 ` [Qemu-devel] [PULL 01/11] vfio: fix return type of pread Alex Williamson
2015-07-06 18:34 ` [Qemu-devel] [PULL 02/11] cpu-all: complete "real" host page size API Alex Williamson
2015-07-06 18:34 ` Alex Williamson [this message]
2015-07-06 18:35 ` [Qemu-devel] [PULL 04/11] kvm: rename kvm_irqchip_[add, remove]_irqfd_notifier with gsi suffix Alex Williamson
2015-07-06 18:35 ` [Qemu-devel] [PULL 05/11] kvm-all.c: add qemu_irq/gsi hash table and utility routines Alex Williamson
2015-07-06 18:35 ` [Qemu-devel] [PULL 06/11] intc: arm_gic_kvm: set the qemu_irq/gsi mapping Alex Williamson
2015-07-06 18:35 ` [Qemu-devel] [PULL 07/11] sysbus: add irq_routing_notifier Alex Williamson
2015-07-06 18:35 ` [Qemu-devel] [PULL 08/11] kvm: some fixes to kvm_resamplefds_allowed Alex Williamson
2015-07-06 18:35 ` [Qemu-devel] [PULL 09/11] hw/vfio/platform: add irqfd support Alex Williamson
2015-07-06 18:35 ` [Qemu-devel] [PULL 10/11] vfio: Unregister IOMMU notifiers when container is destroyed Alex Williamson
2015-07-06 18:35 ` [Qemu-devel] [PULL 11/11] vfio/pci : Add pba_offset PCI quirk for Chelsio T5 devices Alex Williamson
2015-07-07 10:19 ` [Qemu-devel] [PULL 00/11] VFIO updates for 2.4-rc0 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150706183454.15635.2149.stgit@gimli.home \
--to=alex.williamson@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).