aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-09-03i386/vmmouse: Properly reset stateJan Kiszka1-0/+1
nb_queue was not zeroed so that we no longer delivered events if a previous guest left the device in an overflow state. The state of absolute does not matter as the next vmmouse_update_handler call will align it again. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Message-Id: <f056c7e5-fa74-469c-87f8-0f0925301b2d@web.de> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03hostmem-file: fix pmem file size checkStefan Hajnoczi1-2/+2
Commit 314aec4a6e06844937f1677f6cba21981005f389 ("hostmem-file: reject invalid pmem file sizes") added a file size check that verifies the hostmem object's size parameter against the actual devdax pmem file. This is useful because getting the size wrong results in confusing errors inside the guest. However, the code doesn't work properly for files where struct stat::st_size is zero. Hostmem-file's ->alloc() function returns early without setting an Error, causing the following assertion failure: qemu/memory.c:2215: memory_region_get_ram_ptr: Assertion `mr->ram_block' failed. This patch handles the case where qemu_get_pmem_size() returns 0 but there is no error. Fixes: 314aec4a6e06844937f1677f6cba21981005f389 Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20190823135632.25010-1-stefanha@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03qapi: report the default CPU type for each machineDaniel P. Berrangé2-1/+8
When user doesn't request any explicit CPU model with libvirt or QEMU, a machine type specific CPU model is picked. Currently there is no way to determine what this QEMU built-in default is, so libvirt cannot report this back to the user in the XML config. This extends the "query-machines" QMP command so that it reports the default CPU model typename for each machine. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20190822100412.23746-1-berrange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03pc: Don't make die-id mandatory unless necessaryEduardo Habkost2-0/+43
We have this issue reported when using libvirt to hotplug CPUs: https://bugzilla.redhat.com/show_bug.cgi?id=1741451 Basically, libvirt is not copying die-id from query-hotpluggable-cpus, but die-id is now mandatory. We could blame libvirt and say it is not following the documented interface, because we have this buried in the QAPI schema documentation: > Note: currently there are 5 properties that could be present > but management should be prepared to pass through other > properties with device_add command to allow for future > interface extension. This also requires the filed names to be kept in > sync with the properties passed to -device/device_add. But I don't think this would be reasonable from us. We can just make QEMU more flexible and let die-id to be omitted when there's no ambiguity. This will allow us to keep compatibility with existing libvirt versions. Test case included to ensure we don't break this again. Fixes: commit 176d2cda0dee ("i386/cpu: Consolidate die-id validity in smp context") Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190816170750.23910-1-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03pc: Improve error message when die-id is omittedEduardo Habkost1-0/+4
The error message when die-id is omitted doesn't make sense: $ qemu-system-x86_64 -smp 1,sockets=6,maxcpus=6 \ -device qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0 qemu-system-x86_64: -device qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0: \ Invalid CPU die-id: 4294967295 must be in range 0:0 Fix it, so it will now read: qemu-system-x86_64: -device qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0: \ CPU die-id is not set Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190815183803.13346-3-ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Vanderson M. do Rosario <vandersonmr2@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03pc: Fix error message on die-id validationEduardo Habkost1-1/+1
The error message for die-id range validation is incorrect. Example: $ qemu-system-x86_64 -smp 1,sockets=6,maxcpus=6 \ -device qemu64-x86_64-cpu,socket-id=1,die-id=1,core-id=0,thread-id=0 qemu-system-x86_64: -device qemu64-x86_64-cpu,socket-id=1,die-id=1,core-id=0,thread-id=0: \ Invalid CPU die-id: 1 must be in range 0:5 The actual range for die-id in this example is 0:0. Fix the error message to use smp_dies and print the correct range. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190815183803.13346-2-ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Vanderson M. do Rosario <vandersonmr2@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03numa: move numa global variable numa_info into MachineStateTao Xu11-25/+36
Move existing numa global numa_info (renamed as "nodes") into NumaState. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Tao Xu <tao3.xu@intel.com> Message-Id: <20190809065731.9097-5-tao3.xu@intel.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03numa: move numa global variable have_numa_distance into MachineStateTao Xu6-9/+8
Move existing numa global have_numa_distance into NumaState. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Liu Jingqi <jingqi.liu@intel.com> Suggested-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Tao Xu <tao3.xu@intel.com> Message-Id: <20190809065731.9097-4-tao3.xu@intel.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03numa: move numa global variable nb_numa_nodes into MachineStateTao Xu17-59/+113
Add struct NumaState in MachineState and move existing numa global nb_numa_nodes(renamed as "num_nodes") into NumaState. And add variable numa_support into MachineClass to decide which submachines support NUMA. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Tao Xu <tao3.xu@intel.com> Message-Id: <20190809065731.9097-3-tao3.xu@intel.com> [ehabkost: include hw/boards.h again to fix build failures] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03hw/arm: simplify arm_load_dtbTao Xu30-147/+44
In struct arm_boot_info, kernel_filename, initrd_filename and kernel_cmdline are copied from from MachineState. This patch add MachineState as a parameter into arm_load_dtb() and move the copy chunk of kernel_filename, initrd_filename and kernel_cmdline into arm_load_kernel(). Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Liu Jingqi <jingqi.liu@intel.com> Suggested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Tao Xu <tao3.xu@intel.com> Message-Id: <20190809065731.9097-2-tao3.xu@intel.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Acked-by: Andrew Jeffery <andrew@aj.id.au> Acked-by: Cédric Le Goater <clg@kaod.org> [ehabkost: include hw/boards.h again to fix build failures] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03includes: remove stale [smp|max]_cpus externsAlex Bennée1-2/+0
Commit a5e0b3311 removed these in favour of querying machine properties. Remove the extern declarations as well. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: Like Xu <like.xu@linux.intel.com> Message-Id: <20190711130546.18578-1-alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Like Xu <like.xu@linux.intel.com> Fixes: a5e0b331193a ("vl.c: Replace smp global variables with smp machine properties") Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell1-0/+6
into staging Pull request # gpg: Signature made Tue 27 Aug 2019 21:33:15 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: trace: Clarify DTrace/SystemTap help message Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-03Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell9-309/+568
staging Pull request # gpg: Signature made Tue 27 Aug 2019 21:16:27 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: block/qcow2: implement .bdrv_co_pwritev(_compressed)_part block/qcow2: implement .bdrv_co_preadv_part block/qcow2: refactor qcow2_co_preadv to use buffer-based io block/io: introduce bdrv_co_p{read, write}v_part block/io: bdrv_aligned_pwritev: use and support qiov_offset block/io: bdrv_aligned_preadv: use and support qiov_offset block/io: bdrv_co_do_copy_on_readv: lazy allocation block/io: bdrv_co_do_copy_on_readv: use and support qiov_offset block: define .*_part io handlers in BlockDriver block/io: refactor padding util/iov: improve qemu_iovec_is_zero util/iov: introduce qemu_iovec_init_extended Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-27tests: fix modules-test with no default machineMarc-André Lureau1-1/+3
Fixes: eb062cfa733 ("tests: add module loading test") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20190827140241.20818-2-marcandre.lureau@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-27build-sys: build ui-spice-app as a moduleMarc-André Lureau2-1/+6
This reverts commit 45db1ac157 ("modules-test: ui-spice-app is not built as module") and fixes commit d8aec9d9f1 ("display: add -display spice-app launching a Spice client"). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20190827140241.20818-1-marcandre.lureau@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-27Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190827' into ↵Peter Maydell3-13/+36
staging Xen queue * Fixes for xen-bus and exit cleanup. * Build fix. # gpg: Signature made Tue 27 Aug 2019 14:31:10 BST # gpg: using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF # gpg: issuer "anthony.perard@citrix.com" # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal] # gpg: aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal] # 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: 5379 2F71 024C 600F 778A 7161 D8D5 7199 DF83 42C8 # Subkey fingerprint: F80C 0063 08E2 2CFD 8A92 E798 0CF5 572F D7FB 55AF * remotes/aperard/tags/pull-xen-20190827: xen-bus: Avoid rewriting identical values to xenstore xen-bus: Fix backend state transition on device reset xen: cleanup IOREQ server on exit xen: Fix ring.h header Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-27trace: Clarify DTrace/SystemTap help messagePhilippe Mathieu-Daudé1-0/+6
Most tracing backends are implemented within QEMU, except the DTrace/SystemTap backends. One side effect is when running 'qemu -trace help', an incomplete list of trace events is displayed when using the DTrace/SystemTap backends. This is partly due to trace events registered as modules with trace_init(), and since the events are not used within QEMU, the linker optimize and remove the unused modules (which is OK in this particular case). Currently only the events compiled in trace-root.o and in the last trace.o member of libqemuutil.a are linked, resulting in an incomplete list of events. To avoid confusion, improve the help message, recommending to use the proper systemtap script to display the events list. Before: $ lm32-softmmu/qemu-system-lm32 -trace help 2>&1 | wc -l 70 After: $ lm32-softmmu/qemu-system-lm32 -trace help Run 'qemu-trace-stap list qemu-system-lm32' to print a list of names of trace points with the DTrace/SystemTap backends. $ qemu-trace-stap list qemu-system-lm32 | wc -l 1136 Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190823142203.5210-1-philmd@redhat.com Message-Id: <20190823142203.5210-1-philmd@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block/qcow2: implement .bdrv_co_pwritev(_compressed)_partVladimir Sementsov-Ogievskiy5-33/+48
Implement and use new interface to get rid of hd_qiov. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-13-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-13-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block/qcow2: implement .bdrv_co_preadv_partVladimir Sementsov-Ogievskiy2-29/+25
Implement and use new interface to get rid of hd_qiov. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-12-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-12-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block/qcow2: refactor qcow2_co_preadv to use buffer-based ioVladimir Sementsov-Ogievskiy1-12/+16
Use buffer based io in encrypted case. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-11-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-11-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block/io: introduce bdrv_co_p{read, write}v_partVladimir Sementsov-Ogievskiy2-6/+29
Introduce extended variants of bdrv_co_preadv and bdrv_co_pwritev with qiov_offset parameter. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-10-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-10-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block/io: bdrv_aligned_pwritev: use and support qiov_offsetVladimir Sementsov-Ogievskiy1-14/+13
Use and support new API in bdrv_aligned_pwritev. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-9-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-9-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block/io: bdrv_aligned_preadv: use and support qiov_offsetVladimir Sementsov-Ogievskiy1-13/+8
Use and support new API in bdrv_co_do_copy_on_readv. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-8-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-8-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block/io: bdrv_co_do_copy_on_readv: lazy allocationVladimir Sementsov-Ogievskiy1-9/+12
Allocate bounce_buffer only if it is really needed. Also, sub-optimize allocation size (why not?). Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-7-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-7-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block/io: bdrv_co_do_copy_on_readv: use and support qiov_offsetVladimir Sementsov-Ogievskiy1-9/+9
Use and support new API in bdrv_co_do_copy_on_readv. Note that in case of allocated-in-top we need to shrink read size to MIN(..) by hand, as pre-patch this was actually done implicitly by qemu_iovec_concat (and we used local_qiov.size). Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-6-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-6-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block: define .*_part io handlers in BlockDriverVladimir Sementsov-Ogievskiy4-22/+95
Add handlers supporting qiov_offset parameter: bdrv_co_preadv_part bdrv_co_pwritev_part bdrv_co_pwritev_compressed_part This is used to reduce need of defining local_qiovs and hd_qiovs in all corners of block layer code. The following patches will increase usage of this new API part by part. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-5-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-5-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27block/io: refactor paddingVladimir Sementsov-Ogievskiy1-165/+200
We have similar padding code in bdrv_co_pwritev, bdrv_co_do_pwrite_zeroes and bdrv_co_preadv. Let's combine and unify it. [Squashed in Vladimir's qemu-iotests 077 fix --Stefan] Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-4-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-4-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27util/iov: improve qemu_iovec_is_zeroVladimir Sementsov-Ogievskiy3-14/+21
We'll need to check a part of qiov soon, so implement it now. Optimization with align down to 4 * sizeof(long) is dropped due to: 1. It is strange: it aligns length of the buffer, but where is a guarantee that buffer pointer is aligned itself? 2. buffer_is_zero() is a better place for optimizations and it has them. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-3-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-3-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27util/iov: introduce qemu_iovec_init_extendedVladimir Sementsov-Ogievskiy2-5/+114
Introduce new initialization API, to create requests with padding. Will be used in the following patch. New API uses qemu_iovec_init_buf if resulting io vector has only one element, to avoid extra allocations. So, we need to update qemu_iovec_destroy to support destroying such QIOVs. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190604161514.262241-2-vsementsov@virtuozzo.com Message-Id: <20190604161514.262241-2-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-27xen-bus: Avoid rewriting identical values to xenstoreAnthony PERARD1-4/+7
When QEMU receives a xenstore watch event suggesting that the "state" of the frontend changed, it records this in its own state but it also re-write the value back into xenstore even so there were no change. This triggers an unnecessary xenstore watch event which QEMU will process again (and maybe the frontend as well). Also QEMU could potentially write an already old value. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Paul Durrant <paul.durrant@citrix.com> Message-Id: <20190823101534.465-3-anthony.perard@citrix.com>
2019-08-27xen-bus: Fix backend state transition on device resetAnthony PERARD1-3/+20
When a frontend wants to reset its state and the backend one, it starts with setting "Closing", then waits for the backend (QEMU) to do the same. But when QEMU is setting "Closing" to its state, it triggers an event (xenstore watch) that re-execute xen_device_backend_changed() and set the backend state to "Closed". QEMU should wait for the frontend to set "Closed" before doing the same. Before setting "Closed" to the backend_state, we are also going to check if there is a frontend. If that the case, when the backend state is set to "Closing" the frontend should react and sets its state to "Closing" then "Closed". The backend should wait for that to happen. Fixes: b6af8926fb858c4f1426e5acb2cfc1f0580ec98a Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Paul Durrant <paul.durrant@citrix.com> Message-Id: <20190823101534.465-2-anthony.perard@citrix.com>
2019-08-27xen: cleanup IOREQ server on exitIgor Druzhinin1-0/+2
Device model is supposed to destroy IOREQ server for itself. Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com> Acked-by: Paul Durrant <paul.durrant@citrix.com> Message-Id: <1564428563-1006-1-git-send-email-igor.druzhinin@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2019-08-27xen: Fix ring.h headerAnthony PERARD1-6/+7
The xen_[rw]?mb() macros defined in ring.h can't be used and the fact that there are gated behind __XEN_INTERFACE_VERSION__ means that it needs to be defined somewhere. QEMU doesn't implement interfaces with the Xen hypervisor so defining __XEN_INTERFACE_VERSION__ is pointless. This leads to: include/hw/xen/io/ring.h:47:5: error: "__XEN_INTERFACE_VERSION__" is not defined, evaluates to 0 [-Werror=undef] Cleanup ring.h. The xen_*mb() macros are already defined in xenctrl.h which is included in xen_common.h. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190704153605.4140-1-anthony.perard@citrix.com> [aperard: Adding the comment proposed upstream] Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2019-08-27Merge remote-tracking branch 'remotes/rth/tags/pull-axp-20190825' into stagingPeter Maydell1-1/+3
Fix for alpha_cpu_tlb_fill # gpg: Signature made Sun 25 Aug 2019 20:35:22 BST # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth/tags/pull-axp-20190825: target/alpha: fix tlb_fill trap_arg2 value for instruction fetch Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-25target/alpha: fix tlb_fill trap_arg2 value for instruction fetchAurelien Jarno1-1/+3
Commit e41c94529740cc26 ("target/alpha: Convert to CPUClass::tlb_fill") slightly changed the way the trap_arg2 value is computed in case of TLB fill. The type of the variable used in the ternary operator has been changed from an int to an enum. This causes the -1 value to not be sign-extended to 64-bit in case of an instruction fetch. The trap_arg2 ends up with 0xffffffff instead of 0xffffffffffffffff. Fix that by changing the -1 into -1LL. This fixes the execution of user space processes in qemu-system-alpha. Fixes: e41c94529740cc26 Cc: qemu-stable@nongnu.org Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> [rth: Test MMU_DATA_LOAD and MMU_DATA_STORE instead of implying them.] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2019-08-23Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell2-1/+9
staging Pull request # gpg: Signature made Thu 22 Aug 2019 16:52:45 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: vhost-user-scsi: prevent using uninitialized vqs util/async: hold AioContext ref to prevent use-after-free Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-23Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190822' into stagingPeter Maydell5-51/+108
s390x updates: - fix a bug in tcg vector handling - improved skey handling # gpg: Signature made Thu 22 Aug 2019 14:43:30 BST # gpg: using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF # gpg: issuer "cohuck@redhat.com" # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown] # gpg: aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full] # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full] # gpg: aka "Cornelia Huck <cohuck@kernel.org>" [unknown] # gpg: aka "Cornelia Huck <cohuck@redhat.com>" [unknown] # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF * remotes/cohuck/tags/s390x-20190822: s390x/mmu: Factor out storage key handling s390x/mmu: Better storage key reference and change bit handling s390x/tcg: Flush the TLB of all CPUs on SSKE and RRBE s390x/tcg: Rework MMU selection for instruction fetches s390x/mmu: ASC selection in s390_cpu_get_phys_page_debug() s390x/mmu: Trace the right value if setting/getting the storage key fails s390x/tcg: Fix VERIM with 32/64 bit elements Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-23modules-test: ui-spice-app is not built as modulePaolo Bonzini1-3/+0
$(call land, $(CONFIG_SPICE), $(CONFIG_GIO)) will never return "m" so ui-spice-app is always linked into QEMU. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com> Message-id: 1566495734-23297-2-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-23modules-test: fix const castPaolo Bonzini1-1/+1
Add a missing cast; this fixes a build failure with --enable-modules. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com> Message-id: 1566495734-23297-1-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-23Merge remote-tracking branch 'remotes/elmarco/tags/podman-pull-request' into ↵Peter Maydell9-31/+91
staging tests/docker: add podman support # gpg: Signature made Thu 22 Aug 2019 14:46:51 BST # gpg: using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5 # gpg: issuer "marcandre.lureau@redhat.com" # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full] # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full] # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * remotes/elmarco/tags/podman-pull-request: test: skip tests if socket_check_protocol_support() failed test-char: skip tcp tests if ipv4 check failed tests: specify the address family when checking bind tests/docker: add podman support docker.py: add podman support docker.py: add --run-as-current-user Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-22Merge remote-tracking branch 'remotes/berrange/tags/autofree-pull-request' ↵Peter Maydell16-179/+78
into staging require newer glib2 to enable autofree'ing of stack variables exiting scope * Bump minium glib2 version to 2.48 * Convert much of the crypto code to use automatic memory free functions # gpg: Signature made Thu 22 Aug 2019 11:51:59 BST # gpg: using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full] # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full] # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * remotes/berrange/tags/autofree-pull-request: crypto: use auto cleanup for many stack variables crypto: define cleanup functions for use with g_autoptr glib: bump min required glib library version to 2.48 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-22Merge remote-tracking branch ↵Peter Maydell3-261/+324
'remotes/bkoppelmann2/tags/pull-tricore-20190822-1' into staging Converted target/tricore to translate_loop # gpg: Signature made Thu 22 Aug 2019 11:17:37 BST # gpg: using RSA key 6E636A7E83F2DD0CFA6E6E370AD2C6396B69CA14 # gpg: issuer "kbastian@mail.uni-paderborn.de" # gpg: Good signature from "Bastian Koppelmann <kbastian@mail.uni-paderborn.de>" [full] # Primary key fingerprint: 6E63 6A7E 83F2 DD0C FA6E 6E37 0AD2 C639 6B69 CA14 * remotes/bkoppelmann2/tags/pull-tricore-20190822-1: target/tricore: Fix tricore_tr_translate_insn target/tricore: Implement a qemu excptions helper target/tricore: Use translate_loop target-tricore: Make env a member of DisasContext target/tricore: Use DisasContextBase API Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-22vhost-user-scsi: prevent using uninitialized vqsRaphael Norwitz1-1/+1
Of the 3 virtqueues, seabios only sets cmd, leaving ctrl and event without a physical address. This can cause vhost_verify_ring_part_mapping to return ENOMEM, causing the following logs: qemu-system-x86_64: Unable to map available ring for ring 0 qemu-system-x86_64: Verify ring failure on region 0 The qemu commit e6cc11d64fc998c11a4dfcde8fda3fc33a74d844 has already resolved the issue for vhost scsi devices but the fix was never applied to vhost-user scsi devices. Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1560299717-177734-1-git-send-email-raphael.norwitz@nutanix.com Message-Id: <1560299717-177734-1-git-send-email-raphael.norwitz@nutanix.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-22Merge remote-tracking branch 'remotes/kraxel/tags/vga-20190822-pull-request' ↵Peter Maydell4-18/+126
into staging vga: a collection of ati fixes/improvements. # gpg: Signature made Thu 22 Aug 2019 09:04:52 BST # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/vga-20190822-pull-request: ati-vga: Implement dummy VBlank IRQ ati-vga: Add limited support for big endian frame buffer aperture ati-vga: Attempt to handle CRTC offset not exact multiple of stride ati-vga: Fix hardware cursor image offset ati-vga: Fix cursor color with guest_hwcursor=true ati-vga: Fix GPIO_MONID register write ati-vga: Add some register definitions for debugging ati-vga: Add registers for getting apertures Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-22util/async: hold AioContext ref to prevent use-after-freeStefan Hajnoczi1-0/+8
The tests/test-bdrv-drain /bdrv-drain/iothread/drain test case does the following: 1. The preadv coroutine calls aio_bh_schedule_oneshot() and then yields. 2. The one-shot BH executes in another AioContext. All it does is call aio_co_wakeup(preadv_co). 3. The preadv coroutine is re-entered and returns. There is a race condition in aio_co_wake() where the preadv coroutine returns and the test case destroys the preadv IOThread. aio_co_wake() can still be running in the other AioContext and it performs an access to the freed IOThread AioContext. Here is the race in aio_co_schedule(): QSLIST_INSERT_HEAD_ATOMIC(&ctx->scheduled_coroutines, co, co_scheduled_next); <-- race: co may execute before we invoke qemu_bh_schedule()! qemu_bh_schedule(ctx->co_schedule_bh); So if co causes ctx to be freed then we're in trouble. Fix this problem by holding a reference to ctx. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20190723190623.21537-1-stefanha@redhat.com Message-Id: <20190723190623.21537-1-stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-08-22Merge remote-tracking branch 'remotes/kraxel/tags/usb-20190822-pull-request' ↵Peter Maydell4-23/+64
into staging usb: bugfixes and minor improvements. # gpg: Signature made Thu 22 Aug 2019 07:52:32 BST # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/usb-20190822-pull-request: ehci: fix queue->dev null ptr dereference usb: reword -usb command-line option and mention xHCI xhci: Add No Op Command usb-redir: merge interrupt packets usbredir: fix buffer-overflow on vmload Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-22test: skip tests if socket_check_protocol_support() failedMarc-André Lureau3-3/+9
Skip the tests if socket_check_protocol_support() failed, but do run g_test_run() to keep TAP harness happy. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-22test-char: skip tcp tests if ipv4 check failedMarc-André Lureau2-5/+14
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-22tests: specify the address family when checking bindMarc-André Lureau2-15/+13
getaddrinfo() may succeed with PF_UNSPEC, but fail when more specific. (this allows to skip some tests that would fail under podman) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-22tests/docker: add podman supportMarc-André Lureau2-3/+7
Allow to specify the container engine to run with ENGINE variable. By default, ENGINE=auto and will select either podman or docker. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>