qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: anthony@codemonkey.ws
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] [PULL v2 6/8] vfio: Fix debug output for int128 values
Date: Thu, 10 Oct 2013 12:44:39 -0600	[thread overview]
Message-ID: <20131010184433.31667.17887.stgit@bling.home> (raw)
In-Reply-To: <20131010184122.31667.28382.stgit@bling.home>

From: Alexey Kardashevskiy <aik@ozlabs.ru>

Memory regions can easily be 2^64 byte long and therefore overflow
for just a bit but that is enough for int128_get64() to assert.

This takes care of debug printing of huge section sizes.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/misc/vfio.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
index 0c9bb95..68e25bd 100644
--- a/hw/misc/vfio.c
+++ b/hw/misc/vfio.c
@@ -2084,7 +2084,8 @@ static void vfio_listener_region_add(MemoryListener *listener,
     if (vfio_listener_skipped_section(section)) {
         DPRINTF("SKIPPING region_add %"HWADDR_PRIx" - %"PRIx64"\n",
                 section->offset_within_address_space,
-                section->offset_within_address_space + section->size - 1);
+                section->offset_within_address_space +
+                int128_get64(int128_sub(section->size, int128_one())));
         return;
     }
 
@@ -2129,7 +2130,8 @@ static void vfio_listener_region_del(MemoryListener *listener,
     if (vfio_listener_skipped_section(section)) {
         DPRINTF("SKIPPING region_del %"HWADDR_PRIx" - %"PRIx64"\n",
                 section->offset_within_address_space,
-                section->offset_within_address_space + section->size - 1);
+                section->offset_within_address_space +
+                int128_get64(int128_sub(section->size, int128_one())));
         return;
     }
 

  parent reply	other threads:[~2013-10-10 18:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10 18:43 [Qemu-devel] [PULL v2 0/8] VFIO updates for QEMU Alex Williamson
2013-10-10 18:43 ` [Qemu-devel] [PULL v2 1/8] vfio-pci: Add support for MSI affinity Alex Williamson
2013-10-10 18:44 ` [Qemu-devel] [PULL v2 2/8] vfio-pci: Test device reset capabilities Alex Williamson
2013-10-10 18:44 ` [Qemu-devel] [PULL v2 3/8] vfio-pci: Lazy PCI option ROM loading Alex Williamson
2013-10-10 18:44 ` [Qemu-devel] [PULL v2 4/8] vfio-pci: Cleanup error_reports Alex Williamson
2013-10-10 18:44 ` [Qemu-devel] [PULL v2 5/8] vfio-pci: Implement PCI hot reset Alex Williamson
2013-10-10 18:44 ` Alex Williamson [this message]
2013-10-10 18:44 ` [Qemu-devel] [PULL v2 7/8] vfio-pci: Add dummy PCI ROM write accessor Alex Williamson
2013-10-10 18:45 ` [Qemu-devel] [PULL v2 8/8] vfio-pci: Fix endian issues in vfio_pci_size_rom() Alex Williamson

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=20131010184433.31667.17887.stgit@bling.home \
    --to=alex.williamson@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=anthony@codemonkey.ws \
    --cc=kvm@vger.kernel.org \
    --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).