aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-01-07uhci: Fix pending interrupts getting lost on migrationHans de Goede1-1/+2
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07uhci: Fix 1 ms delay in interrupt reporting to the guestHans de Goede1-11/+13
Re-arrange how we process frames / increase frnum / report pending interrupts, to avoid a 1 ms delay in interrupt reporting to the guest. This increases the packet throughput for cases where the guest submits a single packet, then waits for its completion then re-submits from 500 pkts / sec to 1000 pkts / sec. This impacts for example the use of redirected / virtual usb to serial convertors. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Don't call commit_irq after raising PCDHans de Goede1-2/+0
ehci_raise_irq(s, USBSTS_PCD), gets applied immediately so there is no need to call commit_irq after it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Further speedup rescanning if async schedule after raising an interruptHans de Goede1-1/+4
I tried lowering the time between raising an interrupt and rescanning the async schedule to see if the guest has queued a new transfer before, but that did not have any positive effect. I now believe the cause for this is that lowering this time made it more likely to hit the 1 ms interrupt threshold penalty for the next packet, as described in my "ehci: Use uframe precision for interrupt threshold checking" commit. Now that we do interrupt threshold handling with uframe precision, futher lowering this time from .5 to .25 ms gives an extra 15% improvement in speed (MB/s) reading from a simple USB-2.0 thumb-drive. While at it also properly set the int_req_by_async flag for short packet completions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Use uframe precision for interrupt threshold checking (v2)Hans de Goede1-23/+47
Before this patch, the following could happen: 1) Transfer completes, raises interrupt 2) .5 ms later we check if the guest has queued up any new transfers 3) We find and execute a new transfer 4) .2 ms later the new transfer completes 5) We re-run our frame_timer to write back the completion, but less then 1 ms has passed since our last run, so frindex is not changed, so the interrupt threshold code delays the interrupt 6) 1 ms from the re-run our frame-timer runs again and finally delivers the interrupt This leads to unnecessary large delays of interrupts, this code fixes this by changing frindex to uframe precision and using that for interrupt threshold control, making the interrupt fire at step 5 for guest which have low interrupt threshold settings (like Linux). Note that the guest still sees the frindex move in steps of 8 for migration compatibility. This boosts Linux read speed of a simple cheap USB thumb drive by 6 %. Changes in v2: -Make the guest see frindex move in steps of 8 by modifying ehci_opreg_read, rather then using a shadow variable Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Verify a queue's ep direction does not changeHans de Goede2-0/+20
ehci_fill_queue assumes that there is a one on one relationship between an ep and a qh, this patch adds a check to ensure this. Note I don't expect this to ever trigger, this is just something I noticed the guest might do while working on other stuff. The only way this check can trigger is if a guest mixes in and out qtd-s in a single qh for a non control ep. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Add an ehci_get_pid helper functionHans de Goede1-16/+16
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Verify qtd for async completed packetsHans de Goede1-14/+1
Remove the short-circuiting of fetchqtd in fetchqh, so that the qtd gets properly verified before completing the transaction. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: writeback_async_complete_packet: verify qh and qtdHans de Goede1-0/+14
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Move get / put_dwords upwardsHans de Goede1-42/+42
No other changes. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Verify guest does not change the token of inflight qtd-sHans de Goede1-6/+4
This is not allowed, except for clearing active on cancellation, so don't warn when the new token does not have its active bit set. This unifies the cancellation path for modified qtd-s, and prepares ehci_verify_qtd to be used ad an extra check inside ehci_writeback_async_complete_packet(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Add ehci_verify_qh and ehci_verify_qtd helper functionsHans de Goede1-16/+35
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Add a ehci_writeback_async_complete_packet helper functionHans de Goede1-11/+17
Also drop the warning printf, which was there mainly because this was an untested code path (as the previous bug fixes to it show), but that no longer is the case now :) Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07rtl8139: preserve link state across device resetAmos Kong1-1/+2
A device reset does not affect the link state, only set_link does. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-07e1000: no need auto-negotiation if link was downAmos Kong1-0/+5
Commit b9d03e352cb6b31a66545763f6a1e20c9abf0c2c added link auto-negotiation emulation, it would always set link up by callback function. Problem exists if original link status was down, link status should not be changed in auto-negotiation. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-07net: clean up network at qemu process terminationAmos Kong1-1/+3
We don't clean up network if fails to parse "-device" parameters without calling net_cleanup(). I touch a problem, the tap device which is created by qemu-ifup script could not be removed by qemu-ifdown script. Some similar problems also exist in vl.c In this patch, if network initialization successes, a cleanup function will be registered to be called at qemu process termination. Signed-off-by: Amos Kong <akong@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-07e1000: Discard oversized packets based on SBP|LPEMichael Contreras1-2/+5
Discard packets longer than 16384 when !SBP to match the hardware behavior. Signed-off-by: Michael Contreras <michael@inetric.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-06Revert "virtio-pci: replace byte swap hack"Blue Swirl2-1/+34
This reverts commit 9807caccd605d09a72495637959568d690e10175. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-06virtio-pci: replace byte swap hackBlue Swirl2-34/+1
Remove byte swaps by declaring the config space as native endian. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-06tests: add gcov supportBlue Swirl3-1/+64
Add support for compiling for GCOV test coverage, enabled with '--enable-gcov' during configure. Test coverage will be reported after each test. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-05hw/i386: Fix broken build for non POSIX hostsStefan Weil1-0/+5
pc-testdev.c cannot be compiled with MinGW (and other non POSIX hosts): CC i386-softmmu/hw/i386/../pc-testdev.o qemu/hw/i386/../pc-testdev.c:38:22: warning: sys/mman.h: file not found qemu/hw/i386/../pc-testdev.c: In function ‘test_flush_page’: qemu/hw/i386/../pc-testdev.c:103: warning: implicit declaration of function ‘mprotect’ ... Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-05softfloat: Implement uint64_to_float128Richard Henderson2-0/+11
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-05softfloat: Fix uint64_to_float64Richard Henderson1-3/+10
The interface to normalizeRoundAndPackFloat64 requires that the high bit be clear. Perform one shift-right-and-jam if needed. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-04Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori6-11/+11
* stefanha/trivial-patches: spice: drop incorrect vm_change_state_handler() opaque linux-user/syscall.c: remove forward declarations hw/mcf5206: Reduce size of lookup table Remove --sparc_cpu option from the configure list pseries: Remove unneeded include statement (fixes MinGW builds) pc_sysfw: Check for qemu_find_file() failure Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-04Merge remote-tracking branch 'kraxel/testdev.1' into stagingAnthony Liguori5-49/+283
* kraxel/testdev.1: pc: remove bochs bios debug ports hw: Add test device for unittests execution add isa-debug-exit device. switch debugcon to memory api Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-04Merge remote-tracking branch 'kraxel/acpi.2' into stagingAnthony Liguori9-11/+48
* kraxel/acpi.2: apci: assign memory regions to ich9 lpc device apci: assign memory regions to piix4 acpi device acpi: autoload dsdt configure: also symlink *.aml files Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-04spice: drop incorrect vm_change_state_handler() opaqueStefan Hajnoczi1-3/+2
The spice_server pointer is a global variable and vm_change_state_handler() therefore does not use its opaque parameter. The vm change state handler is added with a pointer to the spice_server pointer. This is useless and we probably would not want 2 levels of pointers. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Uri Lublin <uril@redhat.com>
2013-01-04linux-user/syscall.c: remove forward declarationsJohn Spencer1-5/+3
instead use the correct headers that define these functions. Requested-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: John Spencer <maillist-qemu@barfooze.de> Reviewed-by: Amos Kong <kongjianjun@gmail.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-04hw/mcf5206: Reduce size of lookup tableStefan Weil1-1/+1
This typically reduces the size from 512 bytes to 128 bytes. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-04Remove --sparc_cpu option from the configure list陳韋任 (Wei-Ren Chen)1-1/+0
commit 9b9c37c36439ee0452632253dac7a31897f27f70 always assume sparcv9, the others are no longer supported. Remove --sparc_cpu option from the configure list. Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-04pseries: Remove unneeded include statement (fixes MinGW builds)Stefan Weil1-1/+1
sys/mman.h is not needed (tested on Linux) and unavailable for MinGW, so remove it. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-04pc_sysfw: Check for qemu_find_file() failureMarkus Armbruster1-0/+4
pc_fw_add_pflash_drv() ignores qemu_find_file() failure, and happily creates a drive without a medium. When pc_system_flash_init() asks for its size, bdrv_getlength() fails with -ENOMEDIUM, which isn't checked either. It fails relatively cleanly only because -ENOMEDIUM isn't a multiple of 4096: $ qemu-system-x86_64 -S -vnc :0 -bios nonexistant qemu: PC system firmware (pflash) must be a multiple of 0x1000 [Exit 1 ] Fix by handling the qemu_find_file() failure. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-04pc: remove bochs bios debug portsGerd Hoffmann1-41/+0
Prehistoric leftover, zap it. We poweroff via acpi these days. And having a port (0x501,0x502) where any random guest write will make qemu exit -- with no way to turn it off -- is a bad joke anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-04hw: Add test device for unittests executionLucas Meneghel Rodrigues2-0/+183
Add a test device which supports the kvmctl ioports, so one can run the KVM unittest suite. Intended Usage: qemu-system-x86_64 -nographic \ -device pc-testdev \ -device isa-debug-exit,iobase=0xf4,iosize=0x04 \ -kernel /path/to/kvm/unittests/msr.flat Where msr.flat is one of the KVM unittests, present on a separate repo, git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git [ kraxel: more memory api + qom fixes ] CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-04add isa-debug-exit device.Gerd Hoffmann2-1/+76
When present it makes qemu exit on any write. Mapped to port 0x501 by default. Without this patch Anthony doesn't allow me to remove the bochs bios debug ports because his test suite uses this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-04switch debugcon to memory apiGerd Hoffmann1-7/+24
Also some QOM glue while being at it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-04apci: assign memory regions to ich9 lpc deviceGerd Hoffmann3-4/+8
Get rid of get_system_io() usage. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-04apci: assign memory regions to piix4 acpi deviceGerd Hoffmann1-7/+13
Get rid of get_system_io() usage. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-04acpi: autoload dsdtGerd Hoffmann4-0/+26
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-04configure: also symlink *.aml filesGerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-03pty: unbreak libvirtGerd Hoffmann1-4/+5
Commit 586502189edf9fd0f89a83de96717a2ea826fdb0 breaks libvirt pty support because it tried to figure the pts name from stderr output. Fix this by moving the label to the end of the line, this way the libvirt parser does still recognise the message. libvirt looks for "char device redirected to ${ptsname}<whitespace>". Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-03dataplane: use linux-headers/ for virtio includesStefan Hajnoczi2-4/+3
The hw/dataplane/vring.c code includes linux/virtio_ring.h. Ensure that we use linux-headers/ instead of the system-wide headers, which may be out-of-date on older distros. This resolves the following build error on Debian 6: CC hw/dataplane/vring.o cc1: warnings being treated as errors hw/dataplane/vring.c: In function 'vring_enable_notification': hw/dataplane/vring.c:71: error: implicit declaration of function 'vring_avail_event' hw/dataplane/vring.c:71: error: nested extern declaration of 'vring_avail_event' hw/dataplane/vring.c:71: error: lvalue required as left operand of assignment Note that we now build dataplane/ for each target instead of only once. There is no way around this since linux-headers/ is only available for per-target objects - and it's how virtio, vfio, kvm, and friends are built. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-02configure: Write new file "config-all-disas.mak" when running configureStefan Weil1-0/+2
Incremental builds added new lines to that file each time when configure was run. Now a new file with a comment line is written. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-02tci: Fix broken builds with TCG interpreterStefan Weil2-3/+4
TCI no longer compiled after commit 76cad71136b7eb371cf2a2a4e1621cfe8d9c769a. The TCI disassembler depends on data structures which are different for each QEMU target, so it cannot be compiled as a universal-obj today. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-02savevm.c: cleanup system includesMichael Tokarev1-39/+1
savevm.c suffers from the same problem as some other files. Some years ago savevm.c was created from vl.c, moving some code from there into a separate file. At that time, all includes were just copied from vl.c to savevm.c, without checking which ones are needed and which are not. But actually most of that stuff is _not_ needed. More, some stuff is wrong, for example, *BSD #ifdef'ery around <util.h> vs <libutil.h> - for one, it fails to build on Debian/kFreebsd. Just remove all this. Maybe there's a possibility to clean it up further - like removing <windows.h> (and maybe including winsock.h for htons etc), and maybe it's possible to remove some internal #includes too, but I didn't check this. While at it, remove duplicate #include of qemu/timer.h. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-02disallow -daemonize usage of stdio (curses display, -nographic, -serial ↵Michael Tokarev2-3/+29
stdio etc) Curses display requires stdin/out to stay on the terminal, so -daemonize makes no sense in this case. Instead of leaving display uninitialized like is done since 995ee2bf469de6bb, explicitly detect this case earlier and error out. -nographic can actually be used with -daemonize, by redirecting everything to a null device, but the problem is that according to documentation and historical behavour, -nographic redirects guest ports to stdin/out, which, again, makes no sense in case of -daemonize. Since -nographic is a legacy option, don't bother fixing this case (to allow -nographic and -daemonize by redirecting guest ports to null instead of stdin/out in this case), but disallow it completely instead, to stop garbling host terminal. If no display display needed and user wants to use -nographic, the right way to go is to use -serial null -parallel null -monitor none -display none -vga none instead of -nographic. Also prevent the same issue -- it was possible to get garbled host tty after -nographic -daemonize and it is still possible to have it by using -serial stdio -daemonize Fix this by disallowing opening stdio chardev when -daemonize is specified. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-02Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori27-29/+1863
* stefanha/block: sheepdog: pass oid directly to send_pending_req() sheepdog: don't update inode when create_and_write fails block/raw-win32: Fix compiler warnings (wrong format specifiers) qemu-img: report size overflow error message cutils: change strtosz_suffix_unit function virtio-blk: Return UNSUPP for unknown request types virtio-blk: add x-data-plane=on|off performance feature dataplane: add virtio-blk data plane code virtio-blk: restore VirtIOBlkConf->config_wce flag iov: add qemu_iovec_concat_iov() test-iov: add iov_discard_front/back() testcases iov: add iov_discard_front/back() to remove data dataplane: add Linux AIO request queue dataplane: add event loop dataplane: add virtqueue vring code dataplane: add host memory mapping code configure: add CONFIG_VIRTIO_BLK_DATA_PLANE raw-posix: add raw_get_aio_fd() for virtio-blk-data-plane Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-02tcg: Remove unneeded assertionStefan Weil1-1/+0
Commit 7f6f0ae5b95adfa76e10eabe2c34424a955fd10c added two assertions. One of these assertions is not needed: The pointer ts is never NULL because it is initialized with the address of an array element. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-02sheepdog: pass oid directly to send_pending_req()Liu Yuan1-1/+1
Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-02sheepdog: don't update inode when create_and_write failsLiu Yuan1-4/+5
For the error case such as SD_RES_NO_SPACE, we shouldn't update the inode bitmap to avoid the scenario that the object is allocated but wasn't created at the server side. This will result in VM's IO error on the failed object. Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>