sheepdog: fix savevm and loadvm
This patch sets data to be sent to Sheepdog correctly and fixes savevmand loadvm operations on a Sheepdog image.
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ATAPI: STARTSTOPUNIT only eject/load media if powercondition is 0
The START STOP UNIT command will only eject/load media ifpower condition is zero.
If power condition is !0 then LOEJ and START will be ignored.
From MMC (sbc contains similar wordings too)...
ide: Fix error messages from static code analysis (no real error)
Report from smatch:hw/ide/core.c:1472 ide_exec_cmd(423) error: buffer overflow 'smart_attributes' 8 <= 29hw/ide/core.c:1474 ide_exec_cmd(425) error: buffer overflow 'smart_attributes' 8 <= 29...
block/curl: Fix wrong free statement
Report from smatch:block/curl.c:546 curl_close(21) info: redundant null check on s->url calling free()
The check was redundant, and free was also wrong because the memorywas allocated using g_strdup.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
Merge branch 'usb.64' of git://git.kraxel.org/qemu
tcg/optimize: fix if/else/break coding style
optimizer.c contains some cases were the break is appearing in both theif and the else parts. Fix that by moving it to the outer part. Alsomove some common code there.
Reviewed-by: Richard Henderson <rth@twiddle.net>...
tcg/optimize: add constant folding for brcond
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/optimize: add constant folding for setcond
tcg/optimize: swap brcond/setcond arguments when possible
brcond and setcond ops are not commutative, but it's easy to compute thenew condition after swapping the arguments. Try to always put the constantargument in second position like for commutative ops, to help backends to...
tcg/optimize: simplify shift/rot r, 0, a => movi r, 0 cases
shift/rot r, 0, a is equivalent to movi r, 0.
tcg/optimize: simplify and r, a, 0 cases
and r, a, 0 is equivalent to a movi r, 0.
tcg/optimize: simplify or/xor r, a, 0 cases
or/xor r, a, 0 is equivalent to a mov r, a.
tcg/optimize: split expression simplification
Split expression simplification in multiple parts so that a given opcan appear multiple times. This patch should not change anything.
tcg: improve profiler
Now that there are two passes of optimization (optimize.c, liveness)there is no point of outputing the statistics of the liveness partonly. Update the code to take into account both optimizations.
xhci: add msix support
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
xhci: move register update into xhci_intr_raise
Now that we have a separate function to raise an IRQ we can movesome comon code into the function.
xhci: add XHCIInterrupter
Move all state belonging to the (single) interrupter into a separatestruct. First step in adding support for multiple interrupters.
xhci: prepare xhci_runtime_{read,write} for multiple interrupters
Prepare xhci runtime register access function for multiple interrupters.
xhci: pick target interrupter
Pick the correct interrupter when queuing an event.
xhci: support multiple interrupters
Everything is in place, flip the big switch nowand enable support for multiple interrupters.
xhci: kill xhci_mem_{read,write} dispatcher functions
... and register subregions instead, so we offload the dispatchingto the the memory subsystem which is designed to handle it.
xhci: allow bytewise capability register reads
Some guests need this according toAlejandro Martinez Ruiz <alex@securiforest.com>
xhci: drop buffering
This patch splits the xhci_xfer_data function into three.The xhci_xfer_data function used to do does two things:
(1) copy transfer data between guest memory and a temporary buffer. (2) report transfer results to the guest using events....
xhci: move device lookup into xhci_setup_packet
xhci: implement mfindex
Implement mfindex register and mfindex wrap event.
xhci: iso xfer support
Add support for iso transfers.
xhci: trace cc codes in cleartext
xhci: add trace_usb_xhci_ep_set_dequeue
xhci: fix runtime write tracepoint
xhci: update register layout
Change the register layout to be a bit more sparse and also not dependon the number of ports. Useful when for making the number of portsruntime-configurable.
xhci: update port handling
This patch changes the way xhci ports are linked to USBPorts. The fixed1:1 relationship between xhci ports and USBPorts is gone. Now eachUSBPort represents a physical plug which has usually two xhci portsassigned: one usb2 and ond usb3 port. usb devices show up at one or the...
usb3: superspeed descriptors
Add superspeed descriptor entry to USBDesc,advertise superspeed support when present.
usb3: superspeed endpoint companion
Add support for building superspeed endpoint companion descriptors,create them for superspeed usb devices.
usb3: bos decriptor
Add support for creating BOS descriptor anddevice cappability descriptors.
usb-storage: usb3 support
Add usb3 descriptors to usb-storage, so it shows up as superspeeddevice when connected to xhci.
xhci: fix & cleanup msi.
Drop custom write_config function which isn't needed any more.Make the msi property a bit property so it accepts 'on' & 'off'.Enable MSI by default.
TODO: add compat property to disable on old machine types.
xhci: rework interrupt handling
Split xhci_irq_update into a function which handles intx updates(including lowering the irq line once the guests acks the interrupt)and one which is used for raising an irq only.
usb-redir: Don't delay handling of open events to a bottom half
There is no need for this, and doing so means that a backend trying towrite immediately after an open event will see qemu_chr_be_can_writereturning 0, which not all backends handle well as there is no wakeup...
usb-redir: Get rid of async-struct get member
This is a preparation patch for completely getting rid of the async-packetstruct in usb-redir, instead relying on the (new) per ep queues in theqemu usb core.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
usb-redir: Get rid of local shadow copy of packet headers
The shadow copy only serves as an extra check (besides the packet-id) toensure the packet we get back is a reply to the packet we think it is.
This check has never triggered in all the time usb-redir is in use now,...
usb-redir: Get rid of unused async-struct dev member
usb-redir: Move to core packet id and queue handling
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-redir: Return babble when getting more bulk data then requested
Babble is the appropriate error in this case (rather then signalling a stall).
usb-redir: Convert to new libusbredirparser 0.5 API
This gives us support for 64 bit ids which is needed for using XHCI withthe new hcd generated ids.
usb-redir: Set ep max_packet_size if available
This is needed for usb-redir to work properly with the xhci emulation.
usb-redir: Add a usbredir_reject_device helper function
usb-redir: Ensure our peer has the necessary caps when redirecting to XHCI
In order for redirection to work properly when redirecting to an emulatedXHCI controller, the usb-redir-host must support bothusb_redir_cap_ep_info_max_packet_size and usb_redir_cap_64bits_ids,...
usb-redir: Enable pipelining for bulk endpoints
Better name usb braille device
Windows users need to know that they have to use the Baum driver to makethe qemu braille device work.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-audio: fix usb version
usb-audio is a full speed (1.1) device,but bcdUSB claims it is usb 2.0. Fix it.
xhci: rip out background transfer code
original xhci code (the one which used libusb directly) used to use'background transfers' for iso streams. In upstream qemu the isostream buffering is handled by usb-host & usb-redir, so we willnever ever need this. It has been left in as reference, but is dead...
usb-core: Add a usb_ep_find_packet_by_id() helper function
usb-core: Allow the first packet of a pipelined ep to complete immediately
This can happen with usb-redir live-migration when the packet gets re-queuedafter the migration and the original queuing from the migration source sidehas already finished.
Revert "ehci: don't flush cache on doorbell rings."
This reverts commit 9bc3a3a216e2689bfcdd36c3e079333bbdbf3ba0, which gotadded to fix an issue where the real, underlying cause was not stoppingthe ep queue on an error.
Now that the underlying cause is fixed by the "usb: Halt ep queue and...
ehci: Validate qh is not changed unexpectedly by the guest
-combine the qh check with the check for devaddr changes-also ensure that p gets set to NULL when the queue gets cancelled on devaddr change, which was not done properly before this patch
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ehci: Update copyright headers to reflect recent work
Update copyright headers to reflect all the work Gerd and I have been doingon the EHCI emulation.
ehci: Properly cleanup packets on cancel
ehci: Properly report completed but not yet processed packets to the guest
Reported packets which have completed before being cancelled as such to thehost. Note that the new code path this patch adds is untested since it I'vebeen unable to actually trigger the race which needs this code path....
ehci: check for EHCI_ASYNC_FINISHED first in ehci_free_packet
Otherwise we'll see the packet free twice in the trace log even thoughit actually happens only once.
ehci: trace guest bugs
make qemu_queue_{cancel,reset} return the number of packets released,so the caller can figure whenever there have been active packets eventhough there shouldn't have been any. Add tracepoint to log this.
ehci: add doorbell trace events
ehci: Add some additional ehci_trace_guest_bug() calls
ehci: Fix memory leak in handling of NAK-ed packets
Currently each time we try to execute a NAK-ed packet we redoehci_init_transfer, and usb_packet_map, re-allocing (without freeing) thesg list every time.
This patch fixes this, it does this by introducing another async state, so...
ehci: Handle USB_RET_PROCERR in ehci_fill_queue
USB_RET_PROCERR can be triggered by the guest (by for example requesting morethen BUFFSIZE bytes), so don't assert on it.
ehci: Correct a comment in fetchqtd packet processing
Since my previous comment said "Should never happen", I tried changing thenext line to an assert(0), which did not go well, which as the new commentsexplains is logical if you think about it for a moment....
usb-redir: Never return USB_RET_NAK for async handled packets
USB_RET_NAK is not a valid response for async handled packets (and willtrigger an assert as such).
Also drop the warning when receiving a status of cancelled for packets notcancelled by qemu itself, this can happen when a device gets unredirected...
usb: controllers do not need to check for babble themselves
If an (emulated) usb-device tries to write more data to a packet thenits iov len, this will trigger an assert in usb_packet_copy(), and ifa driver somehow circumvents that check and writes more data to the...
usb-core: Don't set packet state to complete on a nak
This way the hcd can re-use the same packet to retry without needingto re-init it.
Add ability to force enable/disable of tools build
The qemu-img, qemu-nbd and qemu-io tools are built conditionallybased on whether any softmmu target is enabled. These are usefulself-contained tools which can be used in many other scenarios.Add new --enable-tools/--disable-tools args to configure to allow...
Add ability to disable build of all targets
Allow passing of '--target-list=' to configure to request thatall targets are to be disabled. This allows for doing a veryfast tools-only build of things like qemu-img, qemu-io, qemu-nbd.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>...
RTC: Remove the logic to update time format when DM bit changed
Changing the DM (binary/BCD) and 24/12 control bit doesn't affect the internalregisters. It only indicates what format is used for those registers.
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>...
RTC: Rename rtc_timer_update
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
RTC: introduce RTC_CLOCK_RATE
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
RTC: Update interrupt state when interrupts are masked/unmasked
If an interrupt flag is already set when the interrupt becomes enabled,raise an interrupt immediately, and vice versa if interrupts becomedisabled.
vmstate: add VMSTATE_TIMER_V
Also, for consistency with other occurrences, implement VMSTATE_TIMERas a special case of VMSTATE_TIMER_V rather than VMSTATE_TIMER_TEST.
RTC: Update the RTC clock only when reading it
Calculate guest RTC based on the time of the last update, instead ofusing timers. The formula is
(base_rtc + guest_time_now - guest_time_last_update + offset)
Base_rtc is the RTC value when the RTC was last updated....
RTC: Add divider reset support
The first update cycle begins one-half seconds after dividerreset is removed. This feature is useful for testing.
RTC: Do not fire timer periodically to catch next alarm
This patch limits further the usage of a periodic timer. It computes thetime of the next alarm, and uses it to skip all intermediate occurrencesof the timer.
Cc: Yang Zhang <yang.z.zhang@intel.com>...
RTC: Get and set time without going through s->current_tm
This patch makes rtc_set_time and rtc_set_cmos work without readings->current_tm. In the case of rtc_set_time I introduce a newfunction that retrieves the time and stores into a given struct tm...
RTC: Remove the current_tm field
This is not used anymore and only written to.
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
use --libexecdir instead of ignoring it first and reinventing it later
Commit 7b93fadf3a38d1ed65ea5536a52efc2772c6e3b8 "Add basic versionof bridge helper" put the bridge helper executable into a fixed${prefix}/libexec/ location, instead of using ${libexecdir} for...
socket: don't attempt to reconnect a TCP socket in server mode
Commit c3767ed0eb5d0bb25fe409ae5dec06e3411ff1b6 introduced a possible SEGV whenusing a socket chardev with server=on because it assumes that all TCP socketsare in client mode.
This patch adds a check to only reconnect when in client mode....
Merge branch 'spice.v59' of git://anongit.freedesktop.org/spice/qemu
Merge branch 'queue/qmp' of git://repo.or.cz/qemu/qmp-unstable
hw/mcf5206: Fix buffer overflow for MBAR read / write
Report from smatch:
mcf5206.c:384 m5206_mbar_readb(7) error: buffer overflow 'm5206_mbar_width' 128 <= 128mcf5206.c:403 m5206_mbar_readw(8) error: buffer overflow 'm5206_mbar_width' 128 <= 128mcf5206.c:427 m5206_mbar_readl(8) error: buffer overflow 'm5206_mbar_width' 128 <= 128...
target-arm: Fix potential buffer overflow
target-arm/helper.c:651 arm946_prbs_read(6) error: buffer overflow 'env->cp15.c6_region' 8 <= 8target-arm/helper.c:661 arm946_prbs_write(6) error: buffer overflow 'env->cp15.c6_region' 8 <= 8...
hw/wm8750: Fix potential buffer overflow
hw/wm8750.c:369 wm8750_tx(12) error: buffer overflow 's->i2c_data' 2 <= 2
It looks like the preprocessor statements were simply misplaced.
Replace also FUNCTION by func to please checkpatch.pl....
kvm: i386: Add classic PCI device assignment
This adds PCI device assignment for i386 targets using the classic KVMinterfaces. This version is 100% identical to what is being maintainedin qemu-kvm for several years and is supported by libvirt as well. It is...
kvm: i386: Add services required for PCI device assignment
These helpers abstract the interaction of upcoming pci-assign with theKVM kernel services. Put them under i386 only as other archs willimplement device pass-through via VFIO and not this classic interface....
kvm: Introduce kvm_has_intx_set_mask
Will be used by PCI device assignment code.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Acked-by: Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm: Introduce kvm_irqchip_update_msi_route
This service allows to update an MSI route without releasing/reacquiringthe associated VIRQ. Will be used by PCI device assignment, later onlikely also by virtio/vhost and VFIO.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
target-s390x: avoid AREG0 for misc helpers
Make misc helpers take a parameter for CPUState insteadof relying on global env.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>[agraf: fix conflict]Signed-off-by: Alexander Graf <agraf@suse.de>
target-s390x: switch to AREG0 free mode
Add an explicit CPUState parameter instead of relying on AREG0.
Remove temporary wrappers and switch to AREG0 free mode.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>[agraf: fix conflicts]Signed-off-by: Alexander Graf <agraf@suse.de>
tcg/s390: fix ld/st with CONFIG_TCG_PASS_AREG0
The load/store slow path has been broken in e141ab52d:- We need to move 4 registers for store functions and 3 registers for load functions and not the reverse.- According to the s390x calling convention the arguments of a function...
target-s390x: rename op_helper.c to misc_helper.c
Now op_helper.c contains miscellaneous helpers, renameit to misc_helper.c.
target-s390x: avoid AREG0 for FPU helpers
Make FPU helpers take a parameter for CPUState insteadof relying on global env.
Introduce temporary wrappers for FPU load and store ops.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Alexander Graf <agraf@suse.de>
target-s390x: avoid AREG0 for integer helpers
Make integer helpers take a parameter for CPUState insteadof relying on global env.
target-s390x: avoid AREG0 for condition code helpers
Make condition code helpers take a parameter for CPUState insteadof relying on global env.