aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-04-06target/arm: Don't corrupt insn_start arguments on 32-bit hostsicount-debugPeter Maydell
For the Arm target, we have a 3-operand tcg_insn_start, where the 3 arguments are the PC, condexec bits, and a syndrome value. We set it up like this: tcg_gen_insn_start(dc->pc, (dc->condexec_cond << 4) | (dc->condexec_mask >> 1), 0); dc->insn_start = tcg_last_op(); and then we patch in the 3rd operand later in disas_set_insn_syndrome(): tcg_set_insn_param(s->insn_start, 2, syn); Unfortunately, if we're running on a setup where TARGET_LONG_BITS > TCG_TARGET_REG_BITS (ie 64 bit guest on 32 bit host), tcg_gen_insn_start() has under the hood split the 3 operands we gave it into 6, and so we end up patching a syndrome value into the condexec bits. This means we'll end up with corrupted guest condexec state if we have to do a cpu_restore_state(), which happens often when using icount and occasionally for load/store instructions that fault. Fix the bug by using the correct operand offset for the 64-on-32 case. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-06cpus.c: ensure running CPU recalculates icount deadlines on timer expiryPeter Maydell
When we run in TCG icount mode, we calculate the number of instructions to execute using tcg_get_icount_limit(), which ensures that we stop execution at the next timer deadline. However there is a bug where currently we do not recalculate that limit if the guest reprograms a timer so that the next deadline moves closer, and so we will continue execution until the original limit and fire the timer later than we should. Fix this bug in qemu_timer_notify_cb(): if we are currently running a VCPU in icount mode, we simply need to kick it out of the main loop and back to tcg_cpu_exec(), where it will recalculate the icount limit. If we are not currently running a VCPU, then we retain the existing logic for waking up a halted CPU. Cc: qemu-stable@nongnu.org Fixes: https://bugs.launchpad.net/qemu/+bug/1754038 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-05target/arm: Report unsupported MPU region sizes more clearlyPeter Maydell
Currently our PMSAv7 and ARMv7M MPU implementation cannot handle MPU region sizes smaller than our TARGET_PAGE_SIZE. However we report that in a slightly confusing way: DRSR[3]: No support for MPU (sub)region alignment of 9 bits. Minimum is 10 The problem is not the alignment of the region, but its size; tweak the error message to say so: DRSR[3]: No support for MPU (sub)region size of 512 bytes. Minimum is 1024. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-04Update version for v2.12.0-rc2 releasePeter Maydell
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-04Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into stagingPeter Maydell
# gpg: Signature made Wed 04 Apr 2018 17:07:57 BST # gpg: using RSA key BDBE7B27C0DE3057 # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>" # gpg: aka "Jeffrey Cody <jeff@codyprime.org>" # gpg: aka "Jeffrey Cody <codyprime@gmail.com>" # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98 D624 BDBE 7B27 C0DE 3057 * remotes/cody/tags/block-pull-request: block/rbd: remove processed options from qdict Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-04block/rbd: remove processed options from qdictJeff Cody
Commit 4bfb274 added some QAPIfication of option parsing in qemu_rbd_open(). We need to remove all the options we processed, otherwise in bdrv_open_inherit() we will think the remaining options are invalid. (This needs to go in 2.12 to avoid a regression that prevents rbd from being opened.) Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
2018-04-04tcg: fix 16-byte vector operations detectionLaurent Vivier
configure tries to detect if the compiler supports 16-byte vector operations. As stated in the comment of the detection program, there is a problem with the system compiler on GCC on Centos 7. This program doesn't actually detect the problem with GCC on RHEL7 on PPC64LE (Red Hat 4.8.5-28). This patch updates the test to look more like it is in QEMU helpers, and now detects the problem. The error reported is: CC ppc64-softmmu/accel/tcg/tcg-runtime-gvec.o ..//accel/tcg/tcg-runtime-gvec.c: In function ‘helper_gvec_shl8i’: ../accel/tcg/tcg-runtime-gvec.c:558:26: internal compiler error: in emit_move_insn, at expr.c:3495 *(vec8 *)(d + i) = *(vec8 *)(a + i) << shift; ^ Fixes: db43267 "tcg: Add generic vector expanders" Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com> Message-id: 20180328133152.24623-1-lvivier@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-04Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell
Block layer patches # gpg: Signature made Tue 03 Apr 2018 16:48:53 BST # gpg: using RSA key 7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: iotests: Test abnormally large size in compressed cluster descriptor qemu-iotests: Use ppc64 qemu_arch on ppc64le host iotests: Test preallocated truncate of 2G image block/file-posix: Fix fully preallocated truncate iotests: fix 208 for luks format iotests: Update 186 after commit ac64273c66ab136c44043259162 iotests: Update 051 and 186 after commit 1454509726719e0933c block: handle invalid lseek returns gracefully gluster: Fix blockdev-add with server.N.type=unix Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-04Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into stagingPeter Maydell
# gpg: Signature made Tue 03 Apr 2018 17:10:22 BST # gpg: using RSA key BDBE7B27C0DE3057 # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>" # gpg: aka "Jeffrey Cody <jeff@codyprime.org>" # gpg: aka "Jeffrey Cody <codyprime@gmail.com>" # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98 D624 BDBE 7B27 C0DE 3057 * remotes/cody/tags/block-pull-request: gluster: Fix blockdev-add with server.N.type=unix blockjob: use qapi enum helpers blockjob: leak fix, remove from txn when failing early Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-04Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' ↵Peter Maydell
into staging Fix memory leaks when using object_property_get_str() # gpg: Signature made Tue 03 Apr 2018 15:00:10 BST # gpg: using RSA key 2807936F984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/x86-next-pull-request: sev/i386: fix memory leak in sev_guest_init() exec: fix memory leak in find_max_supported_pagesize() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-04Merge remote-tracking branch ↵Peter Maydell
'remotes/vivier2/tags/linux-user-for-2.12-pull-request' into staging # gpg: Signature made Tue 03 Apr 2018 11:33:31 BST # gpg: using RSA key F30C38BD3F2FBE3C # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" # gpg: aka "Laurent Vivier <laurent@vivier.eu>" # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/linux-user-for-2.12-pull-request: linux-user: fix TARGET___O_TMPFILE for sparc linux-user: define TARGET_ARCH_HAS_KA_RESTORER linux-user: fix alpha signal emulation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-03Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180403' into stagingPeter Maydell
- fix a memory leak in the ipl code introduced with this release - increase timeout in the bios to avoid hangs during migration (and rebuild bios to activate the change) # gpg: Signature made Tue 03 Apr 2018 09:28:30 BST # gpg: using RSA key DECF6B93C6F02FAF # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" # gpg: aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" # gpg: aka "Cornelia Huck <cohuck@kernel.org>" # gpg: aka "Cornelia Huck <cohuck@redhat.com>" # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF * remotes/cohuck/tags/s390x-20180403: pc-bios/s390-ccw: update image pc-bios/s390-ccw: Increase virtio timeout to 30 seconds hw/s390x: fix memory leak in s390_init_ipl_dev() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-03Merge remote-tracking branch 'remotes/xtensa/tags/20180402-xtensa' into stagingPeter Maydell
xtensa-specific fixes for linux-user: - fix flushing registers for signal processing in call8 and call12 frames; - fix PC value for restarted syscalls; - fix sysv IPC structures; - fix fadvise64 syscall; generic fixes for linux-user: - fix QEMU assertion in multithreaded application by calling cpu_copy under clone_lock; - fix mq_getsetattr implementation; - fix error propagation in clock_gettime; - implement clock_settime. # gpg: Signature made Mon 02 Apr 2018 18:07:08 BST # gpg: using RSA key 51F9CC91F83FA044 # gpg: Good signature from "Max Filippov <filippov@cadence.com>" # gpg: aka "Max Filippov <max.filippov@cogentembedded.com>" # gpg: aka "Max Filippov <jcmvbkbc@gmail.com>" # Primary key fingerprint: 2B67 854B 98E5 327D CDEB 17D8 51F9 CC91 F83F A044 * remotes/xtensa/tags/20180402-xtensa: target/xtensa: linux-user: fix fadvise64 call linux-user: implement clock_settime linux-user: fix error propagation in clock_gettime target/xtensa: linux-user: fix sysv IPC structures linux-user: fix mq_getsetattr implementation linux-user: call cpu_copy under clone_lock target/xtensa: linux-user: rewind pc for restarted syscall target/xtensa: fix flush_window_regs Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-03Merge remote-tracking branch 'mreitz/tags/pull-block-2018-04-03' into ↵Kevin Wolf
queue-block A fix for preallocated truncation, a new iotest, and a fix to make the iotests work more comfortably on ppc64 # gpg: Signature made Tue Apr 3 17:40:57 2018 CEST # gpg: using RSA key F407DB0061D5CF40 # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * mreitz/tags/pull-block-2018-04-03: iotests: Test abnormally large size in compressed cluster descriptor qemu-iotests: Use ppc64 qemu_arch on ppc64le host iotests: Test preallocated truncate of 2G image block/file-posix: Fix fully preallocated truncate Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-04-03iotests: Test abnormally large size in compressed cluster descriptorAlberto Garcia
L2 entries for compressed clusters have a field that indicates the number of sectors used to store the data in the image. That's however not the size of the compressed data itself, just the number of sectors where that data is located. The actual data size is usually not a multiple of the sector size, and therefore cannot be represented with this field. The way it works is that QEMU reads all the specified sectors and starts decompressing the data until there's enough to recover the original uncompressed cluster. If there are any bytes left that haven't been decompressed they are simply ignored. One consequence of this is that even if the size field is larger than it needs to be QEMU can handle it just fine: it will read more data from disk but it will ignore the extra bytes. This test creates an image with two compressed clusters that use 5 sectors (2.5 KB) each, increases the size field to the maximum (8192 sectors, or 4 MB) and verifies that the data can be read without problems. This test is important because while the decompressed data takes exactly one cluster, the maximum value allowed in the compressed size field is twice the cluster size. So although QEMU won't produce images with such large values we need to make sure that it can handle them. Another effect of increasing the size field is that it can make it include data from the following host cluster(s). In this case 'qemu-img check' will detect that the refcounts are not correct, and we'll need to rebuild them. Additionally, this patch also tests that decreasing the size corrupts the image since the original data can no longer be recovered. In this case QEMU returns an error when trying to read the compressed data, but 'qemu-img check' doesn't see anything wrong if the refcounts are consistent. One possible task for the future is to make 'qemu-img check' verify the sizes of the compressed clusters, by trying to decompress the data and checking that the size stored in the L2 entry is correct. Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: 20180329120745.11154-1-berto@igalia.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2018-04-03qemu-iotests: Use ppc64 qemu_arch on ppc64le hostLukáš Doktor
The qemu target does not always correspond to the host machine type. For example ppc64le machine target is ppc64. Let's introduce "qemu_arch" variable to store the matching qemu architecture related to the current architecture and use it when auto-detecting the default qemu binary. Signed-off-by: Lukáš Doktor <ldoktor@redhat.com> Message-id: 20180329112053.5399-2-ldoktor@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2018-04-03iotests: Test preallocated truncate of 2G imageMax Reitz
Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20180228131315.30194-3-mreitz@redhat.com Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2018-04-03block/file-posix: Fix fully preallocated truncateMax Reitz
Storing the lseek() result in an int results in it overflowing when the file is at least 2 GB big. Then, we have a 50 % chance of the result being "negative" and thus thinking an error occurred when actually everything went just fine. So we should use the correct type for storing the result: off_t. Reported-by: Daniel P. Berrange <berrange@redhat.com> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1549231 Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20180228131315.30194-2-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2018-04-03iotests: fix 208 for luks formatVladimir Sementsov-Ogievskiy
Support luks images creatins like in 205 Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-04-03Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-04-02' into ↵Peter Maydell
staging nbd patches for 2018-04-02 - Eric Blake: nbd: Fix 32-bit compilation on BLOCK_STATUS - Eric Blake: nbd/client: Correctly handle bad server REP_META_CONTEXT - Eric Blake: nbd: trace meta context negotiation # gpg: Signature made Mon 02 Apr 2018 15:15:01 BST # gpg: using RSA key A7A16B4A2527436A # gpg: Good signature from "Eric Blake <eblake@redhat.com>" # gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" # gpg: aka "[jpeg image of size 6874]" # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A * remotes/ericb/tags/pull-nbd-2018-04-02: nbd: trace meta context negotiation nbd/client: Correctly handle bad server REP_META_CONTEXT nbd: Fix 32-bit compilation on BLOCK_STATUS Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-04-03iotests: Update 186 after commit ac64273c66ab136c44043259162Alberto Garcia
Commit ac64273c66ab136c44 modified the output of iotest 186, changing the QOM path of floppy drives from /machine/unattached/device[17] to /machine/unattached/device[13]. Instead of updating the test output to reflect this change, this patch adds a new filter that hides all QOM paths from the 'Attached to:' line of the 'info block' command. Signed-off-by: Alberto Garcia <berto@igalia.com> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-04-03iotests: Update 051 and 186 after commit 1454509726719e0933cAlberto Garcia
SCSI controllers are no longer created automatically for -drive if=scsi, so this patch updates the tests that relied on that. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Cc: Thomas Huth <thuth@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-04-03gluster: Fix blockdev-add with server.N.type=unixKevin Wolf
The legacy command line interface gets the socket path from an option called 'socket'. QAPI in contract uses SocketAddress, where the corresponding option is called 'path'. Fix the gluster block driver to accept both 'socket' and 'path', with 'path' being the preferred syntax. https://bugzilla.redhat.com/show_bug.cgi?id=1545155 Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-id: 20180403110810.25624-1-kwolf@redhat.com Signed-off-by: Jeff Cody <jcody@redhat.com>
2018-04-03blockjob: use qapi enum helpersMarc-André Lureau
QAPI generator provide #define helpers for looking up enum string. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20180327153011.29569-1-marcandre.lureau@redhat.com Signed-off-by: Jeff Cody <jcody@redhat.com>
2018-04-03blockjob: leak fix, remove from txn when failing earlyMarc-André Lureau
This fixes leaks found by ASAN such as: GTESTER tests/test-blockjob ================================================================= ==31442==ERROR: LeakSanitizer: detected memory leaks Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f88483cba38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38) #1 0x7f8845e1bd77 in g_malloc0 ../glib/gmem.c:129 #2 0x7f8845e1c04b in g_malloc0_n ../glib/gmem.c:360 #3 0x5584d2732498 in block_job_txn_new /home/elmarco/src/qemu/blockjob.c:172 #4 0x5584d2739b28 in block_job_create /home/elmarco/src/qemu/blockjob.c:973 #5 0x5584d270ae31 in mk_job /home/elmarco/src/qemu/tests/test-blockjob.c:34 #6 0x5584d270b1c1 in do_test_id /home/elmarco/src/qemu/tests/test-blockjob.c:57 #7 0x5584d270b65c in test_job_ids /home/elmarco/src/qemu/tests/test-blockjob.c:118 #8 0x7f8845e40b69 in test_case_run ../glib/gtestutils.c:2255 #9 0x7f8845e40f29 in g_test_run_suite_internal ../glib/gtestutils.c:2339 #10 0x7f8845e40fd2 in g_test_run_suite_internal ../glib/gtestutils.c:2351 #11 0x7f8845e411e9 in g_test_run_suite ../glib/gtestutils.c:2426 #12 0x7f8845e3fe72 in g_test_run ../glib/gtestutils.c:1692 #13 0x5584d270d6e2 in main /home/elmarco/src/qemu/tests/test-blockjob.c:377 #14 0x7f8843641f29 in __libc_start_main (/lib64/libc.so.6+0x20f29) Add an assert to make sure that the job doesn't have associated txn before free(). [Jeff Cody: N.B., used updated patch provided by John Snow] Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com>
2018-04-03block: handle invalid lseek returns gracefullyJeff Cody
In commit 223a23c198787328ae75bc65d84edf5fde33c0b6, we implemented a workaround in the gluster driver to handle invalid values returned for SEEK_DATA or SEEK_HOLE. In some instances, these same invalid values can be seen in the posix file handler as well - for example, it has been reported on FUSE gluster mounts. Calling assert() for these invalid values is overly harsh; we can safely return -EIO and allow this case to be treated as a "learned nothing" case (e.g., D4 / H4, as commented in the code). This patch does the same thing that 223a23c198787 did for gluster.c, except in file-posix.c Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-04-03gluster: Fix blockdev-add with server.N.type=unixKevin Wolf
The legacy command line interface gets the socket path from an option called 'socket'. QAPI in contract uses SocketAddress, where the corresponding option is called 'path'. Fix the gluster block driver to accept both 'socket' and 'path', with 'path' being the preferred syntax. https://bugzilla.redhat.com/show_bug.cgi?id=1545155 Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2018-04-03linux-user: fix TARGET___O_TMPFILE for sparcLaurent Vivier
Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20180402102453.9883-3-laurent@vivier.eu>
2018-04-03linux-user: define TARGET_ARCH_HAS_KA_RESTORERLaurent Vivier
Sparc as an extended sigaction structure containing the field ka_restorer used in place of sa_restorer. Define TARGET_ARCH_HAS_KA_RESTORER and use it with sparc. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20180402102453.9883-2-laurent@vivier.eu>
2018-04-03linux-user: fix alpha signal emulationLaurent Vivier
setup_frame() doesn't set correctly the address of the trampoline code. The offset of retcode array must be added to the stack frame address. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20180401204653.14211-1-laurent@vivier.eu>
2018-04-03pc-bios/s390-ccw: update imageCornelia Huck
Contains the following commits: - pc-bios/s390-ccw: Move string arrays from bootmap header to .c file - pc-bios/s390-ccw: Increase virtio timeout to 30 seconds Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-04-03pc-bios/s390-ccw: Increase virtio timeout to 30 secondsThomas Huth
The current timeout is set to only three seconds - and considering that vring_wait_reply() or rather get_second() is not doing any rounding, the real timeout is likely rather 2 seconds in most cases. When the host is really badly loaded, it's possible that we hit this timeout by mistake; it's even more likely if we run the guest in TCG mode instead of KVM. So let's increase the timeout to 30 seconds instead to ease this situation (30 seconds is also the timeout that is used by the Linux SCSI subsystem for example, so this seems to be a sane value for block IO timeout). Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1549079 Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1522316251-16399-1-git-send-email-thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> [CH: tweaked commit message] Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-04-03hw/s390x: fix memory leak in s390_init_ipl_dev()Greg Kurz
The string returned by object_property_get_str() is dynamically allocated. Fixes: 3c4e9baacf4d9 Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <152231460685.69730.14860451936216690693.stgit@bahia.lan> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-04-02sev/i386: fix memory leak in sev_guest_init()Greg Kurz
The string returned by object_property_get_str() is dynamically allocated. Fixes: d8575c6c0242b Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <152231462116.69730.14119625999092384450.stgit@bahia.lan> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2018-04-02exec: fix memory leak in find_max_supported_pagesize()Greg Kurz
The string returned by object_property_get_str() is dynamically allocated. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <152231458624.69730.1752893648612848392.stgit@bahia.lan> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2018-04-02nbd: trace meta context negotiationEric Blake
Having a more detailed log of the interaction between client and server is invaluable in debugging how meta context negotiation actually works. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20180330130950.1931229-1-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
2018-04-02nbd/client: Correctly handle bad server REP_META_CONTEXTEric Blake
It's never a good idea to blindly read for size bytes as returned by the server without first validating that the size is within bounds; a malicious or buggy server could cause us to hang or get out of sync from reading further messages. It may be smarter to try and teach the client to cope with unexpected context ids by silently ignoring them instead of hanging up on the server, but for now, if the server doesn't reply with exactly the one context we expect, it's easier to just give up - however, if we give up for any reason other than an I/O failure, we might as well try to politely tell the server we are quitting rather than continuing. Fix some typos in the process. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20180329231837.1914680-1-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
2018-04-02nbd: Fix 32-bit compilation on BLOCK_STATUSEric Blake
iotests 123 and 209 fail on 32-bit platforms. The culprit: sizeof(extent) is wrong; we want sizeof(*extent). But since the struct is 8 bytes, it happened to work on 64-bit platforms where the pointer is also 8 bytes (nasty). Fixes: 78a33ab58 Reported-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20180327210517.1804242-1-eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
2018-04-02target/xtensa: linux-user: fix fadvise64 callMax Filippov
fadvise64_64 on xtensa passes advice as the second argument and so must be handled similar to PPC. This fixes glibc testsuite tests posix/tst-posix_fadvise and posix/tst-posix_fadvise64. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-04-01linux-user: implement clock_settimeMax Filippov
This fixes glibc testsuite test rt/tst-clock2. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-04-01linux-user: fix error propagation in clock_gettimeMax Filippov
host_to_target_timespec may return error if target address could not be locked, but it is ignored. Propagate return value of host_to_target_timespec to the caller of clock_gettime. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-04-01target/xtensa: linux-user: fix sysv IPC structuresMax Filippov
- make target_ipc_perm fields match kernel definitions for xtensa; - add target_semid64_ds with proper order of times and reserved fields for little/big endian specific for xtensa; - add missing reserved fields after time fields to the target_shmid_ds; - fix types of shm_cpid, shm_lpid and shm_nattch fields of target_shmid_ds to match kernel definitions for xtensa. These changes fix guest ipcs output and fix glibc testsuite tests sysvipc/test-sysvsem and sysvipc/test-sysvshm. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-03-31linux-user: fix mq_getsetattr implementationMax Filippov
mq_getsetattr implementation does not set errno correctly in case of error. Also in the presence of both 2nd and 3rd arguments it calls both mq_getattr and mq_setattr, whereas only the latter call would suffice. Don't call mq_getattr in the presence of the 2nd argument. Don't copy output back to user in case of error. Use get_errno to set errno value. This fixes test rt/tst-mqueue2 from the glibc testsuite. Cc: Lionel Landwerlin <lionel.landwerlin@openwide.fr> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-03-31linux-user: call cpu_copy under clone_lockMax Filippov
cpu_copy adds newly created CPU object to container/machine/unattached, but does it w/o proper locking. As a result when multiple threads create threads rapidly QEMU may abort with the following message: GLib-CRITICAL **: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed ERROR:qemu/qom/object.c:1663:object_get_canonical_path_component: code should not be reached E.g. this issue is observed when running glibc test nptl/tst-eintr1. Move cpu_copy invocation under clone_lock to fix that. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-03-31target/xtensa: linux-user: rewind pc for restarted syscallMax Filippov
In case of syscall restart request set pc back to the syscall instruction. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-03-31target/xtensa: fix flush_window_regsMax Filippov
flush_window_regs uses wrong stack frame to save overflow registers in call8 and call12 frames, which results in wrong register values in callers of a function that received a signal. Reimplement flush_window_regs closely following window overflow sequence. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-03-31Merge remote-tracking branch ↵Peter Maydell
'remotes/riscv/tags/riscv-qemu-2.12-critical-fixes' into staging RISC-V: Critical fixes for QEMU 2.12 This series includes changes that are considered release critical, such as floating point register file corruption under SMP Linux due to incorrect handling of mstatus.FS. This workaround will be replaced with a more comprehensive fix for mstatus.FS handling in QEMU 2.13. # gpg: Signature made Thu 29 Mar 2018 18:22:42 BST # gpg: using DSA key 6BF1D7B357EF3E4F # gpg: Good signature from "Michael Clark <michaeljclark@mac.com>" # gpg: aka "Michael Clark <mjc@sifive.com>" # gpg: aka "Michael Clark <michael@metaparadigm.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 7C99 930E B17C D8BA 073D 5EFA 6BF1 D7B3 57EF 3E4F * remotes/riscv/tags/riscv-qemu-2.12-critical-fixes: RISC-V: Workaround for critical mstatus.FS bug Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-03-31Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into ↵Peter Maydell
staging # gpg: Signature made Fri 30 Mar 2018 04:49:42 BST # gpg: using RSA key EF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * remotes/jasowang/tags/net-pull-request: qemu-doc: Rework the network options chapter to make "-net" less prominent Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-03-30Merge remote-tracking branch ↵Peter Maydell
'remotes/stefanberger/tags/pull-tpm-2018-03-29-1' into staging Merge tpm 2018/03/29 v1 # gpg: Signature made Fri 30 Mar 2018 01:04:47 BST # gpg: using RSA key 75AD65802A0B4211 # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211 * remotes/stefanberger/tags/pull-tpm-2018-03-29-1: tests: Tests more flags of the CRB interface tpm: CRB: Enforce locality is requested before processing buffer tpm: CRB: Reset Granted flag when relinquishing locality tpm: CRB: set the Idle flag by default Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-03-30Merge remote-tracking branch ↵Peter Maydell
'remotes/dgilbert/tags/pull-migration-20180329a' into staging Migration pull (small fixes) A pair of two small fixes for 2.12. # gpg: Signature made Thu 29 Mar 2018 14:55:17 BST # gpg: using RSA key 0516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20180329a: migration: Don't activate block devices if using -S migration: fix pfd leak Signed-off-by: Peter Maydell <peter.maydell@linaro.org>