- Mar 10, 2016
-
-
Paolo Bonzini authored
On Win32 we cannot directly poll on socket handles. Instead we create a Win32 event object and associate the socket handle with the event. When the event signals readyness we then have to use select to determine which events are ready. Creating Win32 events is moderately heavyweight, so we don't want todo it every time we create a GSource, so this associates a single event with a QIOChannel. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
Paolo Bonzini authored
Sockets are not in the same namespace as file descriptors on Windows. As an initial step, introduce separate APIs for file descriptor and socket watches. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Daniel P. Berrangé authored
Historically QEMU has had a socket_error() macro that was defined to map to WSASocketError(). The os-win32.h header file would define errno constants that mapped to the WSA error constants. This worked fine with Mingw32 since its header files never defined any errno values, nor did it even provide an errno.h. So callers of socket_error() could match on traditional Exxxx constants and it would all "just work". With Mingw64 though, things work rather differently. First there is an errno.h file which defines all the traditional errno constants you'd expect from a UNIX platform. There is then a winerror.h which defined the WSA error constants. Crucially the WSAExxxx errno values in winerror.h do not match the Exxxx errno values in error.h. If QEMU had only imported winerror.h it would still work, but the qemu/osdep.h file unconditionally imports errno.h. So callers of socket_error() will get now WSAExxxx values back and compare them to the Exxx constants. This will always fail silently at runtime. To solve this QEMU needs to stop assuming the WSAExxxx constant values match the Exxx constant values. Thus the socket_error() macro is turned into a small function that re-maps WSAExxxx values into Exxx. Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
- Mar 08, 2016
-
-
Liang Li authored
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>
-
Gerd Hoffmann authored
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
-
Gabriel L. Somlo authored
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>
-
Gabriel L. Somlo authored
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>
-
Hailiang Zhang authored
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>
-
Ladi Prosek authored
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>
-
- Mar 07, 2016
-
-
Fam Zheng authored
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>
-
Fam Zheng authored
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>
-
Fam Zheng authored
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>
-
Fam Zheng authored
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>
-
- Mar 04, 2016
-
-
Peter Crosthwaite authored
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>
-
Peter Crosthwaite authored
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>
-
Peter Crosthwaite authored
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>
-
Peter Crosthwaite authored
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>
-
Peter Maydell authored
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>
-
Peter Maydell authored
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
-
- Mar 03, 2016
-
-
Ladi Prosek authored
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>
-
Ladi Prosek authored
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>
-
Ladi Prosek authored
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>
-
Ladi Prosek authored
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>
-
- Mar 01, 2016
-
-
Lluís Vilanova authored
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>
-
Gerd Hoffmann authored
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>
-
- Feb 29, 2016
-
-
Michal Privoznik authored
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>
-
- Feb 28, 2016
-
-
Greg Kurz authored
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>
-
Greg Kurz authored
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>
-
- Feb 26, 2016
-
-
Denis V. Lunev authored
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>
-
Andrew Baumann authored
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>
-
Andrew Baumann authored
This reverts commit 72369755. 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>
-
Sascha Silbe authored
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>
-
Laszlo Ersek authored
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>
-
- Feb 25, 2016
-
-
Eric Blake authored
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>
-
Gonglei (Arei) authored
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>
-
Gonglei (Arei) authored
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>
-
Gonglei (Arei) authored
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>
-
Eduardo Habkost authored
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>
-
Eduardo Habkost authored
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>
-
Paolo Bonzini authored
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>
-