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
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
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
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: fix style
Before splitting op_helper.c and helper.c in the next patches,fix style issues. No functional changes.
Replace also GCC specific FUNCTION withstandard func.
Don't init static variable (cpu_s390x_init:inited) with 0.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>...
target-s390x: split FPU ops
Move floating point instructions to fpu_helper.c.
While exporting some condition code helpers,avoid duplicate identifier conflict with translate.c.
Remove unused set_cc_nz_f64() in translate.c.
target-s390x: split condition code helpers
Move condition code helpers to cc_helper.c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Alexander Graf <agraf@suse.de>
target-s390x: split integer helpers
Move integer helpers to int_helper.c.
target-s390x: split memory access helpers
Move memory access helpers to mem_helper.c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>[agraf: fold softmmu include ifdefs together]Signed-off-by: Alexander Graf <agraf@suse.de>
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.
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.
kvm: Clean up irqfd API
No need to expose the fd-based interface, everyone will already be finewith the more handy EventNotifier variant. Rename the latter to clarifythat we are still talking about irqfds here.
qemu: Use valgrind annotations to mark kvm guest memory as defined
valgrind with kvm produces a big amount of false positives regarding"Conditional jump or move depends on uninitialised value(s)". Thishappens because the guest memory is allocated with qemu_vmalloc which...
musicpal: Fix flash mapping
The old arithmetic assumed 32 physical address bits which is no longertrue for ARM since 3cc0cd61f4.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add MAINTAINERS entry for leon3
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-sparc: fix fcmp{s,d,q} instructions wrt exception
fcmp{s,d,q} instructions are supposed to ignore quiet NaN (contrary tothe fcmpe{s,d,q} instructions), but the current code is wrongly settingthe NV exception in that case. Moreover the current code is duplicated:...
target-xtensa: fix missing errno codes for mingw32
Put the following errno value mappings under #ifdef:
xtensa-semi.c: In function 'errno_h2g':xtensa-semi.c:113: error: 'ENOTBLK' undeclared (first use in this function)xtensa-semi.c:113: error: (Each undeclared identifier is reported only once...
target-cris: Fix buffer overflow
target-cris/translate.c:3464 cpu_dump_state(32) error: buffer overflow 'env->sregs' 4 <= 255
sregs is declared 'uint32_t sregs4[16]', so the first index must beless than 4 or ARRAY_SIZE(env->sregs)....
MIPS/user: Fix reset CPU state initialization
This change updates the CPU reset sequence to use a common piece of codethat figures out CPU state flags, fixing the problem with MIPS_HFLAG_COP1Xnot being set where applicable that causes floating-point MADD family...
lan9118: fix multicast filtering
The lan9118 emulation tries to compute the multicast index by callingdirectly the crc32() function from zlib, but fails to get the correctresult.
Use the common compute_mcast_idx() function instead, which gives thecorrect result. This fixes IPv6 support....
fix entry pointer for ELF kernels loaded with -kernel option
Find a hopefully proper patch attached. Take it or leave it.
Reviewed-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Henning Schild <henning@hennsch.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vhost: Pass device path to vhost_dev_init()
The path to /dev/vhost-net is currently hardcoded in vhost_dev_init().This needs to be changed so that /dev/vhost-scsi can be used. Pass inthe device path instead of hardcoding it.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
monitor: Rename+move net_handle_fd_param -> monitor_handle_fd_param
This patch renames+moves the net_handle_fd_param() caller used toobtain a file descriptor from either qemu_parse_fd() (the normal case)or from monitor_get_fd() (migration case) into a generically prefixed...
qemu: add .exrc
I've been using this to get correct indenting with vimin qemu for a while, but it's a bit easier if weput the settings in the central place.Note that1. you still need to enable 'exrc' and 'secure' options in your vimrc for these settings to take effect....
pcie: drop version_id field for live migration
While testing q35 live migration, I found that the migration would abort withthe following error: "Unknown savevm section type 76".
The error is due to this check failing in 'vmstate_load_state()':
while(field->name) {...
pcie_aer: clear cmask for Advanced Error Interrupt Message Number
The Advanced Error Interrupt Message Number (bits 31:27 of the RootError Status Register) is updated when the number of msi messages assigned to adevice changes. Migration of windows 7 on q35 chipset failed because the check...
hw/pl110: Fix spelling of 'palette'
Fix the spelling of 'palette' used in various local variables,structure members and comments.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-xtensa: convert host errno values to guest
Guest errno values are taken from the newlib. Convert only those errnovalues that can be returned from used system calls.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
CHECKPATCH: Add --debug adv_dcs
Add debug options to find this issue. They were not listedin the help because the are not simple to understand the output of.
Signed-off-by: Don Slutz <Don@CloudSwitch.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
CHECKPATCH: Add --debug adv_checking
CHECKPATCH: Add --debug adv_apw
CHECKPATCH: Add warning for single else statement.
For an example:
WARNING: braces {} are necessary even for single statement blocks+ } else+ return env->regs[R_EAX];
total: 0 errors, 1 warnings, 41 lines checkedSigned-off-by: Don Slutz <Don@CloudSwitch.com>...
omap_lcdc: omap_ppm_save(): add error handling
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
g364fb: g364fb_screen_dump(): add error handling
tcx: tcx24_screen_dump(): add error handling
tcx: tcx_screen_dump(): add error handling