summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* virtio-blk: do not use vring in dataplanePaolo Bonzini2019-11-294-146/+19
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
* virtio-blk: fix "disabled data plane" modePaolo Bonzini2019-11-293-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | In disabled mode, virtio-blk dataplane seems to be enabled, but flow actually goes through the normal virtio path. This patch simplifies a bit the handling of disabled mode. In disabled mode, virtio_blk_handle_output might be called even if s->dataplane is not NULL. This is a bit tricky, because the current check for s->dataplane will always trigger, causing a continuous stream of calls to virtio_blk_data_plane_start. Unfortunately, these calls will not do anything. To fix this, set the "started" flag even in disabled mode, and skip virtio_blk_data_plane_start if the started flag is true. The resulting changes also prepare the code for the next patch, were virtio-blk dataplane will reuse the same virtio_blk_handle_output function as "regular" virtio-blk. Because struct VirtIOBlockDataPlane is opaque in virtio-blk.c, we have to move s->dataplane->started inside struct VirtIOBlock. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Fam Zheng <famz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
* virtio: export vring_notify as virtio_should_notifyPaolo Bonzini2019-11-292-2/+3
| | | | | | | | | | | | | Virtio dataplane needs to trigger the irq manually through the guest notifier. Export virtio_should_notify so that it can be used around event_notifier_set. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Fam Zheng <famz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
* virtio: add AioContext-specific function for host notifiersPaolo Bonzini2019-11-292-0/+18
| | | | | | | | | | This is used to register ioeventfd with a dataplane thread. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
* vring: make vring_enable_notification return voidPaolo Bonzini2019-11-293-4/+4
| | | | | | | | | | | | Make the API more similar to the regular virtqueue API. This will help when modifying the code to not use vring.c anymore. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Fam Zheng <famz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
* block-migration: acquire AioContext as necessaryPaolo Bonzini2019-11-291-13/+52
| | | | | | | | | | | | | | | | This is needed because dataplane will run during block migration as well. The block device migration code is quite liberal in taking the iothread mutex. For simplicity, keep it the same way, even though one could actually choose between the BQL (for regular BlockDriverStates) and the AioContext (for dataplane BlockDriverStates). When the block layer is made fully thread safe, aio_context_acquire shall go away altogether. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com>
* pci core: function pci_bus_init() cleanupCao jin2019-11-291-5/+2
| | | | | | | | | remove unused param Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
* pci core: function pci_host_bus_register() cleanupCao jin2019-11-291-3/+3
| | | | | | | | | remove unused param, and rename the other to a meaningful one. Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
* balloon: Use only 'pc-dimm' type dimm for ballooningVladimir Sementsov-Ogievskiy2019-11-291-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | For now there are only two dimm's: pc-dimm and nvdimm. This patch is actually needed to disable ballooning on nvdimm. But, to avoid future bugs, instead of disallowing nvdimm, we allow only pc-dimm. So, if someone adds new dimm which should be balloon-able, then this ability should be explicitly specified here. Why ballooning for nvdimm should be disabled for now: NVDIMM for now is planned to use as a backing store for DAX filesystem in the guest and thus this memory is excluded from guest memory management and LRUs. In this case libvirt running QEMU along with configured balloon almost immediately inflates balloon and effectively kill the guest as qemu counts nvdimm as part of the ram. Counting dimm devices as part of the ram for ballooning was started from commit 463756d03: virtio-balloon: Fix balloon not working correctly when hotplug memory Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio-balloon: rewrite get_current_ram_size()Vladimir Sementsov-Ogievskiy2019-11-291-17/+6
| | | | | | | | | | Use pc_dimm_built_list() instead of qmp_pc_dimm_device_list() Actually, Qapi is not related to this internal helper. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* ppc/kvm: Tell the user what might be wrong when using bad CPU types with kvm-hvThomas Huth2019-11-291-0/+4
| | | | | | | | | | | | | | | | Using a CPU type that does not match the host is not possible when using the kvm-hv kernel module - the PVR is checked in the kernel function kvm_arch_vcpu_ioctl_set_sregs_hv() and rejected with -EINVAL if it does not match the host. However, when the user tries to specify a non-matching CPU type, QEMU currently only reports "kvm_init_vcpu failed: Invalid argument", and this is of course not very helpful for the user to solve the problem. So this patch adds a more descriptive error message that tells the user to specify "-cpu host" instead. Signed-off-by: Thomas Huth <thuth@redhat.com> [Removed melodramatic '!' :)] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* ppc/kvm: Use error_report() instead of cpu_abort() for user-triggerable errorsThomas Huth2019-11-291-2/+5
| | | | | | | | | | | | | | | | | | Setting the KVM_CAP_PPC_PAPR capability can fail if either the KVM kernel module does not support it, or if the specified vCPU type is not a 64-bit Book3-S CPU type. For example, the user can trigger it easily with "-M pseries -cpu G2leLS" when using the kvm-pr kernel module. So the error should not be reported with cpu_abort() since this function is rather meant for reporting programming errors than reporting user-triggerable errors (it prints out all CPU registers and then calls abort() to kills the program - two things that the normal user does not expect here) . So let's use error_report() with exit(1) here instead. A similar problem exists in the code that sets the KVM_CAP_PPC_EPR capability, so while we're at it, fix that, too. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* spapr: initialize local Error pointerGreg Kurz2019-11-291-1/+1
| | | | | | | | | | | This fixes a crash in the target QEMU during migration. Broken in commit c5f54f3. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [reworded commit message] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* hw/ppc/spapr: Implement the h_page_init hypercallThomas Huth2019-11-292-2/+94
| | | | | | | | | | | | | | | | | This hypercall either initializes a page with zeros, or copies another page. According to LoPAPR, the i-cache of the page should also be flushed if using H_ICACHE_INVALIDATE or H_ICACHE_SYNCHRONIZE, and the d-cache should be synchronized to the RAM if the H_ICACHE_SYNCHRONIZE flag is used. For this, two new functions are introduced, kvmppc_dcbst_range() and kvmppc_icbi()_range, which use the corresponding assembler instructions to flush the caches if running with KVM on Power. If the code runs with TCG instead, the code only uses tb_flush(), assuming that this will be enough for synchronization. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pseries: Update SLOF firmware image to 20160223Alexey Kardashevskiy2019-11-293-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main change is virtio 1.0 support. The complete changelog is: > dhcp: fix warning messages when calling strtoip() > virtio-scsi: enable virtio 1.0 > virtio-scsi: use virtio_fill desc api > virtio-scsi: use idx during initialization > virtio-net: enable virtio 1.0 > virtio-blk: enable virtio 1.0 > virtio: 1.0 helper to read 16/32/64 bit value > virtio: add and enable 1.0 device setup > virtio: 1.0 guest features negotiation > virtio: update features set/get register accessor > virtio: make all virtio apis 1.0 aware > virtio: add 64-bit virtio helpers for 1.0 > virtio: add virtio 1.0 related struct and defines > virtio: get rid of type variable in virtio_device > virtio-net: move setup-mac to the open routine > virtio-net: make net_hdr_size a variable > virtio-net: replace vq array with vq_{tx,rx} > virtio-net: use virtio_fill_desc > virtio-{net,blk,scsi,9p}: use status variable > virtio-blk: add helpers for filling descriptors > virtio-{blk,9p}: enable resetting the device > virtio: introduce helper for initializing virt queue > virtio: fix code style/design issues. > fix code style in byteorder.h > pci: add byte read/write helper routines > virtio-net: fix gcc warnings (-Wextra) > virtio-blk: fix gcc warnings (-Wextra) > readme: Add a note about coding style > dhcp: Remove duplicated strtoip() > ethernet: Fix gcc warnings > net-snk: Fix gcc warnings > net-snk: Fix coding style > net-snk: Fix memory leak in dhcp6_process_options() > net-snk: Fix memory leak in ip6_to_multicast_mac() / send_ipv6() > net-snk: Remove bad NEIGHBOUR_SOLICITATION code in send_ipv6() > Fix dma-alloc and dma-map-in functions on board-js2x > net-snk: Allow stateless autoconfig IPv6 addresses with IP_INIT_IPV6_MANUAL > net-snk: Simplify the ip6_is_multicast() function > net-snk: Move global variable definition out of the header file > net-snk: Prefer non-link-local unicast IPv6 addresses if possible > net-snk: Fix the check for link-local addresses when receiving RAs > net-snk: Remove junk at the end of IPv6 TFTP ACK and error packets > Fix format strings in usb-ohci.c > net-snk: Get rid of junk at the end of sent DHCPv6 packets > net-snk: Use transaction IDs in DHCPv4, too > net-snk: Make use of DHCPv6 transaction IDs > net-snk: Seed the pseudo-random number generator > libc: Add srand() call > libc: Fix the rand() function to return non-zero values > net-snk: Improve printed text when booting via network > Increase temporary buffer size of ibm,client-architecture-support call > Move archsupport.fs into board-qemu directory > boot: stop booting when we encounter HALT > fat-files: Fix bug with root-entries = 0 on certain FAT32 file systems > usb: print unhandled descriptor in debug mode > Improve stack usage with libnvram get_partition function > Improve stack usage in libnvram environment variable code > libc: Port vsnprintf back from skiboot > Move the code for rfill into a separate function > Rework wrapper for new_nvram_partition() and fix possible bug in there > Stack optimization in libusb: split up setup_new_device() > Check for stack overflow in paflof engine > Clean up pending packet variable in ipv4 code > Fix tracking of pending outgoing packets when handling ARP replies Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* linux-user: add getrandom() syscallLaurent Vivier2019-11-291-0/+13
| | | | | | | | getrandom() has been introduced in kernel 3.17 and is now used during the boot sequence of Debian unstable (stretch/sid). Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: correct timerfd_create syscall numbersRiku Voipio2019-11-296-6/+6
| | | | | | | | | | | | x86, m68k, ppc, sh4 and sparc failed to enable timerfd, because they didn't have timerfd_create system call defined. Instead QEMU defined timerfd syscall. Checking with kernel sources, it appears kernel developers reused timerfd syscall number with timerfd_create, presumably since no userspace called the old syscall number. Reported-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: remove unavailable syscalls from aarch64Riku Voipio2019-11-292-61/+0
| | | | | | | | | | QEMU lists deprecated system call numbers in for Aarch64. These are never enabled for Linux kernel, so don't define them in Qemu either. Remove the ifdef around host_to_target_stat64 since all architectures need it now. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: sync syscall numbers with kernelRiku Voipio2019-11-2913-17/+200
| | | | | | | Sync syscall numbers to match the linux v4.5-rc1 kernel. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: Don't assert if guest tries shmdt(0)Peter Maydell2019-11-291-5/+7
| | | | | | | | | | | | | | | | | Our implementation of shmat() and shmdt() for linux-user was using "zero guest address" as its marker for "entry in the shm_regions[] array is not in use". This meant that if the guest did a shmdt(0) we would match on an unused array entry and call page_set_flags() with both start and end addresses zero, which causes an assertion failure. Use an explicit in_use flag to manage the shm_regions[] array, so that we avoid this problem. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reported-by: Pavel Shamis <pasharesearch@gmail.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: set ppc64/ppc64le default CPU to POWER8Laurent Vivier2019-11-291-1/+1
| | | | | | | | | | | | | | | | Set the default to the latest CPU version to have the largest set of available features. It is also really needed in little-endian mode because POWER7 is not really supported in this mode and some distros (at least debian) generate POWER8 code for their ppc64le target. Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813698 Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* build: [linux-user] Rename "syscall.h" to "target_syscall.h" in target ↵Lluís Vilanova2019-11-2919-1/+67
| | | | | | | | | | | directories This fixes double-definitions in linux-user builds when using the UST tracing backend (which indirectly includes the system's "syscall.h"). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* linux-user: fix realloc size of target_fd_trans.Laurent Vivier2019-11-291-2/+2
| | | | | | | | | target_fd_trans is an array of "TargetFdTrans *": compute size accordingly. Use g_renew() as proposed by Paolo. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* tcg: Remove unnecessary osdep.h includes from tcg-target.inc.cPeter Maydell2019-11-298-8/+0
| | | | | | | | | | | | | | Commit 757e725b58c57d added a number of #include "qemu/osdep.h" files to the tcg-target.c files (as they were named at the time). These are unnecessary because these files are not standalone C files, and the tcg/tcg.c file which includes them will have already included osdep.h on their behalf. Remove the unneeded include directives. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <1456238983-10160-4-git-send-email-peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
* scripts/clean-includes: Ignore .inc.c filesPeter Maydell2019-11-291-0/+5
| | | | | | | | | | | | Ignore files which have a .inc.c extension -- these are not headers but they are not standalone C source files either, so we can't make any automated decisions about what #include directives they should have. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <1456238983-10160-3-git-send-email-peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
* tcg: Rename tcg-target.c to tcg-target.inc.cPeter Maydell2019-11-2914-9/+11
| | | | | | | | | | | Rename the per-architecture tcg-target.c files to tcg-target.inc.c. This makes it clearer that they are not intended to be standalone C files, but are instead #included into another source file. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <1456238983-10160-2-git-send-email-peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-sparc: Use global registers for the register windowRichard Henderson2019-11-291-24/+33
| | | | | | | Via indirection off cpu_regwptr. Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson <rth@twiddle.net>
* target-sparc: Tidy global register initializationRichard Henderson2019-11-291-87/+70
| | | | | | | | Create tables for the various global registers that need allocation. Remove one level of indirection from gregnames and fregnames. Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson <rth@twiddle.net>
* tcg: Allocate indirect_base temporaries in a different orderRichard Henderson2019-11-291-11/+32
| | | | | | | | | Since we've not got liveness analysis for indirect bases, placing them at the end of the call-saved registers makes it more likely that it'll stay live. Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson <rth@twiddle.net>
* tcg: Implement indirect memory registersRichard Henderson2019-11-292-29/+68
| | | | | | | | That is, global_mem registers whose base is another global_mem register, rather than a fixed register. Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson <rth@twiddle.net>
* tcg: Work around clang bug wrt enum ranges, part 2Richard Henderson2019-11-291-1/+1
| | | | | | | | | A previous patch patch changed the type of REG from int to enum TCGReg, which provokes the following bug in clang: https://llvm.org/bugs/show_bug.cgi?id=16154 Signed-off-by: Richard Henderson <rth@twiddle.net>
* tracetool: Include osdep.h in generated-ust.cPeter Maydell2019-11-291-0/+2
| | | | | | | | | | | When generating the trace/generated-ust.c source file, make sure it includes osdep.h as its first include. This fixes compilation with --enable-trace-backends=ust Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1456240661-15422-1-git-send-email-peter.maydell@linaro.org Reviewed-by: Eric Blake <eblake@redhat.com>
* include: Clean up includesPeter Maydell2019-11-2997-156/+0
| | | | | | | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. NB: If this commit breaks compilation for your out-of-tree patchseries or fork, then you need to make sure you add #include "qemu/osdep.h" to any new .c files that you have. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
* all: Clean up includesPeter Maydell2019-11-293-4/+3
| | | | | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- This just catches a couple of stragglers since I posted the last clean-includes patchset last week.
* all: Clean up includesPeter Maydell2019-11-2956-100/+2
| | | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
* osdep.h: Include config-target.h if NEED_CPU_H is definedPeter Maydell2019-11-291-0/+3
| | | | | | | | | | NEED_CPU_H is the define we use to distinguish per-target object compilation from common object compilation. For the former, we must also include config-target.h so that the .c files see the necessary CONFIG_ constants. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
* scripts/clean-includes: Add --all optionPeter Maydell2019-11-291-1/+15
| | | | | | | | | Add a --all option which will run the script on every C source and header file in the repository (except for those in a few directories which contain standalone guest code). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
* scripts/clean-includes: Enhance to handle header filesPeter Maydell2019-11-291-8/+45
| | | | | | | | | | | | | Enhance clean-includes to handle header files as well as .c source files. For headers we merely remove all the redundant #include lines, including any includes of qemu/osdep.h itself. There is a simple mollyguard on the include file processing to skip a few key headers like osdep.h itself, to avoid producing bad patches if the script is run on every file in include/. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
* disas/arm-a64.cc: Include osdep.h firstPeter Maydell2019-11-291-2/+3
| | | | | | | | | Rearrange include directives so that we include osdep.h first. This has to be done manually because clean-includes doesn't handle C++. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
* osdep.h: Define macros for the benefit of C++ before C++11Peter Maydell2019-11-291-0/+14
| | | | | | | | | | | | | | | For C++ before C++11, <stdint.h> requires definition of the macros __STDC_CONSTANT_MACROS, __STDC_LIMIT_MACROS and __STDC_FORMAT_MACROS in order to enable definition of various macros by the header file. Define these in osdep.h, so that we get the right header file definitions whether osdep.h is being used by plain C, C++11 or older C++. In particular libvixl's header files depend on this and won't compile if osdep.h is included before them otherwise. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com>
* cpu: Clean up includesPeter Maydell2019-11-292-4/+2
| | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Postcopy+spice: Pass spice migration data earlierDr. David Alan Gilbert2019-11-293-1/+20
| | | | | | | | | | | | | | | | | | | | | | | Spice hooks the migration status changes to figure out when to transmit information to the new spice server; but the migration status in postcopy doesn't quite fit - the destination starts running before the end of the source migration. It's not a case of hanging off the migration status change to postcopy-active either, since that happens before we stop the guest CPU. Fix it by sending a notify just after sending the device state, and adding a flag that can be tested by the notify receiver. Symptom: spice handover doesn't work with the error: red_worker.c:11540:display_channel_wait_for_migrate_data: timeout Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-id: 1456161452-25318-1-git-send-email-dgilbert@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice/gl: tweak debug messages.Gerd Hoffmann2019-11-291-5/+7
| | | | | | Adjust message levels, make messages more verbose. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice/gl: add unblock timerGerd Hoffmann2019-11-292-0/+17
| | | | | | | | Pure debug aid, print a warning in case unblocking doesn't happen within one second. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* spice: add opengl/virgl/dmabuf supportGerd Hoffmann2019-11-294-4/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for dma-buf passing to spice. This makes virtio-gpu with 3d acceleration work with spice. Workflow: * virglrenderer renders the guest command stream into a texture. * qemu exports the texture as dma-buf and passes on that dma-buf to spice-server. * spice-server passes the dma-buf to spice-client, using unix socket file descriptor passing. * spice-client asks the window systems composer to render the dma-buf to the screen. Requires cutting edge spice (server) and spice-gtk (client) builds, from git master branch. Also requires libvirt managing your qemu instance, and using "virt-viewer --attach $guest". libvirt will connect spice-server and spice-client using unix sockets instead of tcp sockets then, which is required for file descriptor passing. Works for the local case (spice server and client on the same machine) only. Supporting remote too is planned (by feeding the dma-bufs into gpu-assisted video encoder), but not there yet. gl mode is turned off by default, use "-spice gl=on,$otherargs" to enable it. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: reset cursor on resizeMarc-André Lureau2019-11-291-2/+12
| | | | | | | | | Spice server will clear the cursor on resize. QXL driver reset it after resize, however, virtio and other devices do not. Teach qemu to set it back. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* egl-helpers: add functions for render nodes and dma-buf passingGerd Hoffmann2019-11-292-0/+142
| | | | | | | | | Adds helpers to open a drm render node and create a opengl context for it. Also add a helper to export a texture as dma-buf. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* configure: add dma-buf support detection.Gerd Hoffmann2019-11-291-1/+19
| | | | | | | | Set CONFIG_OPENGL_DMABUF in case both mesa and libepoxy are new enough to have support for dma-buf import/export. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* spice: init dcl before registering qxl interfaceGerd Hoffmann2019-11-291-3/+3
| | | | | | | | Without this spice might callback into qemu before ssd->dcl.con is initialized, resulting in a segfault due to NULL pointer dereference. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* move get_current_ram_size to virtio-balloon.cVladimir Sementsov-Ogievskiy2019-11-294-32/+26
| | | | | | | | | | | | get_current_ram_size() is used only in virtio-balloon.c This patch moves it into virtio-balloon and make it static, to allow some balloon-specific tuning. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
OpenPOWER on IntegriCloud