summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-08-08Update version for v2.10.0-rc2 releasev2.10.0-rc2Peter Maydell1-1/+1
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-08Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell16-37/+84
* --help/--version improvements (Eric) * GCC 7 workaround (Greg) * Small SCSI fix (Hannes) * SSE 4.1 fix (Joseph) * RCU deadlock fix (myself) # gpg: Signature made Tue 08 Aug 2017 16:28:56 BST # gpg: using RSA key 0xBFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: maint: Include bug-reporting info in --help output qga: Give more --version information qemu-io: Give more --version information qemu-img: Sort sub-command names in --help target/i386: set rip_offset for some SSE4.1 instructions scsi: clarify sense codes for LUN0 emulation kvm: workaround build break on gcc-7.1.1 / fedora26 Revert "rcu: do not create thread in pthread_atfork callback" rcu: completely disable pthread_atfork callbacks as soon as possible Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-08maint: Include bug-reporting info in --help outputEric Blake8-7/+19
These days, many programs are including a bug-reporting address, or better yet, a link to the project web site, at the tail of their --help output. However, we were not very consistent at doing so: only qemu-nbd and qemu-qa mentioned anything, with the latter pointing to an individual person instead of the project. Add a new #define that sets up a uniform string, mentioning both bug reporting instructions and overall project details, and which a downstream vendor could tweak if they want bugs to go to a downstream database. Then use it in all of our binaries which have --help output. The canned text intentionally references http:// instead of https:// because our https website currently causes certificate errors in some browsers. That can be tweaked later once we have resolved the web site issued. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170803163353.19558-5-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08qga: Give more --version informationEric Blake1-2/+4
Include the package version information (useful for detecting builds from git or downstream backports), and the copyright notice. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <20170803163353.19558-4-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08qemu-io: Give more --version informationEric Blake1-1/+3
Include the package version information (useful for detecting builds from git or downstream backports), and the copyright notice. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20170803163353.19558-3-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08qemu-img: Sort sub-command names in --helpEric Blake1-9/+13
'amend' and 'create' were not listed alphabetically; hoist them earlier. Separate the @end table block to make it easier to copy-and-paste the addition of future sub-commands. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20170803163353.19558-2-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell18-48/+299
Block layer patches for 2.10.0-rc2 # gpg: Signature made Tue 08 Aug 2017 14:56:15 BST # gpg: using RSA key 0x7F09B272C88F2FD6 # 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: block/nfs: fix mutex assertion in nfs_file_close() qemu-iotests: Test reopen between read-only and read-write qemu-io: Allow reopen read-write block: Set BDRV_O_ALLOW_RDWR during rw reopen block: Allow reopen rw without BDRV_O_ALLOW_RDWR block: Fix order in bdrv_replace_child() parallels: drop check that bdrv_truncate() is working parallels: respect error code of bdrv_getlength() in allocate_clusters() block: respect error code from bdrv_getlength in handle_aiocb_write_zeroes vmdk: Fix error handling/reporting of vmdk_check block/null: Remove 'filename' option block: drop bdrv_set_key from BlockDriver block/vhdx: check error return of bdrv_truncate() block/vhdx: check error return of bdrv_flush() block/vhdx: check for offset overflow to bdrv_truncate() block/vhdx: check error return of bdrv_getlength() quorum: Set sectors-count to 0 when reporting a flush error qemu-iotests/109: Fix lock race condition Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-08block/nfs: fix mutex assertion in nfs_file_close()Jeff Cody1-3/+8
Commit c096358e747e88fc7364e40e3c354ee0bb683960 introduced assertion checks for when qemu_mutex() functions are called without the corresponding qemu_mutex_init() having initialized the mutex. This uncovered a latent bug in qemu's nfs driver - in nfs_client_close(), the NFSClient structure is overwritten with zeros, prior to the mutex being destroyed. Go ahead and destroy the mutex in nfs_client_close(), and change where we call qemu_mutex_init() so that it is correctly balanced. There are also a couple of memory leaks obscured by the memset, so this fixes those as well. Finally, we should be able to get rid of the memset(), as it isn't necessary. Cc: qemu-stable@nongnu.org Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Peter Lieven <pl@kamp.de> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08qemu-iotests: Test reopen between read-only and read-writeKevin Wolf3-0/+88
This serves as a regression test for the bugs that were just fixed for bdrv_reopen() between read-only and read-write mode. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2017-08-08qemu-io: Allow reopen read-writeKevin Wolf1-2/+17
This allows qemu-iotests to test the switch between read-only and read-write mode for block devices. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2017-08-08block: Set BDRV_O_ALLOW_RDWR during rw reopenKevin Wolf1-1/+4
Reopening an image should be consistent with opening it, so we should set BDRV_O_ALLOW_RDWR for any image that is reopened read-write like in bdrv_open_inherit(). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2017-08-08block: Allow reopen rw without BDRV_O_ALLOW_RDWRKevin Wolf2-5/+9
BDRV_O_ALLOW_RDWR is a flag that tells whether qemu can internally reopen a node read-write temporarily because the user requested read-write for the top-level image, but qemu decided that read-only is enough for this node (a backing file). bdrv_reopen() is different, it is also used for cases where the user changed their mind and wants to update the options. There is no reason to forbid making a node read-write in that case. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2017-08-08block: Fix order in bdrv_replace_child()Kevin Wolf1-2/+2
Commit 8ee03995 refactored the code incorrectly and broke the release of permissions on the old BDS. Instead of changing the permissions to the new required values after removing the old BDS from the list of children, it only re-obtains the permissions it already had. Change the order of operations so that the old BDS is removed again before calculating the new required permissions. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2017-08-08parallels: drop check that bdrv_truncate() is workingDenis V. Lunev1-3/+1
This would be actually strange and error prone. If truncate() nowadays will fail, there is something fatally wrong. Let's check for that during the actual work. The only fallback case is when the file is not zero initialized. In this case we should switch to preallocation via fallocate(). Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Markus Armbruster <armbru@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Max Reitz <mreitz@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08parallels: respect error code of bdrv_getlength() in allocate_clusters()Denis V. Lunev1-2/+6
If we can not get the file length, the state of BDS is broken completely. Return error to the caller. Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Markus Armbruster <armbru@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Max Reitz <mreitz@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-08-08block: respect error code from bdrv_getlength in handle_aiocb_write_zeroesDenis V. Lunev1-1/+7
Original idea beyond the code in question was the following: we have failed to write zeroes with fallocate(FALLOC_FL_ZERO_RANGE) as the simplest approach and via fallocate(FALLOC_FL_PUNCH_HOLE)/fallocate(0). We have the only chance now: if the request comes beyond end of the file. Thus we should calculate file length and respect the error code from that op. Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Markus Armbruster <armbru@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Max Reitz <mreitz@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-08-08vmdk: Fix error handling/reporting of vmdk_checkFam Zheng1-8/+18
Errors from the callees must be captured and propagated to our caller, ensure this for both find_extent() and bdrv_getlength(). Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08block/null: Remove 'filename' optionKevin Wolf2-6/+27
This option was only added to allow 'null-co://' and 'null-aio://' as filenames, its value never served any actual purpose and was ignored. Nevertheless it was accepted as '-drive driver=null,filename=foo'. The correct way to enable the protocol prefixes (and that without adding a useless -drive option) is implementing .bdrv_parse_filename. This is what this patch does. Technically, this is an incompatible change, but the null block driver is only used for benchmarking, testing and debugging, and an option without effect isn't likely to be used by anyone anyway, so no bad effects are to be expected. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-08-08block: drop bdrv_set_key from BlockDriverPaolo Bonzini1-1/+0
This is not used anymore since c01c214b69 ("block: remove all encryption handling APIs", 2017-07-11). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08block/vhdx: check error return of bdrv_truncate()Jeff Cody1-1/+5
Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08block/vhdx: check error return of bdrv_flush()Jeff Cody1-3/+14
Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08block/vhdx: check for offset overflow to bdrv_truncate()Jeff Cody2-1/+8
VHDX uses uint64_t types for most offsets, following the VHDX spec. However, bdrv_truncate() takes an int64_t value for the truncating offset. Check for overflow before calling bdrv_truncate(). While we are here, replace the bit shifting with QEMU_ALIGN_UP as well. N.B.: For a compliant image this is not an issue, as the maximum VHDX image size is defined per the spec to be 64TB. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08block/vhdx: check error return of bdrv_getlength()Jeff Cody2-6/+26
Calls to bdrv_getlength() were not checking for error. In vhdx.c, this can lead to truncating an image file, so it is a definite bug. In vhdx-log.c, the path for improper behavior is less clear, but it is best to check in any case. Some minor code movement of the log_guid intialization, as well. Reported-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08quorum: Set sectors-count to 0 when reporting a flush errorAlberto Garcia1-2/+1
The QUORUM_REPORT_BAD event has fields to report the sector in which the error was detected and the number of affected sectors starting from that one. This is important for read and write errors, but not for flush errors. For flush errors the current code reports the total size of the disk image. That is however not useful information in this case. Moreover, the bdrv_getlength() call can fail, and there's no good way of handling that failure. Since we're reporting useless information and we cannot even guarantee to do it in a consistent way, this patch changes the code to report 0 instead in all cases. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08qemu-iotests/109: Fix lock race conditionCleber Rosa2-1/+58
A race condition is currently present between the clean up attempt of the QEMU process and the execution of qemu-img. The actual (bad) output is: -Warning: Image size mismatch! -Images are identical. +qemu-img: Could not open '<build_dir>/tests/qemu-iotests/scratch/t.raw': Failed to get "consistent read" lock +Is another process using the image? A KILL signal is sent to the QEMU process, but qemu-img may begin to run before the QEMU process is really gone. qemu-img will then attempt to open the TEST_IMG file before it can secure a lock on it. This attempts a more graceful shutdown, and waits for the QEMU process to exit. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-08-08Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell3-2/+67
virtio: fix for rc2 It turns out there's a way to setup SHPC on Q35: just put a PCI to PCI bridge behind a DMI to PCI one. Our _OSC is thus incorrect. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 07 Aug 2017 22:39:20 BST # gpg: using RSA key 0x281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: cpu: add APIs to allocate/free CPU environment hw/i386: allow SHPC for Q35 machine Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-08target/i386: set rip_offset for some SSE4.1 instructionsJoseph Myers1-0/+1
When emulating various SSE4.1 instructions such as pinsrd, the address of a memory operand is computed without allowing for the 8-bit immediate operand located after the memory operand, meaning that the memory operand uses the wrong address in the case where it is rip-relative. This patch adds the required rip_offset setting for those instructions, so fixing some GCC test failures (13 in the gcc testsuite in my GCC 6-based testing) when testing with a default CPU setting enabling those instructions. Signed-off-by: Joseph Myers <joseph@codesourcery.com> Message-Id: <alpine.DEB.2.20.1708080041391.28702@digraph.polyomino.org.uk> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08scsi: clarify sense codes for LUN0 emulationHannes Reinecke1-1/+6
The LUN0 emulation is just that, an emulation for a non-existing LUN0. So we should be returning LUN_NOT_SUPPORTED for any request coming from any other LUN. And we should be aborting unhandled commands with INVALID OPCODE, not LUN NOT SUPPORTED. Signed-off-by: Hannes Reinecke <hare@suse.com> Message-Id: <1501835795-92331-4-git-send-email-hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08kvm: workaround build break on gcc-7.1.1 / fedora26Greg Kurz1-10/+4
Building QEMU on fedora26 with the latest gcc package fails: CC ppc64-softmmu/target/ppc/kvm.o In file included from include/sysemu/hw_accel.h:16:0, from target/ppc/kvm.c:31: target/ppc/kvm.c: In function ‘kvmppc_booke_watchdog_enable’: include/sysemu/kvm.h:449:35: error: ‘args_tmp[i]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] cap.args[i] = args_tmp[i]; \ ^ target/ppc/kvm.c: In function ‘kvmppc_set_papr’: include/sysemu/kvm.h:449:35: error: ‘args_tmp[i]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] cc1: all warnings being treated as errors $ rpm -q gcc gcc-7.1.1-3.fc26.ppc64le The compiler should obviously optimize this code away when no extra agument is passed to kvm_vm_enable_cap() and kvm_vcpu_enable_cap(), but it doesn't. This bug should be fixed one day in gcc, but we can also change our code pattern so that we don't hit the issue anymore. We workaround this, by using memcpy() instead of open-coding the copy. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <150210580404.1343.7325713896658799315.stgit@bahia.lan> Acked-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08Revert "rcu: do not create thread in pthread_atfork callback"Paolo Bonzini4-7/+7
This reverts commit a59629fcc6f603e19b516dc08f75334e5c480bd0. This is not needed anymore because the IOThread mutex is not "magic" anymore (need not kick the CPU thread)and also because fork callbacks are only enabled at the very beginning of QEMU's execution. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08rcu: completely disable pthread_atfork callbacks as soon as possiblePaolo Bonzini3-0/+27
Because of -daemonize, system mode QEMU sometimes needs to fork() and keep RCU enabled in the child. However, there is a possible deadlock with synchronize_rcu: - the CPU thread is inside a RCU critical section and wants to take the BQL in order to do MMIO - the monitor thread, which is owning the BQL, calls rcu_init_lock which tries to take the rcu_sync_lock - the call_rcu thread has taken rcu_sync_lock in synchronize_rcu, but synchronize_rcu needs the CPU thread to end the critical section before returning. This cannot happen for user-mode emulation, because it does not have a BQL. To fix it, assume that system mode QEMU only forks in preparation for exec (except when daemonizing) and disable pthread_atfork as soon as the double fork has happened. Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Tested-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-08-08cpu: add APIs to allocate/free CPU environmentMichael S. Tsirkin2-0/+65
These will be implemented and then used by follow-up patches. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-08-08hw/i386: allow SHPC for Q35 machineAleksandr Bezzubikov1-2/+2
Unmask previously masked SHPC feature in _OSC method. Signed-off-by: Aleksandr Bezzubikov <zuban32s@gmail.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-08-07hw/arm/virt: Add 2.10 machine typeEric Auger1-2/+17
Add virt-2.10 machine type. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Message-id: 1502106581-11714-1-git-send-email-eric.auger@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-07Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell2-6/+6
into staging # gpg: Signature made Mon 07 Aug 2017 12:03:54 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: block: move trace probes into bdrv_co_preadv|pwritev Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-07block: move trace probes into bdrv_co_preadv|pwritevDaniel P. Berrange2-6/+6
There are trace probes in bdrv_co_readv|writev, however, the block drivers are being gradually moved over to using the bdrv_co_preadv|pwritev functions instead. As a result some block drivers miss the current probes. Move the probes into bdrv_co_preadv|pwritev instead, so that they are triggered by more (all?) I/O code paths. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170804105036.11879-1-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-08-04Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20170803' into stagingPeter Maydell3-2/+6
Queued misc tcg patches # gpg: Signature made Thu 03 Aug 2017 19:07:18 BST # gpg: using RSA key 0xAD1270CC4DD0279B # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>" # gpg: aka "Richard Henderson <rth@twiddle.net>" # Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC 16A4 AD12 70CC 4DD0 279B * remotes/rth/tags/pull-tcg-20170803: tcg: Increase minimum alignment from tcg_malloc to 8 target/s390x: Fix CSST for 16-byte store tcg/arm: Fix runtime overalignment test Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-04Merge remote-tracking branch 'remotes/ehabkost/tags/machine-pull-request' ↵Peter Maydell1-0/+5
into staging cpu: crash fix (don't allow negative core id) # gpg: Signature made Thu 03 Aug 2017 18:57:41 BST # gpg: using RSA key 0x2807936F984DC5A6 # 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/machine-pull-request: cpu: don't allow negative core id Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-04Merge remote-tracking branch 'remotes/yongbok/tags/mips-20170803' into stagingPeter Maydell6-56/+89
MIPS patches 2017-08-03 Changes: KVM T&E segment support for TCG malta: leave space for the bootmap after the initrd Apply CP0.PageMask before writing into TLB entry Fix fallout from indirect branch optimisation # gpg: Signature made Thu 03 Aug 2017 15:32:59 BST # gpg: using RSA key 0x2238EB86D5F797C2 # gpg: Good signature from "Yongbok Kim <yongbok.kim@imgtec.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: 8600 4CF5 3415 A5D9 4CFA 2B5C 2238 EB86 D5F7 97C2 * remotes/yongbok/tags/mips-20170803: target/mips: Fix RDHWR CC with icount target/mips: Drop redundant gen_io_start/stop() target/mips: Use BS_EXCP where interrupts are expected target-mips: apply CP0.PageMask before writing into TLB entry mips: Add KVM T&E segment support for TCG mips: Improve segment defs for KVM T&E guests mips/malta: leave space for the bootmap after the initrd target-mips: Don't stop on [d]mtc0 DESAVE/KScratch Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-04Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell5-9/+33
virtio: fix for rc2 Looks like the constant stream of additions of vhost-user devices is a problem for some people who are concerned about external connections from qemu. A per-device flag seems like an overkill, but a single configure flag seems like a sane way to support that, and it looks like we need to do it before the release. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 03 Aug 2017 13:57:57 BST # gpg: using RSA key 0x281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: build-sys: add --disable-vhost-user Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-04Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into ↵Peter Maydell2-40/+97
staging slirp updates # gpg: Signature made Wed 02 Aug 2017 23:27:41 BST # gpg: using RSA key 0x9E511E01C737F075 # gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" # gpg: aka "Samuel Thibault <sthibault@debian.org>" # gpg: aka "Samuel Thibault <samuel.thibault@gnu.org>" # gpg: aka "Samuel Thibault <samuel.thibault@inria.fr>" # gpg: aka "Samuel Thibault <samuel.thibault@labri.fr>" # gpg: aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" # gpg: aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" # 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: 900C B024 B679 31D4 0F82 304B D017 8C76 7D06 9EE6 # Subkey fingerprint: 9A37 3D36 64A8 DC62 DA0A 34FD 9E51 1E01 C737 F075 * remotes/thibault/tags/samuel-thibault: slirp: check len against dhcp options array end slirp: fill error when failing to initialize user network Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-08-03tcg: Increase minimum alignment from tcg_malloc to 8Richard Henderson1-1/+4
For a 64-bit ILP32 host, aligning to sizeof(long) is not enough. Guess the minimum for any host is 8, as that covers uint64_t. Qemu doesn't use a host long double or host vectors, except in extremely limited circumstances. Fixes a bus error for a sparc v8plus host. Signed-off-by: Richard Henderson <rth@twiddle.net>
2017-08-03target/s390x: Fix CSST for 16-byte storeRichard Henderson1-0/+1
Found by Coverity (CID 1378273). Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Richard Henderson <rth@twiddle.net>
2017-08-03tcg/arm: Fix runtime overalignment testRichard Henderson1-1/+1
Patch 85aa80813dd changed the IF emitting the TST instruction, but failed to change the ?: converting CMP to CMPEQ, so the result of the TST is ignored. Signed-off-by: Richard Henderson <rth@twiddle.net>
2017-08-03build-sys: add --disable-vhost-userMarc-André Lureau5-9/+33
Learn to compile out vhost-user (net, scsi & upcoming users). Keep it enabled by default on non-win32, that is assumed to be POSIX. Fail if trying to enable it on win32. When trying to make a vhost-user netdev, it gives the following error: -netdev vhost-user,id=foo,chardev=chr-test: Parameter 'type' expects a netdev backend type And similar error with the HMP/QMP monitors. While at it, rename CONFIG_VHOST_NET_TEST CONFIG_VHOST_USER_NET_TEST since it's a vhost-user specific variable. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-08-03slirp: check len against dhcp options array endPrasad J Pandit1-0/+3
While parsing dhcp options string in 'dhcp_decode', if an options' length 'len' appeared towards the end of 'bp_vend' array, ensuing read could lead to an OOB memory access issue. Add check to avoid it. This is CVE-2017-11434. Reported-by: Reno Robert <renorobert@gmail.com> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2017-08-03slirp: fill error when failing to initialize user networkHervé Poussineau1-40/+94
With "-netdev user,id=net0,dns=1.2.3.4" error was: qemu-system-i386: -netdev user,id=net0,dns=1.2.3.4: Device 'user' could not be initialized Error is now: qemu-system-i386: -netdev user,id=net0,dns=1.2.3.4: DNS doesn't belong to network Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2017-08-02cpu: don't allow negative core idLaurent Vivier1-0/+5
With pseries machine type a negative core-id is not managed properly: -1 gives an inaccurate error message ("core -1 already populated"), -2 crashes QEMU (core dump) As it seems a negative value is invalid for any architecture, instead of checking this in spapr_core_pre_plug() I think it's better to check this in the generic part, core_prop_set_core_id() Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20170802103259.25940-1-lvivier@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-08-02target/mips: Fix RDHWR CC with icountJames Hogan1-0/+11
RDHWR CC reads the CPU timer like MFC0 CP0_Count, so with icount enabled it must set can_do_io while it calls the helper to avoid the "Bad icount read" error. It should also break out of the translation loop to ensure that timer interrupts are immediately handled. Fixes: 2e70f6efa8b9 ("Add instruction counter.") Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Yongbok Kim <yongbok.kim@imgtec.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
2017-08-02target/mips: Drop redundant gen_io_start/stop()James Hogan1-8/+0
DMTC0 CP0_Cause does a redundant gen_io_start() and gen_io_end() pair, even though this is done for all DMTC0 operations outside of the switch statement. Remove these redundant calls. Fixes: 5dc5d9f055c5 ("mips: more fixes to the MIPS interrupt glue logic") Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Yongbok Kim <yongbok.kim@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>