summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* cutils: add avx2 instruction optimizationLiang Li2019-11-291-7/+1
| | | | | | | | | | | | | | | | | | | | | | | buffer_find_nonzero_offset() is a hot function during live migration. Now it use SSE2 instructions for optimization. For platform supports AVX2 instructions, use AVX2 instructions for optimization can help to improve the performance of buffer_find_nonzero_offset() about 30% comparing to SSE2. Live migration can be faster with this optimization, the test result shows that for an 8GiB RAM idle guest just boots, this patch can help to shorten the total live migration time about 6%. This patch use the ifunc mechanism to select the proper function when running, for platform supports AVX2, execute the AVX2 instructions, else, execute the original instructions. Signed-off-by: Liang Li <liang.z.li@intel.com> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Suggested-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1457416397-26671-3-git-send-email-liang.z.li@intel.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
* input: linux evdev supportGerd Hoffmann2019-11-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for reading input events directly from linux evdev devices and forward them to the guest. Unlike virtio-input-host which simply passes on all events to the guest without looking at them this will interpret the events and feed them into the qemu input subsystem. Therefore this is limited to what the qemu input subsystem and the emulated input devices are able to handle. Also there is no support for absolute coordinates (tablet/touchscreen). So we are talking here about basic mouse and keyboard support. The advantage is that it'll work without virtio-input drivers in the guest, the events are delivered to the usual ps/2 or usb input devices (depending on what the machine happens to have). And for keyboards qemu is able to switch the keyboard between guest and host on hotkey. The hotkey is hard-coded for now (both control keys), initialy the guest owns the keyboard. Probably most useful when assigning vga devices with vfio and using a physical monitor instead of vnc/spice/gtk as guest display. Usage: Add '-input-linux /dev/input/event<nr>' to the qemu command line. Note that udev has rules which populate /dev/input/by-{id,path} with static names, which might be more convinient to use. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1457087116-4379-2-git-send-email-kraxel@redhat.com
* pc: fw_cfg: move ioport base constant to pc.hGabriel L. Somlo2019-11-291-0/+2
| | | | | | | | | | | | | Move BIOS_CFG_IOPORT define from pc.c to pc.h, and rename it to FW_CFG_IO_BASE. Cc: Marc Marí <markmb@redhat.com> Signed-off-by: Gabriel Somlo <somlo@cmu.edu> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Marc Marí <markmb@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1455906029-25565-3-git-send-email-somlo@cmu.edu Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* fw_cfg: expose control register size in fw_cfg.hGabriel L. Somlo2019-11-291-0/+3
| | | | | | | | | | | | | | | | Expose the size of the control register (FW_CFG_CTL_SIZE) in fw_cfg.h. Add comment to fw_cfg_io_realize() pointing out that since the 8-bit data register is always subsumed by the 16-bit control register in the port I/O case, we use the control register width as the *total* width of the (classic, non-DMA) port I/O region reserved for the device. Cc: Marc Marí <markmb@redhat.com> Signed-off-by: Gabriel Somlo <somlo@cmu.edu> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Marc Marí <markmb@redhat.com> Message-id: 1455906029-25565-2-git-send-email-somlo@cmu.edu Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* filter: Add 'status' property for filter objectzhanghailiang2019-11-291-0/+4
| | | | | | | | | | | | | | | With this property, users can control if this filter is 'on' or 'off'. The default behavior for filter is 'on'. For some types of filters, they may need to react to status changing, So here, we introduced status changing callback/notifier for filter class. We will skip the disabled ('off') filter when delivering packets in net layer. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Yang Hongyang <hongyang.yang@easystack.cn> Signed-off-by: Jason Wang <jasowang@redhat.com>
* rng: switch request queue to QSIMPLEQLadi Prosek2019-11-291-1/+2
| | | | | | | | | | | | | QSIMPLEQ supports appending to tail in O(1) and is intrusive so it doesn't require extra memory allocations for the bookkeeping data. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-Id: <1457010971-24771-1-git-send-email-lprosek@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
* exec: Pass RAMBlock pointer to qemu_ram_freeFam Zheng2019-11-291-1/+1
| | | | | | | | | | The only caller now knows exactly which RAMBlock to free, so it's not necessary to do the lookup. Reviewed-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1456813104-25902-6-git-send-email-famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* memory: Drop MemoryRegion.ram_addrFam Zheng2019-11-291-1/+0
| | | | | | | | | | | | All references to mr->ram_addr are replaced by memory_region_get_ram_addr(mr) (except for a few assertions that are replaced with mr->ram_block). Reviewed-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1456813104-25902-5-git-send-email-famz@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* memory: Implement memory_region_get_ram_addr with mr->ram_blockFam Zheng2019-11-291-7/+1
| | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1456813104-25902-4-git-send-email-famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* exec: Return RAMBlock pointer from allocating functionsFam Zheng2019-11-291-11/+11
| | | | | | | | | | | | Previously we return RAMBlock.offset; now return the pointer to the whole structure. ram_block_add returns void now, error is completely passed with errp. Reviewed-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1456813104-25902-2-git-send-email-famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* arm: boot: Support big-endian elfsPeter Crosthwaite2019-11-291-0/+9
| | | | | | | | | | | | | | | Support ARM big-endian ELF files in system-mode emulation. When loading an elf, determine the endianness mode expected by the elf, and set the relevant CPU state accordingly. With this, big-endian modes are now fully supported via system-mode LE, so there is no need to restrict the elf loading to the TARGET endianness so the ifdeffery on TARGET_WORDS_BIGENDIAN goes away. Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: fix typo in comments] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* loader: Add data swap option to load-elfPeter Crosthwaite2019-11-292-2/+25
| | | | | | | | | | | | | | | | | | | | | | | Some CPUs are of an opposite data-endianness to other components in the system. Sometimes elfs have the data sections layed out with this CPU data-endianness accounting for when loaded via the CPU, so byte swaps (relative to other system components) will occur. The leading example, is ARM's BE32 mode, which is is basically LE with address manipulation on half-word and byte accesses to access the hw/byte reversed address. This means that word data is invariant across LE and BE32. This also means that instructions are still LE. The expectation is that the elf will be loaded via the CPU in this endianness scheme, which means the data in the elf is reversed at compile time. As QEMU loads via the system memory directly, rather than the CPU, we need a mechanism to reverse elf data endianness to implement this possibility. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* loader: load_elf(): Add doc commentPeter Crosthwaite2019-11-291-0/+23
| | | | | | | | Document the usage of load_elf() for clarity on current features. Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* loader: add API to load elf headerPeter Crosthwaite2019-11-291-0/+13
| | | | | | | | | | | Add an API to load an elf header header from a file. Populates a buffer with the header contents, as well as a boolean for whether the elf is 64b or not. Both arguments are optional. Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: Fix typo in comment] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* loader: Add load_image_mr() to load ROM image to a MemoryRegionPeter Maydell2019-11-291-2/+16
| | | | | | | | | | | | | | | | Add a new function load_image_mr(), which behaves like load_image_targphys() except that it loads the ROM image to a specified MemoryRegion rather than to a specified physical address. This is useful when a ROM blob needs to be loaded to a particular flash or ROM device but the address of that device in the machine's address space is not known. (For instance, ROMs in devices, or ROMs which might exist in a different address space to the system address space.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1455288361-30117-3-git-send-email-peter.maydell@linaro.org Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
* hw/arm/virt: Provide a secure-only RAM if booting in Secure modePeter Maydell2019-11-291-0/+1
| | | | | | | | | If we're booting in Secure mode, provide a secure-only RAM (just 16MB) so that secure firmware has somewhere to run from that won't be accessible to the Non-secure guest. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1455288361-30117-2-git-send-email-peter.maydell@linaro.org
* rng: add request queue support to rng-randomLadi Prosek2019-11-291-2/+1
| | | | | | | | | | | | | | | | | | | | Requests are now created in the RngBackend parent class and the code path is shared by both rng-egd and rng-random. This commit fixes the rng-random implementation which processed only one request at a time and simply discarded all but the most recent one. In the guest this manifested as delayed completion of reads from virtio-rng, i.e. a read was completed only after another read was issued. By switching rng-random to use the same request queue as rng-egd, the unsafe stack-based allocation of the entropy buffer is eliminated and replaced with g_malloc. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-Id: <1456994238-9585-5-git-send-email-lprosek@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
* rng: move request queue cleanup from RngEgd to RngBackendLadi Prosek2019-11-291-0/+12
| | | | | | | | | | | RngBackend is now in charge of cleaning up the linked list on instance finalization. It also exposes a function to finalize individual RngRequest instances, called by its child classes. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-Id: <1456994238-9585-4-git-send-email-lprosek@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
* rng: move request queue from RngEgd to RngBackendLadi Prosek2019-11-291-0/+11
| | | | | | | | | | The 'requests' field now lives in the RngBackend parent class. There are no functional changes in this commit. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-Id: <1456994238-9585-3-git-send-email-lprosek@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
* rng: remove the unused request cancellation codeLadi Prosek2019-11-291-11/+0
| | | | | | | | | | rng_backend_cancel_requests had no callers and none of the code deleted in this commit ever ran. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-Id: <1456994238-9585-2-git-send-email-lprosek@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
* typedefs: Add CPUStateLluís Vilanova2019-11-292-1/+1
| | | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 145641861239.30295.8564457138934628740.stgit@localhost Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* console: add & use qemu_console_lookup_by_device_nameGerd Hoffmann2019-11-291-0/+2
| | | | | | | | | We have two places needing this, and a third one will come shortly. So factor things out into a helper function to reduce code duplication. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* spice/gl: Enable dmabuf only for spice >= 0.13.1Michal Privoznik2019-11-291-1/+1
| | | | | | | | | | | | | | After 474114b7 the dmabuf feature is enabled whenever spice greater than or equal to spice 0.13.0 is found. This is because two new functions are required: spice_qxl_gl_scanout and spice_qxl_gl_draw_async. These were, however, introduce in 0.13.1 release. Well, technically they haven't been released yet, but for sure they are not going to be part of 0.13.0 release (for the ABI stability sake). Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Message-id: 1a724e97cb587624d6f6009c15395496bccfa32b.1456317738.git.mprivozn@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xics: report errors with the QEMU Error APIGreg Kurz2019-11-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Using the return value to report errors is error prone: - xics_alloc() returns -1 on error but spapr_vio_busdev_realize() errors on 0 - xics_alloc_block() returns the unclear value of ics->offset - 1 on error but both rtas_ibm_change_msi() and spapr_phb_realize() error on 0 This patch adds an errp argument to xics_alloc() and xics_alloc_block() to report errors. The return value of these functions is a valid IRQ number if errp is NULL. It is undefined otherwise. The corresponding error traces get promotted to error messages. Note that the "can't allocate IRQ" error message in spapr_vio_busdev_realize() also moves to xics_alloc(). Similar error message consolidation isn't really applicable to xics_alloc_block() because callers have extra context (device config address, MSI or MSIX). This fixes the issues mentioned above. Based on previous work from Brian W. Hart. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* migration: allow machine to enforce configuration section migrationGreg Kurz2019-11-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Migration of pseries-2.3 doesn't have configuration section. Unfortunately, QEMU 2.4/2.4.1/2.5 are buggy and always stream and expect the configuration section, and break migration both ways. This patch introduces a property which allows to enforce a configuration section for machines who don't have one. It can be set at startup: -machine enforce-config-section=on or later from the QEMU monitor: qom-set /machine enforce-config-section on It is up to the tooling to set or unset this property according to the version of the QEMU at the other end of the pipe. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* migration (ordinary): move bdrv_invalidate_cache_all of of coroutine contextDenis V. Lunev2019-11-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | There is a possibility to hit an assert in qcow2_get_specific_info that s->qcow_version is undefined. This happens when VM in starting from suspended state, i.e. it processes incoming migration, and in the same time 'info block' is called. The problem is that qcow2_invalidate_cache() closes the image and memset()s BDRVQcowState in the middle. The patch moves processing of bdrv_invalidate_cache_all out of coroutine context for standard migration to avoid that. Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Fam Zheng <famz@redhat.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Juan Quintela <quintela@redhat.com> CC: Amit Shah <amit.shah@redhat.com> Message-Id: <1456304019-10507-2-git-send-email-den@openvz.org> [Amit: Fix a use-after-free bug] Signed-off-by: Amit Shah <amit.shah@redhat.com>
* sdhci: add quirk property for card insert interrupt status on Raspberry PiAndrew Baumann2019-11-291-0/+2
| | | | | | | | | | | | | | | | | This quirk is a workaround for the following hardware behaviour, on which UEFI (specifically, the bootloader for Windows on Pi2) depends: 1. at boot with an SD card present, the interrupt status/enable registers are initially zero 2. upon enabling it in the interrupt enable register, the card insert bit in the interrupt status register is immediately set 3. after a subsequent controller reset, the card insert interrupt does not fire, even if enabled in the interrupt enable register Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com> Message-id: 1456436130-7048-3-git-send-email-Andrew.Baumann@microsoft.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* sdhci: Revert "add optional quirk property to disable card insertion/removal ↵Andrew Baumann2019-11-291-1/+0
| | | | | | | | | | | | | | | | | | interrupts" This reverts commit 723697551a7e926abe7d3c7f2966012b8075143d. This change was poorly tested on my part. It squelched card insertion interrupts on reset, but that was not necessary because sdhci_reset() clears all the registers (via the call to memset), so the subsequent sdhci_insert_eject_cb() call never sees the card insert interrupt enabled. However, not calling the insert_eject_cb results in prnsts remaining 0, when it actually needs to be updated to indicate card presence and R/O status. Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com> Message-id: 1456436130-7048-2-git-send-email-Andrew.Baumann@microsoft.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* migration/vmstate: document VMStateFlagsSascha Silbe2019-11-291-10/+90
| | | | | | | | | | | The VMState API is rather sparsely documented. Start by describing the meaning of all VMStateFlags. Reviewed-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-Id: <1456474693-11662-1-git-send-email-silbe@linux.vnet.ibm.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
* fw_cfg: unbreak migration compatibility for 2.4 and earlier machinesLaszlo Ersek2019-11-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I reviewed Marc's fw_cfg DMA patches, I completely missed that the way we set dma_enabled would break migration. Gerd explained the right way (see reference below): dma_enabled should be set to true by default, and only true->false transitions should be possible: - when the user requests that with -global fw_cfg_mem.dma_enabled=off or -global fw_cfg_io.dma_enabled=off as appropriate for the platform, - when HW_COMPAT_2_4 dictates it, - when board code initializes fw_cfg without requesting DMA support. Cc: Marc Marí <markmb@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Alexandre DERUMIER <aderumier@odiso.com> Cc: qemu-stable@nongnu.org Ref: http://thread.gmane.org/gmane.comp.emulators.qemu/390272/focus=391042 Ref: https://bugs.launchpad.net/qemu/+bug/1536487 Suggested-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-id: 1455823860-22268-1-git-send-email-lersek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* chardev: Properly initialize ChardevCommon componentsEric Blake2019-11-291-0/+10
| | | | | | | | | | | | | Commit d0d7708b forgot to parse logging for spice chardevs and virtual consoles. This requires making qemu_chr_parse_common() non-static. While at it, use a temporary variable to make the code shorter, as well as reduce the churn when a later patch alters the layout of simple unions. Signed-off-by: Eric Blake <eblake@redhat.com> CC: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1455927587-28033-2-git-send-email-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* memory: Remove unreachable return statementGonglei2019-11-291-2/+0
| | | | | | Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1455935721-8804-4-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* memory: optimize qemu_get_ram_ptr and qemu_ram_ptr_lengthGonglei2019-11-291-2/+2
| | | | | | | | | | | | | | these two functions consume too much cpu overhead to find the RAMBlock by ram address. After this patch, we can pass the RAMBlock pointer to them so that they don't need to find the RAMBlock anymore most of the time. We can get better performance in address translation processing. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1455935721-8804-3-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* exec: store RAMBlock pointer into memory regionGonglei2019-11-291-0/+2
| | | | | | | | | | | | | | | | | Each RAM memory region has a unique corresponding RAMBlock. In the current realization, the memory region only stored the ram_addr which means the offset of RAM address space, We need to qurey the global ram.list to find the ram block by ram_addr if we want to get the ram block, which is very expensive. Now, we store the RAMBlock pointer into memory region structure. So, if we know the mr, we can easily get the RAMBlock. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1456130097-4208-2-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* ich9: Remove enable_tco arguments from init functionsEduardo Habkost2019-11-292-2/+1
| | | | | | | | | | | | The enable_tco arguments are always true, so they are not needed anymore. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
* machine: Remove no_tco fieldEduardo Habkost2019-11-291-1/+0
| | | | | | | | | | | The field is always set to zero, so it is not necessary anymore. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
* vring: removePaolo Bonzini2019-11-292-126/+0
| | | | | | | | 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-scsi: do not use vring in dataplanePaolo Bonzini2019-11-291-20/+1
| | | | | | | 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>
* virtio-blk: do not use vring in dataplanePaolo Bonzini2019-11-291-3/+0
| | | | | | | | 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-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-291-0/+1
| | | | | | | | | | | | | 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-291-0/+2
| | | | | | | | | | 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-291-1/+1
| | | | | | | | | | | | 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>
* 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>
* 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>
* 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>
* Postcopy+spice: Pass spice migration data earlierDr. David Alan Gilbert2019-11-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | 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: add unblock timerGerd Hoffmann2019-11-291-0/+1
| | | | | | | | 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-291-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* egl-helpers: add functions for render nodes and dma-buf passingGerd Hoffmann2019-11-291-0/+13
| | | | | | | | | 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>
OpenPOWER on IntegriCloud