qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-stable@nongnu.org
Subject: [Qemu-devel] [PULL 01/17] memory: fix 128 arithmetic in info mtree
Date: Thu, 17 Oct 2013 17:48:39 +0200	[thread overview]
Message-ID: <1382024935-28297-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1382024935-28297-1-git-send-email-pbonzini@redhat.com>

From: Alexey Kardashevskiy <aik@ozlabs.ru>

mtree_print_mr() calls int128_get64() in 3 places but only 2 places
handle 2^64 correctly.

This fixes the third call of int128_get64().

Cc: qemu-stable@nongnu.org
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 memory.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/memory.c b/memory.c
index 5a10fd0..7f1f266 100644
--- a/memory.c
+++ b/memory.c
@@ -1809,7 +1809,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
                    mr->alias->name,
                    mr->alias_offset,
                    mr->alias_offset
-                   + (hwaddr)int128_get64(mr->size) - 1);
+                   + (int128_nz(mr->size) ?
+                      (hwaddr)int128_get64(int128_sub(mr->size,
+                                                      int128_one())) : 0));
     } else {
         mon_printf(f,
                    TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n",
-- 
1.8.3.1

  reply	other threads:[~2013-10-17 15:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-17 15:48 [Qemu-devel] [PULL 00/17] Memory/threading changes for 1.7 Paolo Bonzini
2013-10-17 15:48 ` Paolo Bonzini [this message]
2013-10-17 15:48 ` [Qemu-devel] [PULL 02/17] compatfd: switch to QemuThread Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 03/17] portio: Allow to mark portio lists as coalesced MMIO flushing Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 04/17] cirrus: Mark vga io region " Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 05/17] vga: Mark relevant portio lists regions " Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 06/17] seqlock: introduce read-write seqlock Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 07/17] timer: protect timers_state's clock with seqlock Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 08/17] qemu-thread: add QemuEvent Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 09/17] timer: make qemu_clock_enable sync between disable and timer's cb Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 10/17] timer: extract timer_mod_ns_locked and timerlist_rearm Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 11/17] timer: add timer_mod_anticipate and timer_mod_anticipate_ns Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 12/17] icount: use cpu_get_icount() directly Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 13/17] icount: reorganize icount_warp_rt Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 14/17] icount: prepare the code for future races in calling qemu_clock_warp Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 15/17] icount: document (future) locking rules for icount Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 16/17] icount: make it thread-safe Paolo Bonzini
2013-10-17 15:48 ` [Qemu-devel] [PULL 17/17] exec: remove qemu_safe_ram_ptr Paolo Bonzini

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=1382024935-28297-2-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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).