sdk/emulator/qemu.git
11 years agokvm: remove unused APIs
Michael S. Tsirkin [Mon, 1 Apr 2013 21:05:21 +0000 (00:05 +0300)]
kvm: remove unused APIs

There are only used internally now, move them
out of header and out of stub.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
11 years agoqjson: to_json() case QTYPE_QSTRING is buggy, rewrite
Markus Armbruster [Thu, 11 Apr 2013 16:07:21 +0000 (18:07 +0200)]
qjson: to_json() case QTYPE_QSTRING is buggy, rewrite

Known bugs in to_json():

* A start byte for a three-byte sequence followed by less than two
  continuation bytes is split into one-byte sequences.

* Start bytes for sequences longer than three bytes get misinterpreted
  as start bytes for three-byte sequences.  Continuation bytes beyond
  byte three become one-byte sequences.

  This means all characters outside the BMP are decoded incorrectly.

* One-byte sequences with the MSB are put into the JSON string
  verbatim when char is unsigned, producing invalid UTF-8.  When char
  is signed, they're replaced by "\\uFFFF" instead.

  This includes \xFE, \xFF, and stray continuation bytes.

* Overlong sequences are happily accepted, unless screwed up by the
  bugs above.

* Likewise, sequences encoding surrogate code points or noncharacters.

* Unlike other control characters, ASCII DEL is not escaped.  Except
  in overlong encodings.

My rewrite fixes them as follows:

* Malformed UTF-8 sequences are replaced.

  Except the overlong encoding \xC0\x80 of U+0000 is still accepted.
  Permits embedding NUL characters in C strings.  This trick is known
  as "Modified UTF-8".

* Sequences encoding code points beyond Unicode range are replaced.

* Sequences encoding code points beyond the BMP produce a surrogate
  pair.

* Sequences encoding surrogate code points are replaced.

* Sequences encoding noncharacters are replaced.

* ASCII DEL is now always escaped.

The replacement character is U+FFFD.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agocheck-qjson: Test noncharacters other than U+FFFE, U+FFFF in strings
Markus Armbruster [Thu, 11 Apr 2013 16:07:20 +0000 (18:07 +0200)]
check-qjson: Test noncharacters other than U+FFFE, U+FFFF in strings

Test cases cover the two noncharacters in the BMP.  Add tests for the
other 64 noncharacters.

Three existing test cases involve noncharacters U+FFFF and U+10FFFF.
Instead of deleting them as now duplicates, adjust them to use U+FFFC
and U+10FFFFD.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agocheck-qjson: Improve a few comments, delete bogus ones
Markus Armbruster [Thu, 11 Apr 2013 16:07:19 +0000 (18:07 +0200)]
check-qjson: Improve a few comments, delete bogus ones

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agounicode: New mod_utf8_codepoint()
Markus Armbruster [Thu, 11 Apr 2013 16:07:18 +0000 (18:07 +0200)]
unicode: New mod_utf8_codepoint()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoMerge branch 'mingw' of git://qemu.weilnetz.de/qemu
Aurelien Jarno [Sat, 13 Apr 2013 12:31:54 +0000 (14:31 +0200)]
Merge branch 'mingw' of git://qemu.weilnetz.de/qemu

* 'mingw' of git://qemu.weilnetz.de/qemu:
  qemu-timer: move timeBeginPeriod/timeEndPeriod to os-win32
  Release SMP restriction on Windows
  Ensure good ordering of memory instruction in cpu_exec
  Check effective suspension of TCG thread

11 years agotarget-i386: add AES-NI instructions
Aurelien Jarno [Sun, 31 Mar 2013 10:58:31 +0000 (12:58 +0200)]
target-i386: add AES-NI instructions

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoaes: make Td[0-5] and Te[0-5] tables non static
Aurelien Jarno [Sun, 31 Mar 2013 10:58:31 +0000 (12:58 +0200)]
aes: make Td[0-5] and Te[0-5] tables non static

Remove static attribute to Td[0-5] and Te[0-5] tables so that they
can be used outside of aes.c. Change their type from u32 to uint32_t,
to keep the u32 udef local to aes.c. Prefix them with AES_ so that they
do not conflict with other symbols.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoaes: move aes.h from include/block to include/qemu
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
aes: move aes.h from include/block to include/qemu

Move aes.h from include/block to include/qemu to show it can be reused
by other subsystems.

Cc: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agodisas/i386.c: disassemble aes-ni instructions
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
disas/i386.c: disassemble aes-ni instructions

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: enable PCLMULQDQ on Westmere CPU
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
target-i386: enable PCLMULQDQ on Westmere CPU

The PCLMULQDQ instruction has been introduced on the Westmere CPU.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: add pclmulqdq instruction
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
target-i386: add pclmulqdq instruction

Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agodisas/i386.c: disassemble pclmulqdq instruction
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
disas/i386.c: disassemble pclmulqdq instruction

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agosh7750: Change cpu field type to SuperHCPU
Andreas Färber [Tue, 9 Apr 2013 14:51:24 +0000 (16:51 +0200)]
sh7750: Change cpu field type to SuperHCPU

This brings us a step closer to QOM'ified SH7750 SoC and
fixes b350ab75 (target-sh4: Move PVR/PRR/CVR into SuperHCPUClass)
assuming SuperHCPU type for SUPERH_CPU_GET_CLASS().

Fix Coding Style issues while at it (indentation, braces).

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoshix: Catch CPU initialization errors
Andreas Färber [Tue, 9 Apr 2013 14:51:23 +0000 (16:51 +0200)]
shix: Catch CPU initialization errors

Print an error message as done for the r2d machine and exit.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoMerge branch 'trivial-patches' of git://github.com/stefanha/qemu
Aurelien Jarno [Sat, 13 Apr 2013 11:50:34 +0000 (13:50 +0200)]
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu

* 'trivial-patches' of git://github.com/stefanha/qemu:
  cpu-exec: Allow "-d exec" in non-debug builds (drop CONFIG_DEBUG_EXEC)
  Typo, spelling and grammatical fixes
  linux-user: pass correct host flags to eventfd2 call
  target-moxie: Fix VMState registration

11 years agoMerge branch 'tci' of git://qemu.weilnetz.de/qemu
Aurelien Jarno [Sat, 13 Apr 2013 11:50:06 +0000 (13:50 +0200)]
Merge branch 'tci' of git://qemu.weilnetz.de/qemu

* 'tci' of git://qemu.weilnetz.de/qemu:
  tci: Make tcg temporaries local to tcg_qemu_tb_exec
  tci: Delete unused tb_ret_addr
  tci: Avoid code before declarations
  tci: Use a local variable for env
  tci: Use 32-bit signed offsets to loads/stores

11 years agoMerge branch 'tcg-s390' of git://github.com/rth7680/qemu
Aurelien Jarno [Sat, 13 Apr 2013 11:49:20 +0000 (13:49 +0200)]
Merge branch 'tcg-s390' of git://github.com/rth7680/qemu

* 'tcg-s390' of git://github.com/rth7680/qemu:
  tcg-s390: Fix merge error in tgen_brcond
  tcg-s390: Use all 20 bits of the offset in tcg_out_mem
  tcg-s390: Use load-address for addition
  tcg-s390: Cleanup argument shuffling fixme in softmmu code
  tcg-s390: Use risbgz for andi
  tcg-s390: Remove constraint letters for and
  tcg-s390: Implement deposit opcodes
  tcg-s390: Implement movcond opcodes
  tcg-s390: Implement mulu2_i64 opcode
  tcg-s390: Implement add2/sub2 opcodes
  tcg-s390: Remove useless preprocessor conditions
  tcg-s390: Properly allocate a stack frame.
  tcg-s390: Fix movi

11 years agoqemu-timer: move timeBeginPeriod/timeEndPeriod to os-win32
Paolo Bonzini [Wed, 20 Feb 2013 13:43:31 +0000 (14:43 +0100)]
qemu-timer: move timeBeginPeriod/timeEndPeriod to os-win32

These are needed for any of the Win32 alarm timer implementations.
They are not tied to mmtimer exclusively.

Jacob tested this patch with both mmtimer and Win32 timers.

Cc: qemu-stable@nongnu.org
Tested-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
11 years agoRelease SMP restriction on Windows
Fabien Chouteau [Tue, 9 Apr 2013 16:06:55 +0000 (18:06 +0200)]
Release SMP restriction on Windows

The previous patches make QEMU SMP safe on Windows, we can now release
the restriction.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
11 years agoEnsure good ordering of memory instruction in cpu_exec
Olivier Hainque [Tue, 9 Apr 2013 16:06:54 +0000 (18:06 +0200)]
Ensure good ordering of memory instruction in cpu_exec

The IO thread, when it senses cpu_single_env == 0, expects exit_request
to be checked later on. A compiler scheduling constraint is not strong
enough to ensure this on modern architecture. A memory fence is needed
as well.

Signed-off-by: Olivier Hainque <hainque@adacore.com>
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
11 years agoCheck effective suspension of TCG thread
Olivier Hainque [Tue, 9 Apr 2013 16:06:53 +0000 (18:06 +0200)]
Check effective suspension of TCG thread

On multi-core systems, SuspendThread does not guaranty immediate thread
suspension. We add busy loop to wait for effective thread suspension
after call to ThreadSuspend().

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
11 years agocpu-exec: Allow "-d exec" in non-debug builds (drop CONFIG_DEBUG_EXEC)
Peter Maydell [Thu, 11 Apr 2013 20:21:46 +0000 (21:21 +0100)]
cpu-exec: Allow "-d exec" in non-debug builds (drop CONFIG_DEBUG_EXEC)

The CONFIG_DEBUG_EXEC define compiles out a single qemu_log_mask()
call, which is a pretty trivial cost even for something in the main
cpu_exec() loop.  Having this be conditionally defined means that
'-d exec' on a non-debug build will silently do nothing.  Drop the
define and the configure machinery that sets it, in favour of just
always allowing this log option to be enabled at runtime.  As a
concession to the mainloopiness, we use qemu_loglevel_mask()+qemu_log()
rather than qemu_log_mask() to avoid the function call overhead.

Note that DEBUG_DISAS is always defined, so removing the
'|| defined(CONFIG_DEBUG_EXEC)' from those conditionals makes
no behavioural change for that logging.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoTypo, spelling and grammatical fixes
Peter Maydell [Tue, 9 Apr 2013 11:48:19 +0000 (12:48 +0100)]
Typo, spelling and grammatical fixes

Minor fixes to documentation and code comments.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agolinux-user: pass correct host flags to eventfd2 call
Petar Jovanovic [Mon, 8 Apr 2013 18:26:10 +0000 (20:26 +0200)]
linux-user: pass correct host flags to eventfd2 call

This change makes conversion of TARGET_O_NONBLOCK and TARGET_O_CLOEXEC flags
to host flags before calling eventfd for TARGET_NR_eventfd2.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotarget-moxie: Fix VMState registration
Peter Maydell [Mon, 8 Apr 2013 15:51:46 +0000 (16:51 +0100)]
target-moxie: Fix VMState registration

Register the CPU VMState in the correct way, via cpu_class_set_vmsd(),
rather than doing it in two different wrong ways (once by providing
cpu_save and cpu_load functions, and once by setting the vmsd field in
DeviceClass).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotci: Make tcg temporaries local to tcg_qemu_tb_exec
Richard Henderson [Thu, 28 Mar 2013 05:37:55 +0000 (05:37 +0000)]
tci: Make tcg temporaries local to tcg_qemu_tb_exec

We're moving away from the temporaries stored in env.  Make sure we can
differentiate between temp stores and possibly bogus stores for extra
call arguments.  Move TCG_AREG0 and TCG_REG_CALL_STACK out of the way
of the parameter passing registers.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off by: Stefan Weil <sw@weilnetz.de>

11 years agotci: Delete unused tb_ret_addr
Richard Henderson [Thu, 28 Mar 2013 05:37:54 +0000 (05:37 +0000)]
tci: Delete unused tb_ret_addr

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off by: Stefan Weil <sw@weilnetz.de>

11 years agotci: Avoid code before declarations
Richard Henderson [Thu, 28 Mar 2013 05:37:53 +0000 (05:37 +0000)]
tci: Avoid code before declarations

This only valid with c99 extensions enabled, and easy to avoid.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off by: Stefan Weil <sw@weilnetz.de>

11 years agotci: Use a local variable for env
Richard Henderson [Thu, 28 Mar 2013 05:37:52 +0000 (05:37 +0000)]
tci: Use a local variable for env

Since we have total conversion away from global AREG0, we do not
need a global variable named "env".  Retain that name as the
function parameter inside the interpreter.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off by: Stefan Weil <sw@weilnetz.de>

11 years agotci: Use 32-bit signed offsets to loads/stores
Richard Henderson [Thu, 28 Mar 2013 05:37:51 +0000 (05:37 +0000)]
tci: Use 32-bit signed offsets to loads/stores

Since the change to tcg_exit_req, the first insn of every TB is
a load with a negative offset from env.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off by: Stefan Weil <sw@weilnetz.de>

11 years agovirtio-9p: Fix virtio-9p no longer building after hw-dirs branch merge
Hans de Goede [Tue, 9 Apr 2013 08:22:35 +0000 (10:22 +0200)]
virtio-9p: Fix virtio-9p no longer building after hw-dirs branch merge

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1365495755-10902-1-git-send-email-hdegoede@redhat.com
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'bonzini/hw-dirs' into staging
Anthony Liguori [Mon, 8 Apr 2013 18:12:32 +0000 (13:12 -0500)]
Merge remote-tracking branch 'bonzini/hw-dirs' into staging

# By Paolo Bonzini
# Via Paolo Bonzini
* bonzini/hw-dirs: (35 commits)
  hw: move private headers to hw/ subdirectories.
  MAINTAINERS: update for source code movement
  hw: move last file to hw/arm/
  hw: move hw/kvm/ to hw/i386/kvm
  hw: move ARM CPU cores to hw/cpu/, configure with default-configs/
  hw: move other devices to hw/misc/, configure with default-configs/
  hw: move NVRAM interfaces to hw/nvram/, configure with default-configs/
  hw: move GPIO interfaces to hw/gpio/, configure with default-configs/
  hw: move interrupt controllers to hw/intc/, configure with default-configs/
  hw: move DMA controllers to hw/dma/, configure with default-configs/
  hw: move VFIO and ivshmem to hw/misc/
  hw: move PCI bridges to hw/pci-* or hw/ARCH
  hw: move SD/MMC devices to hw/sd/, configure with default-configs/
  hw: move timer devices to hw/timer/, configure with default-configs/
  hw: move ISA bridges and devices to hw/isa/, configure with default-configs/
  hw: move char devices to hw/char/, configure via default-configs/
  hw: move more files to hw/xen/
  hw: move SCSI controllers to hw/scsi/, configure via default-configs/
  hw: move SSI controllers to hw/ssi/, configure via default-configs/
  hw: move I2C controllers to hw/i2c/, configure via default-configs/
  ...

Message-id: 1365442249-18259-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/net' into staging
Anthony Liguori [Mon, 8 Apr 2013 18:12:25 +0000 (13:12 -0500)]
Merge remote-tracking branch 'stefanha/net' into staging

# By Dmitry Fleytman
# Via Stefan Hajnoczi
* stefanha/net:
  vmxnet3: const_cpu_to_le64 wrapping for feature bits dropped
  vmxnet3: iPXE compatibility fixes

Message-id: 1365435829-23535-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agohw: move private headers to hw/ subdirectories.
Paolo Bonzini [Mon, 18 Mar 2013 16:36:02 +0000 (17:36 +0100)]
hw: move private headers to hw/ subdirectories.

Many headers are used only in a single directory.  These can be
kept in hw/.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoMAINTAINERS: update for source code movement
Paolo Bonzini [Mon, 4 Feb 2013 14:19:30 +0000 (15:19 +0100)]
MAINTAINERS: update for source code movement

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move last file to hw/arm/
Paolo Bonzini [Wed, 27 Mar 2013 17:49:23 +0000 (18:49 +0100)]
hw: move last file to hw/arm/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move hw/kvm/ to hw/i386/kvm
Paolo Bonzini [Tue, 5 Feb 2013 15:36:44 +0000 (16:36 +0100)]
hw: move hw/kvm/ to hw/i386/kvm

Peter requested the KVM GIC to be in hw/intc.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move ARM CPU cores to hw/cpu/, configure with default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 15:36:44 +0000 (16:36 +0100)]
hw: move ARM CPU cores to hw/cpu/, configure with default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move other devices to hw/misc/, configure with default-configs/
Paolo Bonzini [Wed, 3 Apr 2013 16:06:08 +0000 (18:06 +0200)]
hw: move other devices to hw/misc/, configure with default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move NVRAM interfaces to hw/nvram/, configure with default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 15:36:44 +0000 (16:36 +0100)]
hw: move NVRAM interfaces to hw/nvram/, configure with default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move GPIO interfaces to hw/gpio/, configure with default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 15:36:44 +0000 (16:36 +0100)]
hw: move GPIO interfaces to hw/gpio/, configure with default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move interrupt controllers to hw/intc/, configure with default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 15:12:12 +0000 (16:12 +0100)]
hw: move interrupt controllers to hw/intc/, configure with default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move DMA controllers to hw/dma/, configure with default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 13:54:35 +0000 (14:54 +0100)]
hw: move DMA controllers to hw/dma/, configure with default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move VFIO and ivshmem to hw/misc/
Paolo Bonzini [Tue, 5 Feb 2013 14:41:36 +0000 (15:41 +0100)]
hw: move VFIO and ivshmem to hw/misc/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move PCI bridges to hw/pci-* or hw/ARCH
Paolo Bonzini [Tue, 5 Feb 2013 14:06:20 +0000 (15:06 +0100)]
hw: move PCI bridges to hw/pci-* or hw/ARCH

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move SD/MMC devices to hw/sd/, configure with default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 13:54:35 +0000 (14:54 +0100)]
hw: move SD/MMC devices to hw/sd/, configure with default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move timer devices to hw/timer/, configure with default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 13:38:25 +0000 (14:38 +0100)]
hw: move timer devices to hw/timer/, configure with default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move ISA bridges and devices to hw/isa/, configure with default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 13:13:04 +0000 (14:13 +0100)]
hw: move ISA bridges and devices to hw/isa/, configure with default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move char devices to hw/char/, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 12:35:34 +0000 (13:35 +0100)]
hw: move char devices to hw/char/, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move more files to hw/xen/
Paolo Bonzini [Tue, 5 Feb 2013 12:25:08 +0000 (13:25 +0100)]
hw: move more files to hw/xen/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move SCSI controllers to hw/scsi/, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 12:39:38 +0000 (13:39 +0100)]
hw: move SCSI controllers to hw/scsi/, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move SSI controllers to hw/ssi/, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 12:20:08 +0000 (13:20 +0100)]
hw: move SSI controllers to hw/ssi/, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move I2C controllers to hw/i2c/, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 12:07:03 +0000 (13:07 +0100)]
hw: move I2C controllers to hw/i2c/, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move display devices to hw/display/, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 11:59:04 +0000 (12:59 +0100)]
hw: move display devices to hw/display/, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move audio devices to hw/audio/, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 11:55:19 +0000 (12:55 +0100)]
hw: move audio devices to hw/audio/, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move block devices to hw/block/, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 11:55:04 +0000 (12:55 +0100)]
hw: move block devices to hw/block/, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move NICs to hw/net/, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 11:33:56 +0000 (12:33 +0100)]
hw: move NICs to hw/net/, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move MC146818RTC to hw/timer/, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 11:30:44 +0000 (12:30 +0100)]
hw: move MC146818RTC to hw/timer/, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move watchdogs to hw/watchdog, configure via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 11:27:44 +0000 (12:27 +0100)]
hw: move watchdogs to hw/watchdog, configure via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: make all of hw/pci/ configurable via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 13:46:43 +0000 (14:46 +0100)]
hw: make all of hw/pci/ configurable via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: make all of hw/usb/ configurable via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 11:23:23 +0000 (12:23 +0100)]
hw: make all of hw/usb/ configurable via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: make all of hw/ide/ configurable via default-configs/
Paolo Bonzini [Tue, 5 Feb 2013 11:22:39 +0000 (12:22 +0100)]
hw: make all of hw/ide/ configurable via default-configs/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move virtio devices to hw/ subdirectories
Paolo Bonzini [Tue, 5 Feb 2013 11:42:31 +0000 (12:42 +0100)]
hw: move virtio devices to hw/ subdirectories

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move target-independent files to subdirectories
Paolo Bonzini [Fri, 1 Mar 2013 12:59:19 +0000 (13:59 +0100)]
hw: move target-independent files to subdirectories

This patch tackles all files that are compiled once, moving
them to subdirectories of hw/.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomoxie: configure with default-configs file
Paolo Bonzini [Wed, 27 Mar 2013 17:54:12 +0000 (18:54 +0100)]
moxie: configure with default-configs file

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: make subdirectories for devices
Paolo Bonzini [Mon, 4 Feb 2013 10:59:48 +0000 (11:59 +0100)]
hw: make subdirectories for devices

Prepare the new directory structure.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: move headers to include/
Paolo Bonzini [Tue, 5 Feb 2013 16:06:20 +0000 (17:06 +0100)]
hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuild: enable using $(CONFIG_FOO) on the rhs of config files
Paolo Bonzini [Wed, 3 Apr 2013 15:53:21 +0000 (17:53 +0200)]
build: enable using $(CONFIG_FOO) on the rhs of config files

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoconfigure: Don't fall back to gthread coroutine backend
Peter Maydell [Mon, 8 Apr 2013 11:11:27 +0000 (12:11 +0100)]
configure: Don't fall back to gthread coroutine backend

The gthread coroutine backend is broken and does not produce a working
QEMU; it is only useful for some very limited debugging situations.
Clean up the backend selection logic in configure so that it now runs
"if on windows use windows; else prefer ucontext; else sigaltstack".

To do this we refactor the configure code to separate out "test
whether we have a working ucontext", "pick a default if user didn't
specify" and "validate that user didn't specify something invalid",
rather than having all three of these run together. We also simplify
the Makefile logic so it just links in the backend the configure
script selects.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1365419487-19867-3-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoconfigure: Provide and use convenience error reporting function
Peter Maydell [Mon, 8 Apr 2013 11:11:26 +0000 (12:11 +0100)]
configure: Provide and use convenience error reporting function

Provide a convenience function for reporting an error and exiting,
and update various places in the configure script to use it.
This allows us to be a little more consistent about how format
our error messages and makes the calling code shorter.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1365419487-19867-2-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-char: really fix behavior on can_read = 0
Paolo Bonzini [Mon, 8 Apr 2013 13:03:15 +0000 (15:03 +0200)]
qemu-char: really fix behavior on can_read = 0

I misread the glib manual, g_source_remove does not let you re-attach
the source later.  This behavior (called "blocking" the source in glib)
is present in glib's source code, but private and not available outside
glib; hence, we have to resort to re-creating the source every time.

In fact, g_source_remove and g_source_destroy are the same thing,
except g_source_destroy is O(1) while g_source_remove scans a potentially
very long list of GSources in the current main loop.  Ugh.  Better
use g_source_destroy explicitly, and leave "tags" to those dummies who
cannot track their pointers' lifetimes.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1365426195-12596-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'mdroth/qga-pull-4-2-13' into staging
Anthony Liguori [Mon, 8 Apr 2013 15:37:06 +0000 (10:37 -0500)]
Merge remote-tracking branch 'mdroth/qga-pull-4-2-13' into staging

# By Laszlo Ersek (2) and others
# Via Michael Roth
* mdroth/qga-pull-4-2-13:
  qemu-ga: ga_get_fd_handle(): abort if fd_counter overflows
  qga schema: document generic QERR_UNSUPPORTED
  qga schema: mark optional GuestLogicalProcessor.can-offline with #optional
  qga: add windows implementation for guest-set-time
  qga: add windows implementation for guest-get-time

11 years agoMerge remote-tracking branch 'kraxel/usb.79' into staging
Anthony Liguori [Mon, 8 Apr 2013 15:36:40 +0000 (10:36 -0500)]
Merge remote-tracking branch 'kraxel/usb.79' into staging

# By Gerd Hoffmann (7) and Hans de Goede (3)
# Via Gerd Hoffmann
* kraxel/usb.79:
  usb-tablet: Don't claim wakeup capability for USB-2 version
  usb: update docs for bus name change
  usb-hub: report status changes only once
  usb-hub: limit chain length
  xhci: zap unused name field
  xhci: remove unimplemented printfs
  xhci: remove leftover debug printf
  xhci: fix numintrs sanity checks
  usb-redir: Add flow control support
  usb-redir: Fix crash on migration with no client connected

11 years agovmxnet3: const_cpu_to_le64 wrapping for feature bits dropped
Dmitry Fleytman [Thu, 28 Mar 2013 08:53:30 +0000 (10:53 +0200)]
vmxnet3: const_cpu_to_le64 wrapping for feature bits dropped

Byte swap is redundant because shared memory reading functions
already swap bytes when required

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agovmxnet3: iPXE compatibility fixes
Dmitry Fleytman [Thu, 28 Mar 2013 08:53:29 +0000 (10:53 +0200)]
vmxnet3: iPXE compatibility fixes

iPXE vmxnet3 driver makes a few assumptions regarding device operation
that were missed during testing with Linux and Windows drivers.
This patch adds following logic:
  1. Additional GET commands processing added
  2. Max number of RX chunks should be set to 1 when driver passes 0
     via corresponding shared memory field
  3. Enforecement for max chunks number added

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoMerge branch 'arm-devs.next' of git://git.linaro.org/people/pmaydell/qemu-arm
Blue Swirl [Sat, 6 Apr 2013 12:53:54 +0000 (12:53 +0000)]
Merge branch 'arm-devs.next' of git://git.linaro.org/people/pmaydell/qemu-arm

* 'arm-devs.next' of git://git.linaro.org/people/pmaydell/qemu-arm:
  hw/nand.c: Fix nand erase operation
  cadence_uart: Flush queued characters on reset
  pl330: Don't inhibit ES bits on INTEN
  pflash_cfi01: Implement migration support
  pflash_cfi01: Drop unused 'bypass' field
  hw/arm_gic_common: Use vmstate struct rather than save/load functions
  arm_gic: Fix sizes of state fields in preparation for vmstate support
  vmstate: Add support for two dimensional arrays
  hw/onenand.c: fix migration of dynamically allocated buffer "otp"
  hw/sd.c: fix migration of dynamically allocated buffer "buf"
  vmstate.h: introduce VMSTATE_BUFFER_POINTER_UNSAFE macro
  hw/arm_mptimer: Save the timer state
  pl050: Don't send always-constant is_mouse field
  hw/arm/nseries: don't print to stdout or stderr

11 years agotcg-s390: Fix merge error in tgen_brcond
Richard Henderson [Fri, 5 Apr 2013 18:10:28 +0000 (14:10 -0400)]
tcg-s390: Fix merge error in tgen_brcond

When the TCG condition codes were re-organized last year,
we failed to update all of the "old-style" tests for unsigned.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Use all 20 bits of the offset in tcg_out_mem
Richard Henderson [Wed, 27 Mar 2013 18:37:42 +0000 (14:37 -0400)]
tcg-s390: Use all 20 bits of the offset in tcg_out_mem

This can save one insn, if the constant has any bits in 32-63 set,
but no bits in 21-31 set.  It never results in more insns.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Use load-address for addition
Richard Henderson [Wed, 27 Mar 2013 18:23:26 +0000 (14:23 -0400)]
tcg-s390: Use load-address for addition

Since we're always in 64-bit mode, load address performs a full
64-bit add.  Use that for 3-address addition, as well as for
larger constant addends when we lack extended-immediates facility.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Cleanup argument shuffling fixme in softmmu code
Richard Henderson [Wed, 27 Mar 2013 17:04:26 +0000 (13:04 -0400)]
tcg-s390: Cleanup argument shuffling fixme in softmmu code

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Use risbgz for andi
Richard Henderson [Wed, 27 Mar 2013 16:28:22 +0000 (12:28 -0400)]
tcg-s390: Use risbgz for andi

This is immediately usable by the tlb lookup code.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Remove constraint letters for and
Richard Henderson [Wed, 27 Mar 2013 15:47:54 +0000 (11:47 -0400)]
tcg-s390: Remove constraint letters for and

Since we have a free temporary and can always just load the constant, we
ought to do so, rather than spending the same effort constraining the const.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Implement deposit opcodes
Richard Henderson [Wed, 27 Mar 2013 13:30:58 +0000 (09:30 -0400)]
tcg-s390: Implement deposit opcodes

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Implement movcond opcodes
Richard Henderson [Tue, 26 Mar 2013 21:28:52 +0000 (17:28 -0400)]
tcg-s390: Implement movcond opcodes

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Implement mulu2_i64 opcode
Richard Henderson [Tue, 26 Mar 2013 20:50:29 +0000 (16:50 -0400)]
tcg-s390: Implement mulu2_i64 opcode

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Implement add2/sub2 opcodes
Richard Henderson [Tue, 26 Mar 2013 20:41:45 +0000 (16:41 -0400)]
tcg-s390: Implement add2/sub2 opcodes

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Remove useless preprocessor conditions
Richard Henderson [Tue, 26 Mar 2013 20:39:50 +0000 (16:39 -0400)]
tcg-s390: Remove useless preprocessor conditions

We only support 64-bit code generation for s390x.
Don't clutter the code with ifdefs that suggest otherwise.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Properly allocate a stack frame.
Richard Henderson [Tue, 26 Mar 2013 03:54:30 +0000 (20:54 -0700)]
tcg-s390: Properly allocate a stack frame.

Set TCG_TARGET_CALL_STACK_OFFSET properly for the abi.  Allocate the
standard TCG_STATIC_CALL_ARGS_SIZE.  And while we're at it, allocate
space for CPU_TEMP_BUF_NLONGS.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-s390: Fix movi
Richard Henderson [Mon, 25 Mar 2013 20:45:32 +0000 (13:45 -0700)]
tcg-s390: Fix movi

The code to load the high 64 bits assumed that the insn used to
load the low 64 bits zero-extended.  Enforce that.

11 years agomain-loop: drop the BQL if the I/O appears to be spinning
Anthony Liguori [Fri, 5 Apr 2013 13:46:00 +0000 (08:46 -0500)]
main-loop: drop the BQL if the I/O appears to be spinning

The char-flow refactoring introduced a busy-wait that depended on
an action from the VCPU thread.  However, the VCPU thread could
never take that action because the busy-wait starved the VCPU thread
of the BQL because it never dropped the mutex while running select.

Paolo doesn't want to drop this optimization for fear that we will
stop detecting these busy waits.  I'm afraid to keep this optimization
even with the busy-wait fixed because I think a similar problem can
occur just with heavy I/O thread load manifesting itself as VCPU pauses.

As a compromise, introduce an artificial timeout after a thousand
iterations but print a rate limited warning when this happens.  This
let's us still detect when this condition occurs without it being
a fatal error.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1365169560-11012-1-git-send-email-aliguori@us.ibm.com

11 years agoqemu-char: eliminate busy waiting on can_read returning zero
Paolo Bonzini [Fri, 5 Apr 2013 15:59:33 +0000 (17:59 +0200)]
qemu-char: eliminate busy waiting on can_read returning zero

The character backend refactoring introduced an undesirable busy wait.
The busy wait happens if can_read returns zero and there is data available
on the character device's file descriptor.  Then, the I/O watch will
fire continuously and, with TCG, the CPU thread will never run.

    1) Char backend asks front end if it can write
    2) Front end says no
    3) poll() finds the char backend's descriptor is available
    4) Goto (1)

What we really want is this (note that step 3 avoids the busy wait):

    1) Char backend asks front end if it can write
    2) Front end says no
    3) poll() goes on without char backend's descriptor
    4) Goto (1) until qemu_chr_accept_input() called

    5) Char backend asks front end if it can write
    6) Front end says yes
    7) poll() finds the char backend's descriptor is available
    8) Backend handler called

After this patch, the IOWatchPoll source and the watch source are
separated.  The IOWatchPoll is simply a hook that runs during the prepare
phase on each main loop iteration.  The hook adds/removes the actual
source depending on the return value from can_read.

A simple reproducer is

    qemu-system-i386 -serial mon:stdio

... followed by banging on the terminal as much as you can. :)  Without
this patch, emulation will hang.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1365177573-11817-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Fri, 5 Apr 2013 17:52:48 +0000 (12:52 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

# By Peter Crosthwaite (2) and others
# Via Stefan Hajnoczi
* stefanha/trivial-patches:
  xilinx_zynq: Cleanup ssi_create_slave
  petalogix_ml605_mmu: Cleanup ssi_create_slave()
  target-s390: Fix SRNMT
  linux-user: Don't omit comma for strace of rt_sigaction()
  test-visitor-serialization: Fix some memory leaks

11 years agoMerge remote-tracking branch 'sstabellini/xen-2013-04-05' into staging
Anthony Liguori [Fri, 5 Apr 2013 17:52:32 +0000 (12:52 -0500)]
Merge remote-tracking branch 'sstabellini/xen-2013-04-05' into staging

# By Alex Bligh (2) and Felipe Franciosi (2)
# Via Stefano Stabellini
* sstabellini/xen-2013-04-05:
  Allow xen guests to plug disks of 1 TiB or more
  Introduce 64 bit integer write interface to xenstore
  Xen PV backend: Disable use of O_DIRECT by default as it results in crashes.
  Xen PV backend: Move call to bdrv_new from blk_init to blk_connect

11 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Fri, 5 Apr 2013 17:49:10 +0000 (12:49 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

# By Stefan Hajnoczi (4) and Kevin Wolf (3)
# Via Kevin Wolf
* kwolf/for-anthony:
  qcow2: Fix L1 write error handling in qcow2_update_snapshot_refcount
  qcow2: Return real error in qcow2_update_snapshot_refcount
  block: clean up I/O throttling wait_time code
  block: drop duplicated slice extension code
  block: keep I/O throttling slice time constant
  block: fix I/O throttling accounting blind spot
  usb-storage: Forward serial number to scsi-disk

11 years agoqcow2: Fix L1 write error handling in qcow2_update_snapshot_refcount
Kevin Wolf [Fri, 5 Apr 2013 10:57:10 +0000 (12:57 +0200)]
qcow2: Fix L1 write error handling in qcow2_update_snapshot_refcount

It ignored the error code, and at least the 'goto fail' is obvious
nonsense as it creates an endless loop (if the next attempt doesn't
magically succeed) and leaves the in-memory L1 table in big-endian
instead of converting it back.

In error cases, there's no point in writing an updated L1 table, so
skip this part for them.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoqcow2: Return real error in qcow2_update_snapshot_refcount
Kevin Wolf [Fri, 5 Apr 2013 10:51:31 +0000 (12:51 +0200)]
qcow2: Return real error in qcow2_update_snapshot_refcount

This fixes the error message triggered by the following script:

    cat > /tmp/blkdebug.cfg <<EOF
    [inject-error]
    event = "cluster_free"
    errno = "28"
    immediately = "off"
    EOF

    $qemu_img create -f qcow2 test.qcow2 10G
    $qemu_img snapshot -c snap test.qcow2
    $qemu_img snapshot -d snap blkdebug:/tmp/blkdebug.cfg:test.qcow2

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: clean up I/O throttling wait_time code
Stefan Hajnoczi [Fri, 5 Apr 2013 09:32:22 +0000 (11:32 +0200)]
block: clean up I/O throttling wait_time code

The wait_time variable is in seconds.  Reflect this in a comment and use
NANOSECONDS_PER_SECOND instead of BLOCK_IO_SLICE_TIME * 10 (which
happens to have the right value).

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-By: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: drop duplicated slice extension code
Stefan Hajnoczi [Fri, 5 Apr 2013 09:32:21 +0000 (11:32 +0200)]
block: drop duplicated slice extension code

The current slice is extended when an I/O request exceeds the limit.
There is no need to extend the slice every time we check a request.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-By: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: keep I/O throttling slice time constant
Stefan Hajnoczi [Fri, 5 Apr 2013 09:32:20 +0000 (11:32 +0200)]
block: keep I/O throttling slice time constant

It is not necessary to adjust the slice time at runtime.  We already
extend the current slice in order to carry over accounting into the next
slice.  Changing the actual slice time value introduces oscillations.

The guest may experience large changes in throughput or IOPS from one
moment to the next when slice times are adjusted.

Reported-by: Benoît Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-By: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>