Skip to contentSkip to conversation

Patch Round-up for stable 1.6.2, freeze on 2013-12-06

Qemu-devel New Michael Roth 2 participants 34 messages Dec 4, 2013 – Dec 5, 2013 Block layer

lore
Share & tools
lore
#0 lore raw

Hi everyone,

The following new patches are queued for QEMU stable v1.6.2:

https://github.com/mdroth/qemu/commits/stable-1.6-staging

The release is planned for 2013-12-09:

http://wiki.qemu.org/Planning/1.6

Please respond here or CC [email protected] on any patches you think should be included in the release. The cut-off date is has been extended to 2013-12-06 due to the round-up email going out late.

Testing/feedback is greatly appreciated.

Thanks!

Alex Williamson (1):
vfio-pci: Fix multifunction=on

Alexey Kardashevskiy (1):
memory: fix 128 arithmetic in info mtree

Amit Shah (3):
char: move backends' io watch tag to CharDriverState
char: use common function to disable callbacks on chardev close
char: remove watch callback on chardev detach from frontend

Amos Kong (2):
virtio-net: fix the memory leak in rxfilter_notify()
rng-egd: offset the point when repeatedly read from the buffer

Bandan Das (1):
pci: unregister vmstate_pcibus on unplug

Cole Robinson (1):
Fix pc migration from qemu <= 1.5

Fam Zheng (1):
vmdk: Fix vmdk_parse_extents

Hans de Goede (1):
audio: honor QEMU_AUDIO_TIMER_PERIOD instead of waking up every *nano* second

Igor Mammedov (1):
qdev-monitor: Fix crash when device_add is called with abstract driver

Jason Wang (1):
virtio-net: only delete bh that existed

Markus Armbruster (2):
tests: Fix schema parser test for in-tree build
tests: Update .gitignore for test-int128 and test-bitops

Matthew Daley (1):
xen_disk: mark ioreq as mapped before unmapping in error case

Max Filippov (1):
exec: fix breakpoint_invalidate when pc may not be translated

Max Reitz (1):
qcow2: count_contiguous_clusters and compression

Mike Frysinger (1):
configure: detect endian via compile test

Paolo Bonzini (1):
monitor: eliminate monitor_event_state_lock

Peter Lieven (1):
qcow2: fix possible corruption when reading multiple clusters

Peter Maydell (1):
configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0

Richard Henderson (1):
Adjust qapi-visit for python-2.4.3

Stefan Hajnoczi (1):
qdev-monitor: Unref device when device_add fails

Stefan Weil (5):
tci: Add implementation of rotl_i64, rotr_i64
bitops: Add rotate functions (rol8, ror8, ...)
misc: Use new rotate functions
qemu-char: Fix potential out of bounds access to local arrays
linux-user: Fix stat64 syscall for SPARC64

Vlad Yasevich (1):
qom: Fix memory leak in object_property_set_link()

Wenchao Xia (2):
qapi: fix memleak by adding implict struct functions in dealloc visitor
tests: fix memleak in error path test for input visitor

 audio/audio.c                  |    3 +-
 backends/rng-egd.c             |    4 +-
 block/qcow2-cluster.c          |    7 +++-
 block/vmdk.c                   |    7 +++-
 configure                      |   45 +++++++++------------
 exec.c                         |    6 ++-
 hw/block/xen_disk.c            |    1 +
 hw/misc/vfio.c                 |    7 ++++
 hw/net/virtio-net.c            |   10 ++---
 hw/pci-host/piix.c             |    9 ++++-
 hw/pci-host/q35.c              |   10 ++++-
 hw/pci/pci.c                   |    8 ++++
 include/hw/i386/pc.h           |    8 ++++
 include/hw/pci-host/q35.h      |    1 +
 include/qemu/bitops.h          |   80 +++++++++++++++++++++++++++++++++++++
 include/sysemu/char.h          |    1 +
 linux-user/syscall.c           |    6 +--
 linux-user/syscall_defs.h      |   14 +++++++
 memory.c                       |    4 +-
 monitor.c                      |    6 ---
 qapi/qapi-dealloc-visitor.c    |   20 ++++++++++
 qdev-monitor.c                 |    8 ++++
 qemu-char.c                    |   86 +++++++++++++++-------------------------
 qom/object.c                   |    5 ++-
 scripts/qapi-visit.py          |   17 ++++++--
 target-arm/iwmmxt_helper.c     |    2 +-
 tcg/optimize.c                 |   12 ++----
 tcg/tci/tcg-target.c           |    1 -
 tci.c                          |   14 +++++--
 tests/.gitignore               |    3 ++
 tests/Makefile                 |    8 ++--
 tests/test-qmp-input-visitor.c |    1 +
 32 files changed, 287 insertions(+), 127 deletions(-)
#1 lore raw

PATCH 1/32 char: move backends' io watch tag to CharDriverState

From: Amit Shah <[email protected]>

All the backends implement an io watcher tag for callbacks. Move it to CharDriverState from each backend's struct to make accessing the tag from backend-neutral functions easier.

This will be used later to cancel a callback on chardev detach from a frontend.

(cherry picked from commit 7ba9addc165b37b764baa08c02518b15b2361707)
---
 include/sysemu/char.h |    1 +
 qemu-char.c           |   77 +++++++++++++++++++++++++------------------------
 2 files changed, 40 insertions(+), 38 deletions(-)
include/sysemu/char.h +1 -0
index 8053130..ad101d9 100644
@@ -78,6 +78,7 @@ struct CharDriverState {
     int explicit_be_open;
     int avail_connections;
     int is_mux;
+    guint fd_in_tag;
     QemuOpts *opts;
     QTAILQ_ENTRY(CharDriverState) next;
 };
qemu-char.c +39 -38

179 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/32 char: use common function to disable callbacks on chardev close

In reply to Michael Roth

From: Amit Shah <[email protected]>

This deduplicates code used a lot of times.

(cherry picked from commit 26da70c72524eb22c946ab19ec98a217b8252f7e)
---
 qemu-char.c |   62 ++++++++++++++++++-----------------------------------------
 1 file changed, 19 insertions(+), 43 deletions(-)
qemu-char.c +19 -43
index 1dc1646..fa00517 100644
@@ -725,6 +725,14 @@ static void io_remove_watch_poll(guint tag)
     g_source_destroy(&iwp->parent);
 }
 
+static void remove_fd_in_watch(CharDriverState *chr)
+{
+    if (chr->fd_in_tag) {
+        io_remove_watch_poll(chr->fd_in_tag);
+        chr->fd_in_tag = 0;
+    }
+}
+
 #ifndef _WIN32
 static GIOChannel *io_channel_from_fd(int fd)
 {
@@ -829,10 +837,7 @@ static gboolean fd_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
     status = g_io_channel_read_chars(chan, (gchar *)buf,
                                      len, &bytes_read, NULL);
     if (status == G_IO_STATUS_EOF) {
-        if (chr->fd_in_tag) {
-            io_remove_watch_poll(chr->fd_in_tag);
-            chr->fd_in_tag = 0;
-        }
+        remove_fd_in_watch(chr);
         qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
         return FALSE;
     }
@@ -862,11 +867,7 @@ static void fd_chr_update_read_handler(CharDriverState *chr)
 {
     FDCharDriver *s = chr->opaque;
 
-    if (chr->fd_in_tag) {
-        io_remove_watch_poll(chr->fd_in_tag);
-        chr->fd_in_tag = 0;
-    }
-
+    remove_fd_in_watch(chr);
     if (s->fd_in) {
         chr->fd_in_tag = io_add_watch_poll(s->fd_in, fd_chr_read_poll,
                                            fd_chr_read, chr);
@@ -877,11 +878,7 @@ static void fd_chr_close(struct CharDriverState *chr)
 {
     FDCharDriver *s = chr->opaque;
 
-    if (chr->fd_in_tag) {
-        io_remove_watch_poll(chr->fd_in_tag);
-        chr->fd_in_tag = 0;
-    }
-
+    remove_fd_in_watch(chr);
     if (s->fd_in) {
         g_io_channel_unref(s->fd_in);
     }
@@ -1122,10 +1119,7 @@ static void pty_chr_state(CharDriverState *chr, int connected)
     PtyCharDriver *s = chr->opaque;
 
     if (!connected) {
-        if (chr->fd_in_tag) {
-            io_remove_watch_poll(chr->fd_in_tag);
-            chr->fd_in_tag = 0;
-        }
+        remove_fd_in_watch(chr);
         s->connected = 0;
         /* (re-)connect poll interval for idle guests: once per second.
          * We check more frequently in case the guests sends data to
@@ -1151,10 +1145,7 @@ static void pty_chr_close(struct CharDriverState *chr)
     PtyCharDriver *s = chr->opaque;
     int fd;
 
-    if (chr->fd_in_tag) {
-        io_remove_watch_poll(chr->fd_in_tag);
-        chr->fd_in_tag = 0;
-    }
+    remove_fd_in_watch(chr);
     fd = g_io_channel_unix_get_fd(s->fd);
     g_io_channel_unref(s->fd);
     close(fd);
@@ -2216,10 +2207,7 @@ static gboolean udp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
     s->bufcnt = bytes_read;
     s->bufptr = s->bufcnt;
     if (status != G_IO_STATUS_NORMAL) {
-        if (chr->fd_in_tag) {
-            io_remove_watch_poll(chr->fd_in_tag);
-            chr->fd_in_tag = 0;
-        }
+        remove_fd_in_watch(chr);
         return FALSE;
     }
 
@@ -2237,11 +2225,7 @@ static void udp_chr_update_read_handler(CharDriverState *chr)
 {
     NetCharDriver *s = chr->opaque;
 
-    if (chr->fd_in_tag) {
-        io_remove_watch_poll(chr->fd_in_tag);
-        chr->fd_in_tag = 0;
-    }
-
+    remove_fd_in_watch(chr);
     if (s->chan) {
         chr->fd_in_tag = io_add_watch_poll(s->chan, udp_chr_read_poll,
                                            udp_chr_read, chr);
@@ -2251,10 +2235,8 @@ static void udp_chr_update_read_handler(CharDriverState *chr)
 static void udp_chr_close(CharDriverState *chr)
 {
     NetCharDriver *s = chr->opaque;
-    if (chr->fd_in_tag) {
-        io_remove_watch_poll(chr->fd_in_tag);
-        chr->fd_in_tag = 0;
-    }
+
+    remove_fd_in_watch(chr);
     if (s->chan) {
         g_io_channel_unref(s->chan);
         closesocket(s->fd);
@@ -2489,10 +2471,7 @@ static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
         if (s->listen_chan) {
             s->listen_tag = g_io_add_watch(s->listen_chan, G_IO_IN, tcp_chr_accept, chr);
         }
-        if (chr->fd_in_tag) {
-            io_remove_watch_poll(chr->fd_in_tag);
-            chr->fd_in_tag = 0;
-        }
+        remove_fd_in_watch(chr);
         g_io_channel_unref(s->chan);
         s->chan = NULL;
         closesocket(s->fd);
@@ -2606,10 +2585,7 @@ static void tcp_chr_close(CharDriverState *chr)
 {
     TCPCharDriver *s = chr->opaque;
     if (s->fd >= 0) {
-        if (chr->fd_in_tag) {
-            io_remove_watch_poll(chr->fd_in_tag);
-            chr->fd_in_tag = 0;
-        }
+        remove_fd_in_watch(chr);
         if (s->chan) {
             g_io_channel_unref(s->chan);
         }
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/32 char: remove watch callback on chardev detach from frontend

In reply to Michael Roth

From: Amit Shah <[email protected]>

If a frontend device releases the chardev (via unplug), the chr handlers are set to NULL via qdev's exit callbacks invoking qemu_chr_add_handlers(). If the chardev had a pending operation, a callback will be invoked, which will try to access data in the just-released frontend, causing a segfault.

Ensure the callbacks are disabled when frontends release chardevs.

This was seen when a virtio-serial port was unplugged when heavy guest->host IO was in progress (causing a callback to be registered). In the window in which the throttling was active, unplugging ports caused a qemu segfault.

https://bugzilla.redhat.com/show_bug.cgi?id=985205

(cherry picked from commit 386a5a1e0057e220f79c48fe3689e3dfb17f1b09)
---
 qemu-char.c |    3 +++
 1 file changed, 3 insertions(+)
qemu-char.c +3 -0
index fa00517..fc1c23d 100644
@@ -193,6 +193,8 @@ void qemu_chr_fe_printf(CharDriverState *s, const char *fmt, ...)
     va_end(ap);
 }
 
+static void remove_fd_in_watch(CharDriverState *chr);
+
 void qemu_chr_add_handlers(CharDriverState *s,
                            IOCanReadHandler *fd_can_read,
                            IOReadHandler *fd_read,
@@ -203,6 +205,7 @@ void qemu_chr_add_handlers(CharDriverState *s,
 
     if (!opaque && !fd_can_read && !fd_read && !fd_event) {
         fe_open = 0;
+        remove_fd_in_watch(s);
     } else {
         fe_open = 1;
     }
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 4/32 tests: Fix schema parser test for in-tree build

In reply to Michael Roth

From: Markus Armbruster <[email protected]>

Commit 4f193e3 added the test, but screwed up in-tree builds (SRCDIR=.): the tests's output overwrites the expected output, and is thus compared to itself.

(cherry picked from commit d8039e58b1ecfdc9af171502c83e3949f6dafb95)
---
 tests/.gitignore |    1 +
 tests/Makefile   |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)
tests/.gitignore +1 -0
index fb05c2a..d9c2ef4 100644
@@ -19,3 +19,4 @@ test-thread-pool
 test-x86-cpuid
 test-xbzrle
 *-test
+qapi-schema/*.test.*
tests/Makefile +4 -4
index d044908..ad98439 100644
@@ -247,10 +247,10 @@ check-tests/test-qapi.py: tests/test-qapi.py
 
 .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))
 $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
-	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.out 2>$*.err; echo $$? >$*.exit, "  TEST  $*.out")
-	@diff -q $(SRC_PATH)/$*.out $*.out
-	@diff -q $(SRC_PATH)/$*.err $*.err
-	@diff -q $(SRC_PATH)/$*.exit $*.exit
+	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.test.out 2>$*.test.err; echo $$? >$*.test.exit, "  TEST  $*.out")
+	@diff -q $(SRC_PATH)/$*.out $*.test.out
+	@diff -q $(SRC_PATH)/$*.err $*.test.err
+	@diff -q $(SRC_PATH)/$*.exit $*.test.exit
 
 # Consolidated targets
 
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 5/32 tests: Update .gitignore for test-int128 and test-bitops

In reply to Michael Roth

From: Markus Armbruster <[email protected]>

Forgotten in commit 6046c62 and 3464700.

(cherry picked from commit 9dbb52e862458935c250bac9e71d5a87da4e33e9)

Conflicts:

tests/.gitignore

*removed post-1.6 additions from diff

---
 tests/.gitignore |    2 ++
 1 file changed, 2 insertions(+)
tests/.gitignore +2 -0
index d9c2ef4..9ac044d 100644
@@ -5,8 +5,10 @@ check-qjson
 check-qlist
 check-qstring
 test-aio
+test-bitops
 test-cutils
 test-hbitmap
+test-int128
 test-iov
 test-mul64
 test-qapi-types.[ch]
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 6/32 tci: Add implementation of rotl_i64, rotr_i64

In reply to Michael Roth

From: Stefan Weil <[email protected]>

It is used by qemu-ppc64 when running Debian's busybox-static.

Cc qemu-stable <[email protected]>
(cherry picked from commit d285bf784b6234e994ce73c05c82c9fb6429df00)
---
 tcg/tci/tcg-target.c |    1 -
 tci.c                |   10 +++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
tcg/tci/tcg-target.c +0 -1
index e118bc7..7f86a7f 100644
@@ -677,7 +677,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
     case INDEX_op_shl_i64:
     case INDEX_op_shr_i64:
     case INDEX_op_sar_i64:
-        /* TODO: Implementation of rotl_i64, rotr_i64 missing in tci.c. */
     case INDEX_op_rotl_i64:     /* Optional (TCG_TARGET_HAS_rot_i64). */
     case INDEX_op_rotr_i64:     /* Optional (TCG_TARGET_HAS_rot_i64). */
         tcg_out_r(s, args[0]);
tci.c +9 -1
index af58576..b09ad25 100644
@@ -952,8 +952,16 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
             break;
 #if TCG_TARGET_HAS_rot_i64
         case INDEX_op_rotl_i64:
+            t0 = *tb_ptr++;
+            t1 = tci_read_ri64(&tb_ptr);
+            t2 = tci_read_ri64(&tb_ptr);
+            tci_write_reg64(t0, (t1 << t2) | (t1 >> (64 - t2)));
+            break;
         case INDEX_op_rotr_i64:
-            TODO();
+            t0 = *tb_ptr++;
+            t1 = tci_read_ri64(&tb_ptr);
+            t2 = tci_read_ri64(&tb_ptr);
+            tci_write_reg64(t0, (t1 >> t2) | (t1 << (64 - t2)));
             break;
 #endif
 #if TCG_TARGET_HAS_deposit_i64
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH 7/32 bitops: Add rotate functions (rol8, ror8, ...)

In reply to Michael Roth

From: Stefan Weil <[email protected]>

These functions were copies from include/linux/bitopts.h.

(cherry picked from commit 6aa25b4a7bb10c48c3054f268d5be98e42ea42c0)
---
 include/qemu/bitops.h |   80 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
include/qemu/bitops.h +80 -0
index 06e2e6f..304c90c 100644
@@ -184,6 +184,86 @@ static inline unsigned long hweight_long(unsigned long w)
 }
 
 /**
+ * rol8 - rotate an 8-bit value left
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint8_t rol8(uint8_t word, unsigned int shift)
+{
+    return (word << shift) | (word >> (8 - shift));
+}
+
+/**
+ * ror8 - rotate an 8-bit value right
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint8_t ror8(uint8_t word, unsigned int shift)
+{
+    return (word >> shift) | (word << (8 - shift));
+}
+
+/**
+ * rol16 - rotate a 16-bit value left
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint16_t rol16(uint16_t word, unsigned int shift)
+{
+    return (word << shift) | (word >> (16 - shift));
+}
+
+/**
+ * ror16 - rotate a 16-bit value right
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint16_t ror16(uint16_t word, unsigned int shift)
+{
+    return (word >> shift) | (word << (16 - shift));
+}
+
+/**
+ * rol32 - rotate a 32-bit value left
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint32_t rol32(uint32_t word, unsigned int shift)
+{
+    return (word << shift) | (word >> (32 - shift));
+}
+
+/**
+ * ror32 - rotate a 32-bit value right
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint32_t ror32(uint32_t word, unsigned int shift)
+{
+    return (word >> shift) | (word << (32 - shift));
+}
+
+/**
+ * rol64 - rotate a 64-bit value left
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint64_t rol64(uint64_t word, unsigned int shift)
+{
+    return (word << shift) | (word >> (64 - shift));
+}
+
+/**
+ * ror64 - rotate a 64-bit value right
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline uint64_t ror64(uint64_t word, unsigned int shift)
+{
+    return (word >> shift) | (word << (64 - shift));
+}
+
+/**
  * extract32:
  * @value: the value to extract the bit field from
  * @start: the lowest bit in the bit field (numbered from 0)
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 8/32 misc: Use new rotate functions

In reply to Michael Roth

From: Stefan Weil <[email protected]>

(cherry picked from commit 3df2b8fde949be86d8a78923c992fdd698d4ea4c)
---
 target-arm/iwmmxt_helper.c |    2 +-
 tcg/optimize.c             |   12 ++++--------
 tci.c                      |    8 ++++----
 3 files changed, 9 insertions(+), 13 deletions(-)
target-arm/iwmmxt_helper.c +1 -1
index 7953b53..e6cfa62 100644
@@ -577,7 +577,7 @@ uint64_t HELPER(iwmmxt_rorl)(CPUARMState *env, uint64_t x, uint32_t n)
 
 uint64_t HELPER(iwmmxt_rorq)(CPUARMState *env, uint64_t x, uint32_t n)
 {
-    x = (x >> n) | (x << (64 - n));
+    x = ror64(x, n);
     env->iwmmxt.cregs[ARM_IWMMXT_wCASF] = NZBIT64(x);
     return x;
 }
tcg/optimize.c +4 -8
index b35868a..adb5258 100644
@@ -236,20 +236,16 @@ static TCGArg do_constant_folding_2(TCGOpcode op, TCGArg x, TCGArg y)
         return (int64_t)x >> (int64_t)y;
 
     case INDEX_op_rotr_i32:
-        x = ((uint32_t)x << (32 - y)) | ((uint32_t)x >> y);
-        return x;
+        return ror32(x, y);
 
     case INDEX_op_rotr_i64:
-        x = ((uint64_t)x << (64 - y)) | ((uint64_t)x >> y);
-        return x;
+        return ror64(x, y);
 
     case INDEX_op_rotl_i32:
-        x = ((uint32_t)x << y) | ((uint32_t)x >> (32 - y));
-        return x;
+        return rol32(x, y);
 
     case INDEX_op_rotl_i64:
-        x = ((uint64_t)x << y) | ((uint64_t)x >> (64 - y));
-        return x;
+        return rol64(x, y);
 
     CASE_OP_32_64(not):
         return ~x;
tci.c +4 -4
index b09ad25..53c4b66 100644
@@ -688,13 +688,13 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
             t0 = *tb_ptr++;
             t1 = tci_read_ri32(&tb_ptr);
             t2 = tci_read_ri32(&tb_ptr);
-            tci_write_reg32(t0, (t1 << t2) | (t1 >> (32 - t2)));
+            tci_write_reg32(t0, rol32(t1, t2));
             break;
         case INDEX_op_rotr_i32:
             t0 = *tb_ptr++;
             t1 = tci_read_ri32(&tb_ptr);
             t2 = tci_read_ri32(&tb_ptr);
-            tci_write_reg32(t0, (t1 >> t2) | (t1 << (32 - t2)));
+            tci_write_reg32(t0, ror32(t1, t2));
             break;
 #endif
 #if TCG_TARGET_HAS_deposit_i32
@@ -955,13 +955,13 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
             t0 = *tb_ptr++;
             t1 = tci_read_ri64(&tb_ptr);
             t2 = tci_read_ri64(&tb_ptr);
-            tci_write_reg64(t0, (t1 << t2) | (t1 >> (64 - t2)));
+            tci_write_reg64(t0, rol64(t1, t2));
             break;
         case INDEX_op_rotr_i64:
             t0 = *tb_ptr++;
             t1 = tci_read_ri64(&tb_ptr);
             t2 = tci_read_ri64(&tb_ptr);
-            tci_write_reg64(t0, (t1 >> t2) | (t1 << (64 - t2)));
+            tci_write_reg64(t0, ror64(t1, t2));
             break;
 #endif
 #if TCG_TARGET_HAS_deposit_i64
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH 9/32 qemu-char: Fix potential out of bounds access to local arrays

In reply to Michael Roth

From: Stefan Weil <[email protected]>

Latest gcc-4.8 supports a new option -fsanitize=address which activates an AddressSanitizer. This AddressSanitizer stops the QEMU system emulation very early because two character arrays of size 8 are potentially written with 9 bytes.

Commit 6ea314d91439741e95772dfbab98b4135e04bebb added the code.

There is no obvious reason why width or height could need 8 characters, so reduce it to 7 characters which together with the terminating '\0' fit into the arrays.

Cc qemu-stable <[email protected]>
(cherry picked from commit 49aa4058ac6dd0081aaa45776f07c98df397ca5e)
---
 qemu-char.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qemu-char.c +2 -2
index fc1c23d..649c9f9 100644
@@ -2969,11 +2969,11 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename)
     if (strstart(filename, "vc", &p)) {
         qemu_opt_set(opts, "backend", "vc");
         if (*p == ':') {
-            if (sscanf(p+1, "%8[0-9]x%8[0-9]", width, height) == 2) {
+            if (sscanf(p+1, "%7[0-9]x%7[0-9]", width, height) == 2) {
                 /* pixels */
                 qemu_opt_set(opts, "width", width);
                 qemu_opt_set(opts, "height", height);
-            } else if (sscanf(p+1, "%8[0-9]Cx%8[0-9]C", width, height) == 2) {
+            } else if (sscanf(p+1, "%7[0-9]Cx%7[0-9]C", width, height) == 2) {
                 /* chars */
                 qemu_opt_set(opts, "cols", width);
                 qemu_opt_set(opts, "rows", height);
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH 10/32 xen_disk: mark ioreq as mapped before unmapping in error case

In reply to Michael Roth

From: Matthew Daley <[email protected]>

Commit 4472beae modified the semantics of ioreq_{un,}map so that they are idempotent if called when they're not needed (ie., twice in a row). However, it neglected to handle the case where batch mapping is not being used (the default), and one of the grants fails to map. In this case, ioreq_unmap will be called to unwind and unmap any mappings already performed, but ioreq_unmap simply returns due to the aforementioned change (the ioreq has not already been marked as mapped).

The frontend user can therefore force xen_disk to leak grant mappings, a per-domain limited resource.

Fix by marking the ioreq as mapped before calling ioreq_unmap in this situation.

(cherry picked from commit a76f48e53382e6f039db6278443e3ce437653302)
---
 hw/block/xen_disk.c |    1 +
 1 file changed, 1 insertion(+)
hw/block/xen_disk.c +1 -0
index 727f433..03e30d7 100644
@@ -405,6 +405,7 @@ static int ioreq_map(struct ioreq *ioreq)
                 xen_be_printf(&ioreq->blkdev->xendev, 0,
                               "can't map grant ref %d (%s, %d maps)\n",
                               refs[i], strerror(errno), ioreq->blkdev->cnt_map);
+                ioreq->mapped = 1;
                 ioreq_unmap(ioreq);
                 return -1;
             }
Signature · 1 line
1.7.9.5
#11 lore raw

PATCH 11/32 vmdk: Fix vmdk_parse_extents

In reply to Michael Roth

From: Fam Zheng <[email protected]>

An extra 'p++' after while loop when *p == '\n' will move p to unknown data position, risking parsing junk data or memory access violation.

(cherry picked from commit 899f1ae219d5eaa96a53c996026cb0178d62a86d)
---
 block/vmdk.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
block/vmdk.c +5 -2
index 258a24f..dcee07a 100644
@@ -755,10 +755,13 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
         }
 next_line:
         /* move to next line */
-        while (*p && *p != '\n') {
+        while (*p) {
+            if (*p == '\n') {
+                p++;
+                break;
+            }
             p++;
         }
-        p++;
     }
     return 0;
 }
Signature · 1 line
1.7.9.5
#12 lore raw

PATCH 12/32 audio: honor QEMU_AUDIO_TIMER_PERIOD instead of waking up every *nano* second

In reply to Michael Roth

From: Hans de Goede <[email protected]>

Now that we no longer have MIN_REARM_TIMER_NS a bug in the audio subsys has clearly shown it self by trying to make a timer fire every nano second.

Note we have a similar problem in 1.6, 1.5 and older but there MIN_REARM_TIMER_NS limits the wakeups caused by audio being active to 4000 times / second. This still causes a host cpu load of 50 % for simply playing audio, where as with this patch git master is at 13%, so we should backport this to 1.5 and 1.6 too.

Note this will not apply to 1.5 and 1.6 as is.

(cherry picked from commit b4350deed67b95651896ddb60cf9f765093a4848)

Conflicts:

audio/audio.c

*fixed to reflect 1.6 timer function/clock names

---
 audio/audio.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
audio/audio.c +2 -1
index 02bb886..bcd41a9 100644
@@ -1124,7 +1124,8 @@ static int audio_is_timer_needed (void)
 static void audio_reset_timer (AudioState *s)
 {
     if (audio_is_timer_needed ()) {
-        qemu_mod_timer (s->ts, qemu_get_clock_ns (vm_clock) + 1);
+        qemu_mod_timer (s->ts,
+            qemu_get_clock_ns(vm_clock) + conf.period.ticks);
     }
     else {
         qemu_del_timer (s->ts);
Signature · 1 line
1.7.9.5
#13 lore raw

PATCH 13/32 monitor: eliminate monitor_event_state_lock

In reply to Michael Roth

From: Paolo Bonzini <[email protected]>

This lock does not protect anything that the BQL does not already protect. Furthermore, with -nodefaults and no monitor, the mutex is not initialized but monitor_protocol_event_queue is called anyway, which causes a crash under mingw (and only works by luck. under Linux or other POSIX OSes).

Cc Daniel Berrange <[email protected]>
(cherry picked from commit c20b7fa4b2fedd979bcb0cc974bb5d08a10e3448)
---
 monitor.c |    6 ------
 1 file changed, 6 deletions(-)
monitor.c +0 -6
index 5dc0aa9..99bfcd9 100644
@@ -508,7 +508,6 @@ static const char *monitor_event_names[] = {
 QEMU_BUILD_BUG_ON(ARRAY_SIZE(monitor_event_names) != QEVENT_MAX)
 
 MonitorEventState monitor_event_state[QEVENT_MAX];
-QemuMutex monitor_event_state_lock;
 
 /*
  * Emits the event to every monitor instance
@@ -540,7 +539,6 @@ monitor_protocol_event_queue(MonitorEvent event,
     int64_t now = qemu_get_clock_ns(rt_clock);
     assert(event < QEVENT_MAX);
 
-    qemu_mutex_lock(&monitor_event_state_lock);
     evstate = &(monitor_event_state[event]);
     trace_monitor_protocol_event_queue(event,
                                        data,
@@ -573,7 +571,6 @@ monitor_protocol_event_queue(MonitorEvent event,
             evstate->last = now;
         }
     }
-    qemu_mutex_unlock(&monitor_event_state_lock);
 }
 
 
@@ -586,7 +583,6 @@ static void monitor_protocol_event_handler(void *opaque)
     MonitorEventState *evstate = opaque;
     int64_t now = qemu_get_clock_ns(rt_clock);
 
-    qemu_mutex_lock(&monitor_event_state_lock);
 
     trace_monitor_protocol_event_handler(evstate->event,
                                          evstate->data,
@@ -598,7 +594,6 @@ static void monitor_protocol_event_handler(void *opaque)
         evstate->data = NULL;
     }
     evstate->last = now;
-    qemu_mutex_unlock(&monitor_event_state_lock);
 }
 
 
@@ -635,7 +630,6 @@ monitor_protocol_event_throttle(MonitorEvent event,
  * and initialize state */
 static void monitor_protocol_event_init(void)
 {
-    qemu_mutex_init(&monitor_event_state_lock);
     /* Limit RTC & BALLOON events to 1 per second */
     monitor_protocol_event_throttle(QEVENT_RTC_CHANGE, 1000);
     monitor_protocol_event_throttle(QEVENT_BALLOON_CHANGE, 1000);
Signature · 1 line
1.7.9.5
#14 lore raw

PATCH 14/32 memory: fix 128 arithmetic in info mtree

In reply to Michael Roth

From: Alexey Kardashevskiy <[email protected]>

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().

(cherry picked from commit a66670c79c5c7d530d818430ffcdaa25cbf2c2ab)
---
 memory.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
memory.c +3 -1
index 5a10fd0..7f1f266 100644
@@ -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",
Signature · 1 line
1.7.9.5
#15 lore raw

PATCH 15/32 Adjust qapi-visit for python-2.4.3

In reply to Michael Roth

From: Richard Henderson <[email protected]>

We say we support python 2.4, but python 2.4.3 does not support the "expr if test else expr" syntax used here.

This allows QEMU to compile on RHEL 5.3, the last release for ia64.

(cherry picked from commit 7b75d9d61bf9b7b43f6df2fb2fbfc38c4eb9d2e9)
---
 scripts/qapi-visit.py |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
scripts/qapi-visit.py +14 -3
index 597cca4..02e16bb 100644
@@ -20,7 +20,10 @@ import errno
 def generate_visit_struct_fields(name, field_prefix, fn_prefix, members):
     substructs = []
     ret = ''
-    full_name = name if not fn_prefix else "%s_%s" % (name, fn_prefix)
+    if not fn_prefix:
+        full_name = name
+    else:
+        full_name = "%s_%s" % (name, fn_prefix)
 
     for argname, argentry, optional, structured in parse_args(members):
         if structured:
@@ -84,7 +87,10 @@ if (!error_is_set(errp)) {
 ''')
     push_indent()
 
-    full_name = name if not field_prefix else "%s_%s" % (field_prefix, name)
+    if not field_prefix:
+        full_name = name
+    else:
+        full_name = "%s_%s" % (field_prefix, name)
 
     if len(field_prefix):
         ret += mcgen('''
@@ -265,12 +271,17 @@ void visit_type_%(name)s(Visitor *m, %(name)s ** obj, const char *name, Error **
             name=name)
 
     pop_indent()
+
+    if not discriminator:
+        desc_type = "type"
+    else:
+        desc_type = discriminator
     ret += mcgen('''
         visit_type_%(name)sKind(m, &(*obj)->kind, "%(type)s", &err);
         if (!err) {
             switch ((*obj)->kind) {
 ''',
-                 name=name, type="type" if not discriminator else discriminator)
+                 name=name, type=desc_type)
 
     for key in members:
         if not discriminator:
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH 16/32 configure: detect endian via compile test

In reply to Michael Roth

From: Mike Frysinger <[email protected]>

This avoids needing to execute a program and keeping an (incomplete) list when cross-compiling.

Message-id: [email protected]

(cherry picked from commit 61cc919f73ea7ca134c0ac41b748981ad63a253b)
---
 configure |   40 ++++++++++++++--------------------------
 1 file changed, 14 insertions(+), 26 deletions(-)
configure +14 -26
index 4cf672d..1399de2 100755
@@ -1394,39 +1394,27 @@ feature_not_found() {
       "configure was not able to find it"
 }
 
-if test -z "$cross_prefix" ; then
-
 # ---
 # big/little endian test
 cat > $TMPC << EOF
-#include <inttypes.h>
-int main(void) {
-        volatile uint32_t i=0x01234567;
-        return (*((uint8_t*)(&i))) == 0x67;
+short big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, };
+short little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, };
+extern int foo(short *, short *);
+int main(int argc, char *argv[]) {
+    return foo(big_endian, little_endian);
 }
 EOF
 
-if compile_prog "" "" ; then
-$TMPE && bigendian="yes"
-else
-echo big/little test failed
-fi
-
-else
-
-# if cross compiling, cannot launch a program, so make a static guess
-case "$cpu" in
-  arm)
-    # ARM can be either way; ask the compiler which one we are
-    if check_define __ARMEB__; then
-      bigendian=yes
+if compile_object ; then
+    if grep -q BiGeNdIaN $TMPO ; then
+        bigendian="yes"
+    elif grep -q LiTtLeEnDiAn $TMPO ; then
+        bigendian="no"
+    else
+        echo big/little test failed
     fi
-  ;;
-  hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
-    bigendian=yes
-  ;;
-esac
-
+else
+    echo big/little test failed
 fi
 
 ##########################################
Signature · 1 line
1.7.9.5
#17 lore raw

PATCH 17/32 qapi: fix memleak by adding implict struct functions in dealloc visitor

In reply to Michael Roth

From: Wenchao Xia <[email protected]>

Otherwise member "base" is leaked in a qapi_free_STRUCTURE() call.

Message-id: [email protected]

(cherry picked from commit 3dce9cad5a6c0b0dbe0830973b270c9466c8ab4b)
---
 qapi/qapi-dealloc-visitor.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
qapi/qapi-dealloc-visitor.c +20 -0
index 1334de3..dc53545 100644
@@ -76,6 +76,24 @@ static void qapi_dealloc_end_struct(Visitor *v, Error **errp)
     }
 }
 
+static void qapi_dealloc_start_implicit_struct(Visitor *v,
+                                               void **obj,
+                                               size_t size,
+                                               Error **errp)
+{
+    QapiDeallocVisitor *qov = to_qov(v);
+    qapi_dealloc_push(qov, obj);
+}
+
+static void qapi_dealloc_end_implicit_struct(Visitor *v, Error **errp)
+{
+    QapiDeallocVisitor *qov = to_qov(v);
+    void **obj = qapi_dealloc_pop(qov);
+    if (obj) {
+        g_free(*obj);
+    }
+}
+
 static void qapi_dealloc_start_list(Visitor *v, const char *name, Error **errp)
 {
     QapiDeallocVisitor *qov = to_qov(v);
@@ -162,6 +180,8 @@ QapiDeallocVisitor *qapi_dealloc_visitor_new(void)
 
     v->visitor.start_struct = qapi_dealloc_start_struct;
     v->visitor.end_struct = qapi_dealloc_end_struct;
+    v->visitor.start_implicit_struct = qapi_dealloc_start_implicit_struct;
+    v->visitor.end_implicit_struct = qapi_dealloc_end_implicit_struct;
     v->visitor.start_list = qapi_dealloc_start_list;
     v->visitor.next_list = qapi_dealloc_next_list;
     v->visitor.end_list = qapi_dealloc_end_list;
Signature · 1 line
1.7.9.5
#18 lore raw

PATCH 18/32 tests: fix memleak in error path test for input visitor

In reply to Michael Roth

From: Wenchao Xia <[email protected]>

Message-id: [email protected]

(cherry picked from commit 8aa15b6e527f234e491a6d354bed4d10da3a01a7)
---
 tests/test-qmp-input-visitor.c |    1 +
 1 file changed, 1 insertion(+)
tests/test-qmp-input-visitor.c +1 -0
index 0beb8fb..1e1c6fa 100644
@@ -604,6 +604,7 @@ static void test_visitor_in_errors(TestInputVisitorData *data,
     g_assert(error_is_set(&errp));
     g_assert(p->string == NULL);
 
+    error_free(errp);
     g_free(p->string);
     g_free(p);
 }
Signature · 1 line
1.7.9.5
#19 lore raw

PATCH 19/32 configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0

In reply to Michael Roth

From: Peter Maydell <[email protected]>

Our rules.mak adds '-rR' to MAKEFLAGS to indicate that we will be explicitly specifying everything and not relying on any default variables or rules. However we were accidentally relying on the default ARFLAGS ("rv"). This went unnoticed because of a bug in GNU Make 3.82 and earlier which meant that adding -rR to MAKEFLAGS only affected submakes, not the currently running instance. Explicitly set ARFLAGS in config-host.mak, in the same way we handle CFLAGS and LDFLAGS; this will allow us to work with Make 4.0.

Thanks to Paul Smith for analyzing this bug for us.

(cherry picked from commit 45d285abd7028ac72418c1a22f9298bb898fbfb8)
---
 configure |    5 +++++
 1 file changed, 5 insertions(+)
configure +5 -0
index 1399de2..ff7933b 100755
@@ -298,6 +298,9 @@ query_pkg_config() {
 pkg_config=query_pkg_config
 sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
 
+# If the user hasn't specified ARFLAGS, default to 'rv', just as make does.
+ARFLAGS="${ARFLAGS-rv}"
+
 # default flags for all hosts
 QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
 QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
@@ -3529,6 +3532,7 @@ echo "Source path       $source_path"
 echo "C compiler        $cc"
 echo "Host C compiler   $host_cc"
 echo "Objective-C compiler $objcc"
+echo "ARFLAGS           $ARFLAGS"
 echo "CFLAGS            $CFLAGS"
 echo "QEMU_CFLAGS       $QEMU_CFLAGS"
 echo "LDFLAGS           $LDFLAGS"
@@ -4117,6 +4121,7 @@ echo "CC_I386=$cc_i386" >> $config_host_mak
 echo "HOST_CC=$host_cc" >> $config_host_mak
 echo "OBJCC=$objcc" >> $config_host_mak
 echo "AR=$ar" >> $config_host_mak
+echo "ARFLAGS=$ARFLAGS" >> $config_host_mak
 echo "AS=$as" >> $config_host_mak
 echo "CPP=$cpp" >> $config_host_mak
 echo "OBJCOPY=$objcopy" >> $config_host_mak
Signature · 1 line
1.7.9.5
#20 lore raw

PATCH 20/32 linux-user: Fix stat64 syscall for SPARC64

In reply to Michael Roth

From: Stefan Weil <[email protected]>

Some targets use a stat64 structure for the stat64 syscall while others use a stat structure. SPARC64 used the wrong kind.

Instead of extending the conditional compilation in syscall.c, now a macro TARGET_HAS_STRUCT_STAT64 is defined whenever a target has a target_stat64.

(cherry picked from commit 20d155bc902f41c5b354937e730ad85b43614ae9)
---
 linux-user/syscall.c      |    6 +++---
 linux-user/syscall_defs.h |   14 ++++++++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)
linux-user/syscall.c +3 -3
index f986548..c510975 100644
@@ -4764,10 +4764,10 @@ static inline abi_long host_to_target_stat64(void *cpu_env,
     } else
 #endif
     {
-#if TARGET_ABI_BITS == 64 && !defined(TARGET_ALPHA)
-        struct target_stat *target_st;
-#else
+#if defined(TARGET_HAS_STRUCT_STAT64)
         struct target_stat64 *target_st;
+#else
+        struct target_stat *target_st;
 #endif
 
         if (!lock_user_struct(VERIFY_WRITE, target_st, target_addr, 0))
linux-user/syscall_defs.h +14 -0
index 086fbff..dd0d5a9 100644
@@ -1165,6 +1165,7 @@ struct target_stat {
 /* This matches struct stat64 in glibc2.1, hence the absolutely
  * insane amounts of padding around dev_t's.
  */
+#define TARGET_HAS_STRUCT_STAT64
 struct target_stat64 {
 	unsigned short	st_dev;
 	unsigned char	__pad0[10];
@@ -1200,6 +1201,7 @@ struct target_stat64 {
 } QEMU_PACKED;
 
 #ifdef TARGET_ARM
+#define TARGET_HAS_STRUCT_STAT64
 struct target_eabi_stat64 {
         unsigned long long st_dev;
         unsigned int    __pad1;
@@ -1249,6 +1251,7 @@ struct target_stat {
 	abi_ulong	__unused4[2];
 };
 
+#define TARGET_HAS_STRUCT_STAT64
 struct target_stat64 {
 	unsigned char	__pad0[6];
 	unsigned short	st_dev;
@@ -1304,6 +1307,7 @@ struct target_stat {
 	abi_ulong	__unused4[2];
 };
 
+#define TARGET_HAS_STRUCT_STAT64
 struct target_stat64 {
 	unsigned char	__pad0[6];
 	unsigned short	st_dev;
@@ -1371,6 +1375,8 @@ struct target_stat {
 #endif
 };
 
+#if !defined(TARGET_PPC64) || defined(TARGET_ABI32)
+#define TARGET_HAS_STRUCT_STAT64
 struct QEMU_PACKED target_stat64 {
 	unsigned long long st_dev;
         unsigned long long st_ino;
@@ -1393,6 +1399,7 @@ struct QEMU_PACKED target_stat64 {
         unsigned int   __unused4;
         unsigned int   __unused5;
 };
+#endif
 
 #elif defined(TARGET_MICROBLAZE)
 
@@ -1418,6 +1425,7 @@ struct target_stat {
 };
 
 /* FIXME: Microblaze no-mmu user-space has a difference stat64 layout...  */
+#define TARGET_HAS_STRUCT_STAT64
 struct QEMU_PACKED target_stat64 {
 	uint64_t st_dev;
 #define TARGET_STAT64_HAS_BROKEN_ST_INO 1
@@ -1473,6 +1481,7 @@ struct target_stat {
 /* This matches struct stat64 in glibc2.1, hence the absolutely
  * insane amounts of padding around dev_t's.
  */
+#define TARGET_HAS_STRUCT_STAT64
 struct target_stat64 {
 	unsigned long long	st_dev;
 	unsigned char	__pad1[2];
@@ -1581,6 +1590,7 @@ struct target_stat {
  * struct stat of the 64-bit kernel.
  */
 
+#define TARGET_HAS_STRUCT_STAT64
 struct target_stat64 {
 	unsigned int	st_dev;
 	unsigned int	st_pad0[3];	/* Reserved for st_dev expansion  */
@@ -1652,6 +1662,7 @@ struct target_stat {
  * struct stat of the 64-bit kernel.
  */
 
+#define TARGET_HAS_STRUCT_STAT64
 struct target_stat64 {
 	abi_ulong	st_dev;
 	abi_ulong	st_pad0[3];	/* Reserved for st_dev expansion  */
@@ -1708,6 +1719,7 @@ struct target_stat {
        unsigned int    st_gen;
 };
 
+#define TARGET_HAS_STRUCT_STAT64
 struct target_stat64 {
        abi_ulong    st_dev;
        abi_ulong    st_ino;
@@ -1757,6 +1769,7 @@ struct target_stat {
 /* This matches struct stat64 in glibc2.1, hence the absolutely
  * insane amounts of padding around dev_t's.
  */
+#define TARGET_HAS_STRUCT_STAT64
 struct QEMU_PACKED target_stat64 {
 	unsigned long long	st_dev;
 	unsigned char	__pad0[4];
@@ -1862,6 +1875,7 @@ struct target_stat {
     unsigned int __unused5;
 };
 
+#define TARGET_HAS_STRUCT_STAT64
 struct target_stat64 {
     uint64_t st_dev;
     uint64_t st_ino;
Signature · 1 line
1.7.9.5
#21 lore raw

PATCH 21/32 virtio-net: only delete bh that existed

In reply to Michael Roth

From: Jason Wang <[email protected]>

We delete without check whether it existed during exit. This will lead NULL pointer deference since it was created conditionally depends on guest driver status and features. So add a check of existence before trying to delete it.

Message-id: [email protected]

(cherry picked from commit fe2dafa02de4f80ab36f6e0f4ddfcd6418c03c49)

Conflicts:

hw/net/virtio-net.c

*modified to reflect timer function names for 1.6

---
 hw/net/virtio-net.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/virtio-net.c +1 -1
index aa1880c..bb757b3 100644
@@ -1600,7 +1600,7 @@ static int virtio_net_device_exit(DeviceState *qdev)
         if (q->tx_timer) {
             qemu_del_timer(q->tx_timer);
             qemu_free_timer(q->tx_timer);
-        } else {
+        } else if (q->tx_bh) {
             qemu_bh_delete(q->tx_bh);
         }
     }
Signature · 1 line
1.7.9.5
#22 lore raw

PATCH 22/32 exec: fix breakpoint_invalidate when pc may not be translated

In reply to Michael Roth

From: Max Filippov <[email protected]>

This fixes qemu abort with the following message:

    include/qemu/int128.h:22: int128_get64: Assertion `!a.hi' failed.

which happens due to attempt to invalidate breakpoint by virtual address for which get_phys_page_debug couldn't find mapping.

For more details see
http://lists.nongnu.org/archive/html/qemu-devel/2013-09/msg04582.html

(cherry picked from commit e8262a1b5b7cfbcbc80c46e4ce6ff7c517b7b2f6)
---
 exec.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
exec.c +4 -2
index f6674e5..667a718 100644
@@ -425,8 +425,10 @@ static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
 #else
 static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
 {
-    tb_invalidate_phys_addr(cpu_get_phys_page_debug(cpu, pc) |
-            (pc & ~TARGET_PAGE_MASK));
+    hwaddr phys = cpu_get_phys_page_debug(cpu, pc);
+    if (phys != -1) {
+        tb_invalidate_phys_addr(phys | (pc & ~TARGET_PAGE_MASK));
+    }
 }
 #endif
 #endif /* TARGET_HAS_ICE */
Signature · 1 line
1.7.9.5
#23 lore raw

PATCH 23/32 Fix pc migration from qemu <= 1.5

In reply to Michael Roth

From: Cole Robinson <[email protected]>

The following commit introduced a migration incompatibility:

commit 568f0690fd9aa4d39d84b04c1a5dbb53a915c3fe

Author: David Gibson <[email protected]>
Date:   Thu Jun 6 18:48:49 2013 +1000

pci: Replace pci_find_domain() with more general pci_root_bus_path()

The issue is that i440fx savevm idstr went from 0000:00:00.0/I440FX to 0000:00.0/I440FX. Unfortunately we are stuck with the breakage for 1.6 machine types.

Add a compat property to maintain the busted idstr for the 1.6 machine types, but revert to the old style format for 1.7+, and <= 1.5.

Tested with migration from qemu 1.5, qemu 1.6, and qemu.git.

(cherry picked from commit 04c7d8b8dea724f1007f0f6e76047ff03b4cb24f)

Conflicts:

	include/hw/i386/pc.h

*removed 1.6 compat properties

---
 hw/pci-host/piix.c        |    9 ++++++++-
 hw/pci-host/q35.c         |   10 ++++++++--
 include/hw/i386/pc.h      |    8 ++++++++
 include/hw/pci-host/q35.h |    1 +
 4 files changed, 25 insertions(+), 3 deletions(-)
hw/pci-host/piix.c +8 -1
index 221d82b..967f949 100644
@@ -48,6 +48,7 @@ typedef struct I440FXState {
     PCIHostState parent_obj;
     PcPciInfo pci_info;
     uint64_t pci_hole64_size;
+    uint32_t short_root_bus;
 } I440FXState;
 
 #define PIIX_NUM_PIC_IRQS       16      /* i8259 * 2 */
@@ -706,13 +707,19 @@ static const TypeInfo i440fx_info = {
 static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge,
                                                 PCIBus *rootbus)
 {
+    I440FXState *s = I440FX_PCI_HOST_BRIDGE(host_bridge);
+
     /* For backwards compat with old device paths */
-    return "0000";
+    if (s->short_root_bus) {
+        return "0000";
+    }
+    return "0000:00";
 }
 
 static Property i440fx_props[] = {
     DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, I440FXState,
                      pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE),
+    DEFINE_PROP_UINT32("short_root_bus", I440FXState, short_root_bus, 0),
     DEFINE_PROP_END_OF_LIST(),
 };
 
hw/pci-host/q35.c +8 -2
index 4febd24..f762053 100644
@@ -61,8 +61,13 @@ static void q35_host_realize(DeviceState *dev, Error **errp)
 static const char *q35_host_root_bus_path(PCIHostState *host_bridge,
                                           PCIBus *rootbus)
 {
-    /* For backwards compat with old device paths */
-    return "0000";
+    Q35PCIHost *s = Q35_HOST_DEVICE(host_bridge);
+
+     /* For backwards compat with old device paths */
+    if (s->mch.short_root_bus) {
+        return "0000";
+    }
+    return "0000:00";
 }
 
 static void q35_host_get_pci_hole_start(Object *obj, Visitor *v,
@@ -108,6 +113,7 @@ static Property mch_props[] = {
                         MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT),
     DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35PCIHost,
                      mch.pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE),
+    DEFINE_PROP_UINT32("short_root_bus", Q35PCIHost, mch.short_root_bus, 0),
     DEFINE_PROP_END_OF_LIST(),
 };
 
include/hw/i386/pc.h +8 -0
index 475ba9e..dc7e3f5 100644
@@ -258,6 +258,14 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
             .driver = TYPE_X86_CPU,\
             .property = "pmu",\
             .value = "on",\
+        },{\
+            .driver   = "i440FX-pcihost",\
+            .property = "short_root_bus",\
+            .value    = stringify(0),\
+        },{\
+            .driver   = "q35-pcihost",\
+            .property = "short_root_bus",\
+            .value    = stringify(0),\
         }
 
 #define PC_COMPAT_1_4 \
include/hw/pci-host/q35.h +1 -0
index 6eb7ab6..95a3cc2 100644
@@ -61,6 +61,7 @@ typedef struct MCHPCIState {
     ram_addr_t above_4g_mem_size;
     uint64_t pci_hole64_size;
     PcGuestInfo *guest_info;
+    uint32_t short_root_bus;
 } MCHPCIState;
 
 typedef struct Q35PCIHost {
Signature · 1 line
1.7.9.5
#24 lore raw

PATCH 24/32 qcow2: count_contiguous_clusters and compression

In reply to Michael Roth

From: Max Reitz <[email protected]>

The function is not intended to be used on compressed clusters and will not work correctly, if used anyway, since L2E_OFFSET_MASK is not the right mask for determining the offset of compressed clusters. Therefore, assert that the first cluster is not compressed and always include the compression flag in the mask of significant flags, i.e., stop the search as soon as a compressed cluster occurs.

(cherry picked from commit 15684a474286cc2c6106c756ddd095a21d058970)
---
 block/qcow2-cluster.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
block/qcow2-cluster.c +5 -2
index cca76d4..fd3054b 100644
@@ -266,12 +266,15 @@ static int count_contiguous_clusters(uint64_t nb_clusters, int cluster_size,
         uint64_t *l2_table, uint64_t start, uint64_t stop_flags)
 {
     int i;
-    uint64_t mask = stop_flags | L2E_OFFSET_MASK;
-    uint64_t offset = be64_to_cpu(l2_table[0]) & mask;
+    uint64_t mask = stop_flags | L2E_OFFSET_MASK | QCOW2_CLUSTER_COMPRESSED;
+    uint64_t first_entry = be64_to_cpu(l2_table[0]);
+    uint64_t offset = first_entry & mask;
 
     if (!offset)
         return 0;
 
+    assert(qcow2_get_cluster_type(first_entry) != QCOW2_CLUSTER_COMPRESSED);
+
     for (i = start; i < start + nb_clusters; i++) {
         uint64_t l2_entry = be64_to_cpu(l2_table[i]) & mask;
         if (offset + (uint64_t) i * cluster_size != l2_entry) {
Signature · 1 line
1.7.9.5
#25 lore raw

PATCH 25/32 qcow2: fix possible corruption when reading multiple clusters

In reply to Michael Roth

From: Peter Lieven <[email protected]>

if multiple sectors spanning multiple clusters are read the function count_contiguous_clusters should ensure that the cluster type should not change between the clusters.

Especially the for-loop should break when we have one or more normal clusters followed by a compressed cluster.

Unfortunately the wrong macro was used in the mask to compare the flags.

This was discovered while debugging a data corruption issue when converting a compressed qcow2 image to raw. qemu-img reads 2MB chunks which span multiple clusters.

(cherry picked from commit 78a52ad5acca7053b774fcc80290e7b7e224c80a)
---
 block/qcow2-cluster.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/qcow2-cluster.c +1 -1
index fd3054b..b558eb0 100644
@@ -266,7 +266,7 @@ static int count_contiguous_clusters(uint64_t nb_clusters, int cluster_size,
         uint64_t *l2_table, uint64_t start, uint64_t stop_flags)
 {
     int i;
-    uint64_t mask = stop_flags | L2E_OFFSET_MASK | QCOW2_CLUSTER_COMPRESSED;
+    uint64_t mask = stop_flags | L2E_OFFSET_MASK | QCOW_OFLAG_COMPRESSED;
     uint64_t first_entry = be64_to_cpu(l2_table[0]);
     uint64_t offset = first_entry & mask;
 
Signature · 1 line
1.7.9.5
#26 lore raw

PATCH 26/32 vfio-pci: Fix multifunction=on

In reply to Michael Roth

From: Alex Williamson <[email protected]>

When an assigned device is initialized it copies the device config space into the emulated config space. Unfortunately multifunction is setup prior to the device initfn and gets clobbered. We need to restore it just like pci-assign does.

(cherry picked from commit 8d07d6c46597a885eb38d99cc6fff399ce69cd21)
---
 hw/misc/vfio.c |    7 +++++++
 1 file changed, 7 insertions(+)
hw/misc/vfio.c +7 -0
index 017e693..d9e78e1 100644
@@ -3142,6 +3142,13 @@ static int vfio_initfn(PCIDevice *pdev)
     vdev->emulated_config_bits[PCI_HEADER_TYPE] =
                                               PCI_HEADER_TYPE_MULTI_FUNCTION;
 
+    /* Restore or clear multifunction, this is always controlled by QEMU */
+    if (vdev->pdev.cap_present & QEMU_PCI_CAP_MULTIFUNCTION) {
+        vdev->pdev.config[PCI_HEADER_TYPE] |= PCI_HEADER_TYPE_MULTI_FUNCTION;
+    } else {
+        vdev->pdev.config[PCI_HEADER_TYPE] &= ~PCI_HEADER_TYPE_MULTI_FUNCTION;
+    }
+
     /*
      * Clear host resource mapping info.  If we choose not to register a
      * BAR, such as might be the case with the option ROM, we can get
Signature · 1 line
1.7.9.5
#27 lore raw

PATCH 27/32 virtio-net: fix the memory leak in rxfilter_notify()

In reply to Michael Roth

From: Amos Kong <[email protected]>

object_get_canonical_path() returns a gchar*, it should be freed by the caller.

(cherry picked from commit 96e35046e4a97df5b4e1e24e217eb1e1701c7c71)
---
 hw/net/virtio-net.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/net/virtio-net.c +4 -4
index bb757b3..5320aab 100644
@@ -200,16 +200,16 @@ static void rxfilter_notify(NetClientState *nc)
     VirtIONet *n = qemu_get_nic_opaque(nc);
 
     if (nc->rxfilter_notify_enabled) {
+        gchar *path = object_get_canonical_path(OBJECT(n->qdev));
         if (n->netclient_name) {
             event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }",
-                                    n->netclient_name,
-                                    object_get_canonical_path(OBJECT(n->qdev)));
+                                    n->netclient_name, path);
         } else {
-            event_data = qobject_from_jsonf("{ 'path': %s }",
-                                    object_get_canonical_path(OBJECT(n->qdev)));
+            event_data = qobject_from_jsonf("{ 'path': %s }", path);
         }
         monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data);
         qobject_decref(event_data);
+        g_free(path);
 
         /* disable event notification to avoid events flooding */
         nc->rxfilter_notify_enabled = 0;
Signature · 1 line
1.7.9.5
#28 lore raw

PATCH 28/32 qom: Fix memory leak in object_property_set_link()

In reply to Michael Roth

From: Vlad Yasevich <[email protected]>

Save the result of the call to object_get_canonical_path() so we can free it.

(cherry picked from commit 2d3aa28cc2cf382aa04cd577e0be542175eea9bd)
---
 qom/object.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
qom/object.c +3 -2
index b2479d1..333f807 100644
@@ -823,8 +823,9 @@ char *object_property_get_str(Object *obj, const char *name,
 void object_property_set_link(Object *obj, Object *value,
                               const char *name, Error **errp)
 {
-    object_property_set_str(obj, object_get_canonical_path(value),
-                            name, errp);
+    gchar *path = object_get_canonical_path(value);
+    object_property_set_str(obj, path, name, errp);
+    g_free(path);
 }
 
 Object *object_property_get_link(Object *obj, const char *name,
Signature · 1 line
1.7.9.5
#29 lore raw

PATCH 29/32 qdev-monitor: Fix crash when device_add is called with abstract driver

In reply to Michael Roth

From: Igor Mammedov <[email protected]>

User is able to crash running QEMU when following monitor command is called:

device_add intel-hda-generic

Crash is caused by assertion in object_initialize_with_type() when type is abstract.

Checking if type is abstract before instance is created in qdev_device_add() allows to prevent crash on incorrect user input.

(cherry picked from commit 2fa4e56d88aa0039062bbc7f9a88e9f90c77ed94)

Conflicts:

qdev-monitor.c

*updated to reflect different 1.6 variable names

---
 qdev-monitor.c |    6 ++++++
 1 file changed, 6 insertions(+)
qdev-monitor.c +6 -0
index 410cdcb..bb2e1b6 100644
@@ -472,6 +472,12 @@ DeviceState *qdev_device_add(QemuOpts *opts)
         return NULL;
     }
 
+    if (object_class_is_abstract(obj)) {
+        qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver",
+                      "non-abstract device type");
+        return NULL;
+    }
+
     k = DEVICE_CLASS(obj);
 
     /* find bus */
Signature · 1 line
1.7.9.5
#30 lore raw

PATCH 30/32 qdev-monitor: Unref device when device_add fails

In reply to Michael Roth

From: Stefan Hajnoczi <[email protected]>

qdev_device_add() leaks the created device upon failure. I suspect this problem crept in because qdev_free() unparents the device but does not drop a reference - confusing name.

(cherry picked from commit ee6abeb6ec08473713848ce9028110f1684853b7)
---
 qdev-monitor.c |    2 ++
 1 file changed, 2 insertions(+)
qdev-monitor.c +2 -0
index bb2e1b6..1b2c606 100644
@@ -518,6 +518,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)
     }
     if (qemu_opt_foreach(opts, set_property, qdev, 1) != 0) {
         qdev_free(qdev);
+        object_unref(OBJECT(qdev));
         return NULL;
     }
     if (qdev->id) {
@@ -531,6 +532,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)
         g_free(name);
     }        
     if (qdev_init(qdev) < 0) {
+        object_unref(OBJECT(qdev));
         qerror_report(QERR_DEVICE_INIT_FAILED, driver);
         return NULL;
     }
Signature · 1 line
1.7.9.5
#31 lore raw

PATCH 31/32 pci: unregister vmstate_pcibus on unplug

In reply to Michael Roth

From: Bandan Das <[email protected]>

PCIBus registers a vmstate during init. Unregister it upon removal/unplug.

(cherry picked from commit 5c397242d5d53c1adecce31817bb439383cf8228)
---
 hw/pci/pci.c |    8 ++++++++
 1 file changed, 8 insertions(+)
hw/pci/pci.c +8 -0
index 4c004f5..dc5b788 100644
@@ -47,6 +47,7 @@ static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent);
 static char *pcibus_get_dev_path(DeviceState *dev);
 static char *pcibus_get_fw_dev_path(DeviceState *dev);
 static int pcibus_reset(BusState *qbus);
+static void pci_bus_finalize(Object *obj);
 
 static Property pci_props[] = {
     DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1),
@@ -73,6 +74,7 @@ static const TypeInfo pci_bus_info = {
     .name = TYPE_PCI_BUS,
     .parent = TYPE_BUS,
     .instance_size = sizeof(PCIBus),
+    .instance_finalize = pci_bus_finalize,
     .class_init = pci_bus_class_init,
 };
 
@@ -375,6 +377,12 @@ int pci_bus_num(PCIBus *s)
     return s->parent_dev->config[PCI_SECONDARY_BUS];
 }
 
+static void pci_bus_finalize(Object *obj)
+{
+    PCIBus *bus = PCI_BUS(obj);
+    vmstate_unregister(NULL, &vmstate_pcibus, bus);
+}
+
 static int get_pci_config_device(QEMUFile *f, void *pv, size_t size)
 {
     PCIDevice *s = container_of(pv, PCIDevice, config);
Signature · 1 line
1.7.9.5
#32 lore raw

PATCH 32/32 rng-egd: offset the point when repeatedly read from the buffer

In reply to Michael Roth

From: Amos Kong <[email protected]>

The buffer content might be read out more than once, currently we just repeatedly read the first data block, buffer offset is missing.

Message-id: [email protected]

(cherry picked from commit 1eb1bd9eafa890f1f4d16ef5cb8b9239a86874d9)
---
 backends/rng-egd.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
backends/rng-egd.c +3 -1
index 9e5a536..2962795 100644
@@ -91,12 +91,14 @@ static int rng_egd_chr_can_read(void *opaque)
 static void rng_egd_chr_read(void *opaque, const uint8_t *buf, int size)
 {
     RngEgd *s = RNG_EGD(opaque);
+    size_t buf_offset = 0;
 
     while (size > 0 && s->requests) {
         RngRequest *req = s->requests->data;
         int len = MIN(size, req->size - req->offset);
 
-        memcpy(req->data + req->offset, buf, len);
+        memcpy(req->data + req->offset, buf + buf_offset, len);
+        buf_offset += len;
         req->offset += len;
         size -= len;
 
Signature · 1 line
1.7.9.5
#33 lore raw
In reply to Michael Roth

Il 04/12/2013 15:34, Michael Roth ha scritto:

Quoted 122 lines

Hi everyone,

The following new patches are queued for QEMU stable v1.6.2:

https://github.com/mdroth/qemu/commits/stable-1.6-staging

The release is planned for 2013-12-09:

http://wiki.qemu.org/Planning/1.6

Please respond here or CC [email protected] on any patches you think should be included in the release. The cut-off date is has been extended to 2013-12-06 due to the round-up email going out late.

Testing/feedback is greatly appreciated.

Thanks!

Alex Williamson (1):
vfio-pci: Fix multifunction=on

Alexey Kardashevskiy (1):
memory: fix 128 arithmetic in info mtree

Amit Shah (3):
char: move backends' io watch tag to CharDriverState
char: use common function to disable callbacks on chardev close
char: remove watch callback on chardev detach from frontend

Amos Kong (2):
virtio-net: fix the memory leak in rxfilter_notify()
rng-egd: offset the point when repeatedly read from the buffer

Bandan Das (1):
pci: unregister vmstate_pcibus on unplug

Cole Robinson (1):
Fix pc migration from qemu <= 1.5

Fam Zheng (1):
vmdk: Fix vmdk_parse_extents

Hans de Goede (1):
audio: honor QEMU_AUDIO_TIMER_PERIOD instead of waking up every *nano* second

Igor Mammedov (1):
qdev-monitor: Fix crash when device_add is called with abstract driver

Jason Wang (1):
virtio-net: only delete bh that existed

Markus Armbruster (2):
tests: Fix schema parser test for in-tree build
tests: Update .gitignore for test-int128 and test-bitops

Matthew Daley (1):
xen_disk: mark ioreq as mapped before unmapping in error case

Max Filippov (1):
exec: fix breakpoint_invalidate when pc may not be translated

Max Reitz (1):
qcow2: count_contiguous_clusters and compression

Mike Frysinger (1):
configure: detect endian via compile test

Paolo Bonzini (1):
monitor: eliminate monitor_event_state_lock

Peter Lieven (1):
qcow2: fix possible corruption when reading multiple clusters

Peter Maydell (1):
configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0

Richard Henderson (1):
Adjust qapi-visit for python-2.4.3

Stefan Hajnoczi (1):
qdev-monitor: Unref device when device_add fails

Stefan Weil (5):
tci: Add implementation of rotl_i64, rotr_i64
bitops: Add rotate functions (rol8, ror8, ...)
misc: Use new rotate functions
qemu-char: Fix potential out of bounds access to local arrays
linux-user: Fix stat64 syscall for SPARC64

Vlad Yasevich (1):
qom: Fix memory leak in object_property_set_link()

Wenchao Xia (2):
qapi: fix memleak by adding implict struct functions in dealloc visitor
tests: fix memleak in error path test for input visitor

 audio/audio.c                  |    3 +-
 backends/rng-egd.c             |    4 +-
 block/qcow2-cluster.c          |    7 +++-
 block/vmdk.c                   |    7 +++-
 configure                      |   45 +++++++++------------
 exec.c                         |    6 ++-
 hw/block/xen_disk.c            |    1 +
 hw/misc/vfio.c                 |    7 ++++
 hw/net/virtio-net.c            |   10 ++---
 hw/pci-host/piix.c             |    9 ++++-
 hw/pci-host/q35.c              |   10 ++++-
 hw/pci/pci.c                   |    8 ++++
 include/hw/i386/pc.h           |    8 ++++
 include/hw/pci-host/q35.h      |    1 +
 include/qemu/bitops.h          |   80 +++++++++++++++++++++++++++++++++++++
 include/sysemu/char.h          |    1 +
 linux-user/syscall.c           |    6 +--
 linux-user/syscall_defs.h      |   14 +++++++
 memory.c                       |    4 +-
 monitor.c                      |    6 ---
 qapi/qapi-dealloc-visitor.c    |   20 ++++++++++
 qdev-monitor.c                 |    8 ++++
 qemu-char.c                    |   86 +++++++++++++++-------------------------
 qom/object.c                   |    5 ++-
 scripts/qapi-visit.py          |   17 ++++++--
Quoted 11 lines
 target-arm/iwmmxt_helper.c     |    2 +-
 tcg/optimize.c                 |   12 ++----
 tcg/tci/tcg-target.c           |    1 -
 tci.c                          |   14 +++++--
 tests/.gitignore               |    3 ++
 tests/Makefile                 |    8 ++--
 tests/test-qmp-input-visitor.c |    1 +
 32 files changed, 287 insertions(+), 127 deletions(-)

This one is not yet here, but it's close:

http://permalink.gmane.org/gmane.comp.emulators.qemu/244329

It would also be nice to have the first 12 patches of
http://permalink.gmane.org/gmane.comp.emulators.qemu/244052, but perhaps it's better to wait for 1.7.1.

Paolo