]> git.proxmox.com Git - qemu.git/log
qemu.git
10 years agoaio / timers: Make qemu_run_timers and qemu_run_all_timers return progress
Alex Bligh [Wed, 21 Aug 2013 15:02:45 +0000 (16:02 +0100)]
aio / timers: Make qemu_run_timers and qemu_run_all_timers return progress

Make qemu_run_timers and qemu_run_all_timers return progress
so that aio_poll etc. can determine whether a timer has been
run.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoaio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack
Alex Bligh [Wed, 21 Aug 2013 15:02:44 +0000 (16:02 +0100)]
aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack

Where supported, called prctl(PR_SET_TIMERSLACK, 1, ...) to
set one nanosecond timer slack to increase precision of timer
calls.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoaio / timers: add ppoll support with qemu_poll_ns
Alex Bligh [Wed, 21 Aug 2013 15:02:43 +0000 (16:02 +0100)]
aio / timers: add ppoll support with qemu_poll_ns

Add qemu_poll_ns which works like g_poll but takes a nanosecond
timeout.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoaio / timers: Consistent treatment of disabled clocks for deadlines
Alex Bligh [Wed, 21 Aug 2013 15:02:42 +0000 (16:02 +0100)]
aio / timers: Consistent treatment of disabled clocks for deadlines

Make treatment of disabled clocks consistent in deadline calculation

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoaio / timers: add qemu-timer.c utility functions
Alex Bligh [Wed, 21 Aug 2013 15:02:41 +0000 (16:02 +0100)]
aio / timers: add qemu-timer.c utility functions

Add utility functions to qemu-timer.c for nanosecond timing.

Add qemu_clock_deadline_ns to calculate deadlines to
nanosecond accuracy.

Add utility function qemu_soonest_timeout to calculate soonest deadline.

Add qemu_timeout_ns_to_ms to convert a timeout in nanoseconds back to
milliseconds for when ppoll is not used.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoaio / timers: Rename qemu_new_clock and expose clock types
Alex Bligh [Wed, 21 Aug 2013 15:02:40 +0000 (16:02 +0100)]
aio / timers: Rename qemu_new_clock and expose clock types

Rename qemu_new_clock to qemu_clock_new.

Expose clock types.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoaio / timers: Rename qemu_timer_* functions
Alex Bligh [Wed, 21 Aug 2013 15:02:39 +0000 (16:02 +0100)]
aio / timers: Rename qemu_timer_* functions

Rename four functions in preparation for new API.

Rename qemu_timer_expired to timer_expired
Rename qemu_timer_expire_time_ns to timer_expire_time_ns
Rename qemu_timer_pending to timer_pending
Rename qemu_timer_expired_ns to timer_expired_ns

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agovmdk: support vmfs files
Paolo Bonzini [Mon, 19 Aug 2013 10:54:28 +0000 (18:54 +0800)]
vmdk: support vmfs files

VMware ESX hosts also use different create and extent types for flat
files, respectively "vmfs" and "VMFS".  This is not documented, but it
can be found at http://kb.vmware.com/kb/10002511 (Recreating a missing
virtual machine disk (VMDK) descriptor file).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agovmdk: support vmfsSparse files
Fam Zheng [Mon, 19 Aug 2013 10:54:27 +0000 (18:54 +0800)]
vmdk: support vmfsSparse files

VMware ESX hosts use a variant of the VMDK3 format, identified by the
vmfsSparse create type ad the VMFSSPARSE extent type.

It has 16 KB grain tables (L2) and a variable-size grain directory (L1).
In addition, the grain size is always 512, but that is not a problem
because it is included in the header.

The format of the extents is documented in the VMDK spec.  The format
of the descriptor file is not documented precisely, but it can be
found at http://kb.vmware.com/kb/10026353 (Recreating a missing virtual
machine disk (VMDK) descriptor file for delta disks).

With these patches, vmfsSparse files only work if opened through the
descriptor file.  Data files without descriptor files, as far as I
could understand, are not supported by ESX.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
--
v2: Rebase to patch 01.
    Change le64_to_cpu to le32_to_cpu.
    Rename vmdk_open_vmdk3 to vmdk_open_vmfs_sparse, which represents the
    current usage of this format.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agovmdk: fix L1 and L2 table size in vmdk3 open
Fam Zheng [Mon, 19 Aug 2013 10:54:26 +0000 (18:54 +0800)]
vmdk: fix L1 and L2 table size in vmdk3 open

VMDK3 header has the field l1dir_size, but vmdk_open_vmdk3 hardcoded the
value. This patch honors the header field.

And the L2 table size is 4096 according to VMDK spec[1], instead of
1 << 9 (512).

[1]:
http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agovmdk: Move l1_size check into vmdk_add_extent()
Fam Zheng [Mon, 19 Aug 2013 10:54:25 +0000 (18:54 +0800)]
vmdk: Move l1_size check into vmdk_add_extent()

This header check is common to VMDK3 and VMDK4, so move it into
vmdk_add_extent().

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: better error message for read only format name
Fam Zheng [Thu, 22 Aug 2013 07:36:59 +0000 (15:36 +0800)]
block: better error message for read only format name

When user tries to use read-only whitelist format in the command line
option, failure message was "'foo' invalid format". It might be invalid
only for writable, but valid for read-only, so it is confusing. Give the
user easier to understand information.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Produce zeros when protocols reading beyond end of file
MORITA Kazutaka [Tue, 6 Aug 2013 01:53:40 +0000 (09:53 +0800)]
block: Produce zeros when protocols reading beyond end of file

While Asias is debugging an issue creating qcow2 images on top of
non-file protocols.  It boils down to this example using NBD:

$ qemu-io -c 'open -g nbd+unix:///?socket=/tmp/nbd.sock' -c 'read -v 0 512'

Notice the open -g option to set bs->growable.  This means you can
read/write beyond end of file.  Reading beyond end of file is supposed
to produce zeroes.

We rely on this behavior in qcow2_create2() during qcow2 image
creation.  We create a new file and then write the qcow2 header
structure using bdrv_pwrite().  Since QCowHeader is not a multiple of
sector size, block.c first uses bdrv_read() on the empty file to fetch
the first sector (should be all zeroes).

Here is the output from the qemu-io NBD example above:

$ qemu-io -c 'open -g nbd+unix:///?socket=/tmp/nbd.sock' -c 'read -v 0 512'
00000000:  ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab  ................
00000010:  ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab  ................
00000020:  ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab  ................
...

We are not zeroing the buffer!  As a result qcow2 image creation on top
of protocols is not guaranteed to work even when file creation is
supported by the protocol.

[Adapted this patch to use bs->zero_beyond_eof.
-- Stefan]

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Asias He <asias@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Introduce bs->zero_beyond_eof
Asias He [Thu, 22 Aug 2013 07:24:14 +0000 (15:24 +0800)]
block: Introduce bs->zero_beyond_eof

In 4146b46c42e0989cb5842e04d88ab6ccb1713a48 (block: Produce zeros when
protocols reading beyond end of file), we break qemu-iotests ./check
-qcow2 022. This happens because qcow2 temporarily sets ->growable = 1
for vmstate accesses (which are stored beyond the end of regular image
data).

We introduce the bs->zero_beyond_eof to allow qcow2_load_vmstate() to
disable ->zero_beyond_eof temporarily in addition to enable ->growable.

[Since the broken patch "block: Produce zeros when protocols reading
beyond end of file" has not been merged yet, I have applied this fix
*first* and will then apply the next patch to keep the tree bisectable.
-- Stefan]

Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Asias He <asias@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqcow2: Change default for new images to compat=1.1
Kevin Wolf [Mon, 19 Aug 2013 08:38:01 +0000 (10:38 +0200)]
qcow2: Change default for new images to compat=1.1

By the time that qemu 1.7 will be released, enough time will have passed
since qemu 1.1, which is the first version to understand version 3
images, that changing the default shouldn't hurt many people any more
and the benefits of using the new format outweigh the pain.

qemu-iotests already runs with compat=1.1 by default.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoMerge remote-tracking branch 'pmaydell/tags/pull-target-arm-20130820' into staging
Anthony Liguori [Tue, 20 Aug 2013 16:23:52 +0000 (11:23 -0500)]
Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20130820' into staging

target-arm queue

# gpg: Signature made Tue 20 Aug 2013 08:56:28 AM CDT using RSA key ID 14360CDE
# gpg: Can't check signature: public key not found

# By Peter Maydell (20) and Peter Chubb (1)
# Via Peter Maydell
* pmaydell/tags/pull-target-arm-20130820: (21 commits)
  hw/timer/imx_epit: Simplify and fix imx_epit implementation
  default-configs: Fix A9MP and A15MP config names
  hw/cpu/a15mpcore: Wire generic timer outputs to GIC inputs
  target-arm: Implement the generic timer
  target-arm: Support coprocessor registers which do I/O
  target-arm: Allow raw_read() and raw_write() to handle 64 bit regs
  hw/arm/pic_cpu: Remove the now-unneeded arm_pic_init_cpu()
  hw/arm/xilinx_zynq: Don't use arm_pic_init_cpu()
  hw/arm/vexpress: Don't use arm_pic_init_cpu()
  hw/arm/versatilepb: Don't use arm_pic_init_cpu()
  hw/arm/strongarm: Don't use arm_pic_init_cpu()
  hw/arm/realview: Don't use arm_pic_init_cpu()
  hw/arm/omap*: Don't use arm_pic_init_cpu()
  hw/arm/musicpal: Don't use arm_pic_init_cpu()
  hw/arm/kzm: Don't use arm_pic_init_cpu()
  hw/arm/integratorcp: Don't use arm_pic_init_cpu()
  hw/arm/highbank: Don't use arm_pic_init_cpu()
  hw/arm/exynos4210: Don't use arm_pic_init_cpu()
  hw/arm/armv7m: Don't use arm_pic_init_cpu()
  target-arm: Make IRQ and FIQ gpio lines on the CPU object
  ...

Message-id: 1377007680-4934-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agoMerge remote-tracking branch 'stefanha/block-next' into staging
Anthony Liguori [Tue, 20 Aug 2013 14:52:18 +0000 (09:52 -0500)]
Merge remote-tracking branch 'stefanha/block-next' into staging

# By Stefan Hajnoczi
# Via Stefan Hajnoczi
* stefanha/block-next:
  aio: drop io_flush argument
  tests: drop event_active_cb()
  thread-pool: drop thread_pool_active()
  dataplane/virtio-blk: drop flush_true() and flush_io()
  block/ssh: drop return_true()
  block/sheepdog: drop have_co_req() and aio_flush_request()
  block/rbd: drop qemu_rbd_aio_flush_cb()
  block/nbd: drop nbd_have_request()
  block/linux-aio: drop qemu_laio_completion_cb()
  block/iscsi: drop iscsi_process_flush()
  block/gluster: drop qemu_gluster_aio_flush_cb()
  block/curl: drop curl_aio_flush()
  aio: stop using .io_flush()
  tests: adjust test-thread-pool to new aio_poll() semantics
  tests: adjust test-aio to new aio_poll() semantics
  dataplane/virtio-blk: check exit conditions before aio_poll()
  block: stop relying on io_flush() in bdrv_drain_all()
  block: ensure bdrv_drain_all() works during bdrv_delete()

Message-id: 1376921877-9576-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agoMerge remote-tracking branch 'rth/axp-next' into staging
Anthony Liguori [Tue, 20 Aug 2013 14:52:07 +0000 (09:52 -0500)]
Merge remote-tracking branch 'rth/axp-next' into staging

# By Richard Henderson
# Via Richard Henderson
* rth/axp-next:
  target-alpha: Implement the typhoon iommu
  target-alpha: Consider the superpage when threading and ending TBs
  target-alpha: Use goto_tb in call_pal
  target-alpha: Implement call_pal without an exception

Message-id: 1376720412-2165-1-git-send-email-rth@twiddle.net
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agoMerge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
Anthony Liguori [Tue, 20 Aug 2013 14:51:53 +0000 (09:51 -0500)]
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings / X86CPU

* gdbstub coprocessor register count bugfix
* QOM instance_post_init infrastructure to override dynamic properties
* X86CPU HyperV preparations for CPU subclasses

# gpg: Signature made Fri 16 Aug 2013 11:49:02 AM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Eduardo Habkost (3) and others
# Via Andreas Färber
* afaerber/tags/qom-cpu-for-anthony:
  cpus: Use cpu_is_stopped() efficiently
  target-i386: Move hyperv_* static globals to X86CPU
  qdev: Set globals in instance_post_init function
  qom: Introduce instance_post_init hook
  tests: Unit tests for qdev global properties handling
  gdbstub: Fix gdb_register_coprocessor() register counting

10 years agohw/timer/imx_epit: Simplify and fix imx_epit implementation
Peter Chubb [Tue, 20 Aug 2013 13:54:32 +0000 (14:54 +0100)]
hw/timer/imx_epit: Simplify and fix imx_epit implementation

When imx_epit.c was last refactored, a common usecase (comparison
register zero) broke.  This patch fixes that, and simplifies the code
yet more.  It also fixes a major thinko in the reset path --- the
wrong bits in the control register were being cleared.

Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>
Reviewed-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agodefault-configs: Fix A9MP and A15MP config names
Peter Maydell [Tue, 20 Aug 2013 13:54:32 +0000 (14:54 +0100)]
default-configs: Fix A9MP and A15MP config names

When individual CONFIG_ switches for the A9MPcore and A15MPcore
devices were created, they were inadvertently given incorrect names
(CONFIG_ARM9MPCORE and CONFIG_ARM15MPCORE). These CPUs are
"Cortex-A9MP" and "Cortex-A15MP", and in particular the ARM9 is
a different (rather older) CPU than the Cortex-A9. Rename the
CONFIG_ switches to bring them into line with the source file
names and CPU names.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1376056215-26391-1-git-send-email-peter.maydell@linaro.org

10 years agohw/cpu/a15mpcore: Wire generic timer outputs to GIC inputs
Peter Maydell [Tue, 20 Aug 2013 13:54:32 +0000 (14:54 +0100)]
hw/cpu/a15mpcore: Wire generic timer outputs to GIC inputs

Now our A15 CPU implements the generic timers, we can wire them
up to the appropriate inputs on the GIC.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-id: 1376065080-26661-5-git-send-email-peter.maydell@linaro.org

10 years agotarget-arm: Implement the generic timer
Peter Maydell [Tue, 20 Aug 2013 13:54:31 +0000 (14:54 +0100)]
target-arm: Implement the generic timer

The ARMv7 architecture specifies a 'generic timer' which is implemented
via cp15 registers. Newer kernels will prefer to use this rather than
a devboard-level timer. Implement the generic timer for TCG; for KVM
we will already use the hardware's virtualized timer for this.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-id: 1376065080-26661-4-git-send-email-peter.maydell@linaro.org

10 years agotarget-arm: Support coprocessor registers which do I/O
Peter Maydell [Tue, 20 Aug 2013 13:54:31 +0000 (14:54 +0100)]
target-arm: Support coprocessor registers which do I/O

Add an ARM_CP_IO flag which an ARMCPRegInfo definition can use to
indicate that the register's implementation does I/O and thus
its accesses need to be surrounded by gen_io_start()/gen_io_end()
in order for icount to work. Most notably, cp registers which
implement clocks or timers need this.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Message-id: 1376065080-26661-3-git-send-email-peter.maydell@linaro.org

10 years agotarget-arm: Allow raw_read() and raw_write() to handle 64 bit regs
Peter Maydell [Tue, 20 Aug 2013 13:54:31 +0000 (14:54 +0100)]
target-arm: Allow raw_read() and raw_write() to handle 64 bit regs

Extend the raw_read() and raw_write() helper accessors so that
they can be used for 64 bit registers as well as 32 bit registers.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Message-id: 1376065080-26661-2-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/pic_cpu: Remove the now-unneeded arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:31 +0000 (14:54 +0100)]
hw/arm/pic_cpu: Remove the now-unneeded arm_pic_init_cpu()

Now all the boards have been converted arm_pic_init_cpu()
is unused and can just be deleted.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-15-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/xilinx_zynq: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:30 +0000 (14:54 +0100)]
hw/arm/xilinx_zynq: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-14-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/vexpress: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:30 +0000 (14:54 +0100)]
hw/arm/vexpress: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-13-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/versatilepb: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:30 +0000 (14:54 +0100)]
hw/arm/versatilepb: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-12-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/strongarm: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:30 +0000 (14:54 +0100)]
hw/arm/strongarm: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-11-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/realview: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:30 +0000 (14:54 +0100)]
hw/arm/realview: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-10-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/omap*: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:29 +0000 (14:54 +0100)]
hw/arm/omap*: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-9-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/musicpal: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:29 +0000 (14:54 +0100)]
hw/arm/musicpal: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-8-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/kzm: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:29 +0000 (14:54 +0100)]
hw/arm/kzm: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-7-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/integratorcp: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:29 +0000 (14:54 +0100)]
hw/arm/integratorcp: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-6-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/highbank: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:29 +0000 (14:54 +0100)]
hw/arm/highbank: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-5-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/exynos4210: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:28 +0000 (14:54 +0100)]
hw/arm/exynos4210: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-4-git-send-email-peter.maydell@linaro.org

10 years agohw/arm/armv7m: Don't use arm_pic_init_cpu()
Peter Maydell [Tue, 20 Aug 2013 13:54:28 +0000 (14:54 +0100)]
hw/arm/armv7m: Don't use arm_pic_init_cpu()

Drop the now-deprecated arm_pic_init_cpu() in favour of directly
getting the IRQ line from the ARMCPU object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-3-git-send-email-peter.maydell@linaro.org

10 years agotarget-arm: Make IRQ and FIQ gpio lines on the CPU object
Peter Maydell [Tue, 20 Aug 2013 13:54:28 +0000 (14:54 +0100)]
target-arm: Make IRQ and FIQ gpio lines on the CPU object

Now that ARMCPU is a subclass of DeviceState, we can make the
CPU's inbound IRQ and FIQ lines be simply gpio lines, which
means we can remove the odd arm_pic shim.

We retain the arm_pic_init_cpu() function as a backwards
compatibility shim layer so we can convert the board models
to get the IRQ and FIQ lines directly from the ARMCPU
object one at a time.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-2-git-send-email-peter.maydell@linaro.org

10 years agotarget-arm: Implement 'int' loglevel
Peter Maydell [Tue, 20 Aug 2013 13:54:28 +0000 (14:54 +0100)]
target-arm: Implement 'int' loglevel

The 'int' loglevel for recording interrupts and exceptions
requires support in the target-specific code. Implement
it for ARM. This improves debug logging in some situations
that were otherwise pretty opaque, such as when we fault
trying to execute at an exception vector address, which
would otherwise cause an infinite loop of taking exceptions
without any indication in the debug log of what was going on.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Message-id: 1375700771-21665-1-git-send-email-peter.maydell@linaro.org

10 years agoaio: drop io_flush argument
Stefan Hajnoczi [Thu, 11 Apr 2013 15:26:25 +0000 (17:26 +0200)]
aio: drop io_flush argument

The .io_flush() handler no longer exists and has no users.  Drop the
io_flush argument to aio_set_fd_handler() and related functions.

The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no
longer used and are dropped too.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agotests: drop event_active_cb()
Stefan Hajnoczi [Tue, 16 Apr 2013 14:46:15 +0000 (16:46 +0200)]
tests: drop event_active_cb()

Drop the io_flush argument to aio_set_event_notifier().

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agothread-pool: drop thread_pool_active()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:22:08 +0000 (17:22 +0200)]
thread-pool: drop thread_pool_active()

.io_flush() is no longer called so drop thread_pool_active().  The block
layer is the only thread-pool.c user and it already tracks in-flight
requests, therefore we do not need thread_pool_active().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agodataplane/virtio-blk: drop flush_true() and flush_io()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:20:03 +0000 (17:20 +0200)]
dataplane/virtio-blk: drop flush_true() and flush_io()

.io_flush() is no longer called so drop flush_true() and flush_io().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: drop return_true()
Stefan Hajnoczi [Tue, 16 Apr 2013 11:12:28 +0000 (13:12 +0200)]
block/ssh: drop return_true()

.io_flush() is no longer called so drop return_true().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: drop have_co_req() and aio_flush_request()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:18:18 +0000 (17:18 +0200)]
block/sheepdog: drop have_co_req() and aio_flush_request()

.io_flush() is no longer called so drop have_co_req() and
aio_flush_request().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/rbd: drop qemu_rbd_aio_flush_cb()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:16:29 +0000 (17:16 +0200)]
block/rbd: drop qemu_rbd_aio_flush_cb()

.io_flush() is no longer called so drop qemu_rbd_aio_flush_cb().
qemu_aio_count is unused now so drop it too.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/nbd: drop nbd_have_request()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:15:03 +0000 (17:15 +0200)]
block/nbd: drop nbd_have_request()

.io_flush() is no longer called so drop nbd_have_request().  We cannot
drop in_flight since it is still used by other block/nbd.c code.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/linux-aio: drop qemu_laio_completion_cb()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:12:33 +0000 (17:12 +0200)]
block/linux-aio: drop qemu_laio_completion_cb()

.io_flush() is no longer called so drop qemu_laio_completion_cb().  It
turns out that count is now unused so drop that too.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/iscsi: drop iscsi_process_flush()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:09:59 +0000 (17:09 +0200)]
block/iscsi: drop iscsi_process_flush()

.io_flush() is no longer called so drop iscsi_process_flush().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/gluster: drop qemu_gluster_aio_flush_cb()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:07:43 +0000 (17:07 +0200)]
block/gluster: drop qemu_gluster_aio_flush_cb()

Since .io_flush() is no longer called we do not need
qemu_gluster_aio_flush_cb() anymore.  It turns out that qemu_aio_count
is unused now and can be dropped.

Thanks to Bharata B Rao <bharata@linux.vnet.ibm.com> for catching a
build failure with CONFIG_GLUSTERFS_DISCARD, which has been fixed.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoChange email address
Anthony Liguori [Mon, 19 Aug 2013 13:49:37 +0000 (08:49 -0500)]
Change email address

My IBM email address will be unaccessible after August 23rd, 2013.

Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agoblock/curl: drop curl_aio_flush()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:04:23 +0000 (17:04 +0200)]
block/curl: drop curl_aio_flush()

.io_flush() is no longer called so drop curl_aio_flush().  The acb[]
array that the function checks is still used in other parts of
block/curl.c.  Therefore we cannot remove acb[], it is needed.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoaio: stop using .io_flush()
Stefan Hajnoczi [Thu, 11 Apr 2013 14:56:50 +0000 (16:56 +0200)]
aio: stop using .io_flush()

Now that aio_poll() users check their termination condition themselves,
it is no longer necessary to call .io_flush() handlers.

The behavior of aio_poll() changes as follows:

1. .io_flush() is no longer invoked and file descriptors are *always*
monitored.  Previously returning 0 from .io_flush() would skip this file
descriptor.

Due to this change it is essential to check that requests are pending
before calling qemu_aio_wait().  Failure to do so means we block, for
example, waiting for an idle iSCSI socket to become readable when there
are no requests.  Currently all qemu_aio_wait()/aio_poll() callers check
before calling.

2. aio_poll() now returns true if progress was made (BH or fd handlers
executed) and false otherwise.  Previously it would return true whenever
'busy', which means that .io_flush() returned true.  The 'busy' concept
no longer exists so just progress is returned.

Due to this change we need to update tests/test-aio.c which asserts
aio_poll() return values.  Note that QEMU doesn't actually rely on these
return values so only tests/test-aio.c cares.

Note that ctx->notifier, the EventNotifier fd used for aio_notify(), is
now handled as a special case.  This is a little ugly but maintains
aio_poll() semantics, i.e. aio_notify() does not count as 'progress' and
aio_poll() avoids blocking when the user has not set any fd handlers yet.

Patches after this remove .io_flush() handler code until we can finally
drop the io_flush arguments to aio_set_fd_handler() and friends.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agotests: adjust test-thread-pool to new aio_poll() semantics
Stefan Hajnoczi [Tue, 16 Apr 2013 15:49:42 +0000 (17:49 +0200)]
tests: adjust test-thread-pool to new aio_poll() semantics

aio_poll(ctx, true) will soon block when fd handlers have been set.
Previously aio_poll() would return early if all .io_flush() returned
false.  This means we need to check the equivalent of the .io_flush()
condition *before* calling aio_poll(ctx, true) to avoid deadlock.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agotests: adjust test-aio to new aio_poll() semantics
Stefan Hajnoczi [Wed, 17 Apr 2013 09:01:02 +0000 (11:01 +0200)]
tests: adjust test-aio to new aio_poll() semantics

aio_poll(ctx, true) will soon block if any fd handlers have been set.
Previously it would only block when .io_flush() returned true.

This means that callers must check their wait condition *before*
aio_poll() to avoid deadlock.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agodataplane/virtio-blk: check exit conditions before aio_poll()
Stefan Hajnoczi [Thu, 11 Apr 2013 15:24:08 +0000 (17:24 +0200)]
dataplane/virtio-blk: check exit conditions before aio_poll()

Check exit conditions before entering blocking aio_poll().  This is
mainly for consistency since it's unlikely that we are stopping in the
first event loop iteration.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: stop relying on io_flush() in bdrv_drain_all()
Stefan Hajnoczi [Thu, 11 Apr 2013 13:41:13 +0000 (15:41 +0200)]
block: stop relying on io_flush() in bdrv_drain_all()

If a block driver has no file descriptors to monitor but there are still
active requests, it can return 1 from .io_flush().  This is used to spin
during synchronous I/O.

Stop relying on .io_flush() and instead check
QLIST_EMPTY(&bs->tracked_requests) to decide whether there are active
requests.

This is the first step in removing .io_flush() so that event loops no
longer need to have the concept of synchronous I/O.  Eventually we may
be able to kill synchronous I/O completely by running everything in a
coroutine, but that is future work.

Note this patch moves bs->throttled_reqs initialization to bdrv_new() so
that bdrv_requests_pending(bs) can safely access it.  In practice bs is
g_malloc0() so the memory is already zeroed but it's safer to initialize
the queue properly.

We also need to fix up block/stream.c:close_unused_images() to prevent
traversing a dangling pointer while it rearranges the backing file
chain.  This is necessary since the new bdrv_drain_all() traverses the
backing file chain.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: ensure bdrv_drain_all() works during bdrv_delete()
Stefan Hajnoczi [Thu, 27 Jun 2013 13:32:26 +0000 (15:32 +0200)]
block: ensure bdrv_drain_all() works during bdrv_delete()

In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close()
so that the device is still seen by bdrv_drain_all() when iterating
bdrv_states.

Cc: qemu-stable@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agotarget-alpha: Implement the typhoon iommu
Richard Henderson [Mon, 5 Aug 2013 01:27:13 +0000 (15:27 -1000)]
target-alpha: Implement the typhoon iommu

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-alpha: Consider the superpage when threading and ending TBs
Richard Henderson [Sat, 27 Jul 2013 00:05:08 +0000 (14:05 -1000)]
target-alpha: Consider the superpage when threading and ending TBs

This allows significantly more threading, and occasionally larger TBs,
when processing code for the kernel and PALcode.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-alpha: Use goto_tb in call_pal
Richard Henderson [Fri, 26 Jul 2013 22:00:32 +0000 (12:00 -1000)]
target-alpha: Use goto_tb in call_pal

With appropriate flushing when the PALBR changes, the target of
a CALL_PAL is so predictable we can chain to it.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-alpha: Implement call_pal without an exception
Richard Henderson [Fri, 26 Jul 2013 21:22:21 +0000 (11:22 -1000)]
target-alpha: Implement call_pal without an exception

The destination of the call_pal, and the cpu state, is very predictable;
there's no need for exiting the cpu loop.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agocpus: Use cpu_is_stopped() efficiently
Tiejun Chen [Fri, 2 Aug 2013 01:43:09 +0000 (09:43 +0800)]
cpus: Use cpu_is_stopped() efficiently

It makes more sense and will make things simpler later.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agotarget-i386: Move hyperv_* static globals to X86CPU
Igor Mammedov [Wed, 5 Jun 2013 13:18:40 +0000 (15:18 +0200)]
target-i386: Move hyperv_* static globals to X86CPU

- since hyperv_* helper functions are used only in target-i386/kvm.c
  move them there as static helpers

Requested-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqdev: Set globals in instance_post_init function
Eduardo Habkost [Wed, 10 Jul 2013 20:08:42 +0000 (17:08 -0300)]
qdev: Set globals in instance_post_init function

This way, properties registered in the instance_init function of
child classes will be handled properly by qdev_prop_set_globals(), too.

Includes a unit test for the new functionality.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoqom: Introduce instance_post_init hook
Eduardo Habkost [Wed, 10 Jul 2013 20:08:41 +0000 (17:08 -0300)]
qom: Introduce instance_post_init hook

This will allow classes to specify a function to be called after all
instance_init functions were called.

This will be used by DeviceState to call qdev_prop_set_globals() at the
right moment.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agotests: Unit tests for qdev global properties handling
Eduardo Habkost [Wed, 10 Jul 2013 20:08:40 +0000 (17:08 -0300)]
tests: Unit tests for qdev global properties handling

This tests the qdev global-properties handling code.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agogdbstub: Fix gdb_register_coprocessor() register counting
Andreas Färber [Mon, 12 Aug 2013 16:09:47 +0000 (18:09 +0200)]
gdbstub: Fix gdb_register_coprocessor() register counting

Commit a0e372f0c49ac01faeaeb73a6e8f50e8ac615f34 reorganized the register
counting for GDB. While it seems correct not to let the total number of
registers skyrocket in an SMP scenario through a static variable, the
distinction between total register count and 'g' packet register count
(last_reg vs. num_g_regs) got lost among the way.

Fix this by introducing CPUState::gdb_num_g_regs and using that in
gdb_handle_packet().

Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: qemu-stable@nongnu.org (stable-1.6)
Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agoOpen up 1.7 development branch
Anthony Liguori [Thu, 15 Aug 2013 20:41:13 +0000 (15:41 -0500)]
Open up 1.7 development branch

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoUpdate version for 1.6.0 v1.6.0
Anthony Liguori [Thu, 15 Aug 2013 15:40:51 +0000 (10:40 -0500)]
Update version for 1.6.0

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agomips_malta: do not raise exceptions when accessing invalid memory
Aurelien Jarno [Mon, 12 Aug 2013 19:34:53 +0000 (21:34 +0200)]
mips_malta: do not raise exceptions when accessing invalid memory

Since commit c658b94f6e8c206c59d02aa6fbac285b86b53d2c, MIPS raises
exceptions when accessing invalid memory. This is not the correct
behaviour for MIPS Malta Core LV, as the GT-64120A system controller
just ignore undecoded access. This feature is used by the Linux kernel
to probe for some devices.

Emulate the correct behaviour in QEMU by adding an empty slot covering
the entire memory space decoded by the GT-64120A.

Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agoblock: Dont ignore previously set bdrv_flags
M. Mohan Kumar [Wed, 14 Aug 2013 12:26:41 +0000 (17:56 +0530)]
block: Dont ignore previously set bdrv_flags

bdrv_flags is set by bdrv_parse_discard_flags(), but later it is reset
to zero.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Message-id: 1376483201-13466-1-git-send-email-mohan@in.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoqemu-char: fix infinite recursion connecting to monitor pty
James Hogan [Thu, 8 Aug 2013 11:09:38 +0000 (12:09 +0100)]
qemu-char: fix infinite recursion connecting to monitor pty

Since commit bd5c51e (qemu-char: don't issue CHR_EVENT_OPEN in a BH), an
infinite recursion occurs when putting the monitor on a pty (-monitor
pty) and connecting a terminal to the slave port.

This is because of the qemu_chr_be_event(s, CHR_EVENT_OPENED) added to
qemu_chr_be_generic_open(). This event is captured by monitor_event()
which prints a welcome message to the character device. The flush of
that welcome message retriggers another open event in pty_chr_state()
because it checks s->connected, but only sets it to 1 after calling
qemu_chr_be_generic_open().

I've fixed this by setting s->connected = 1 before the call to
qemu_chr_be_generic_open() instead of after, so that the recursive
pty_chr_state() doesn't call it again.

An example snippet of repeating backtrace:
 ...
 #107486 0x007aec58 in monitor_flush (mon=0xf418b0) at qemu/monitor.c:288
 #107487 0x007aee7c in monitor_puts (mon=0xf418b0, str=0x1176d07 "") at qemu/monitor.c:322
 #107488 0x007aef20 in monitor_vprintf (mon=0xf418b0, fmt=0x8d4820 "QEMU %s monitor - type 'help' for more information\n",
     ap=0x7f432be0) at qemu/monitor.c:339
 #107489 0x007aefac in monitor_printf (mon=0xf418b0, fmt=0x8d4820 "QEMU %s monitor - type 'help' for more information\n")
     at qemu/monitor.c:347
 #107490 0x007ba4bc in monitor_event (opaque=0xf418b0, event=2) at qemu/monitor.c:4699
 #107491 0x00684c28 in qemu_chr_be_event (s=0xf37788, event=2) at qemu/qemu-char.c:108
 #107492 0x00684c70 in qemu_chr_be_generic_open (s=0xf37788) at qemu/qemu-char.c:113
 #107493 0x006880a4 in pty_chr_state (chr=0xf37788, connected=1) at qemu/qemu-char.c:1145
 #107494 0x00687fa4 in pty_chr_update_read_handler (chr=0xf37788) at qemu/qemu-char.c:1121
 #107495 0x00687c9c in pty_chr_write (chr=0xf37788, buf=0x70b3c008 <Address 0x70b3c008 out of bounds>, len=538720)
     at qemu/qemu-char.c:1063
 #107496 0x00684cc4 in qemu_chr_fe_write (s=0xf37788, buf=0x70b3c008 <Address 0x70b3c008 out of bounds>, len=538720)
     at qemu/qemu-char.c:118
 ...

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Message-id: 1375960178-10882-1-git-send-email-james.hogan@imgtec.com
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agopvpanic: fix bad merge
Anthony Liguori [Tue, 13 Aug 2013 14:02:52 +0000 (09:02 -0500)]
pvpanic: fix bad merge

Context matching caused the 'has_pvpanic = true' to be applied to
the 1.6 machine type instead of the 1.5 machine type.

Reported-by: Markus Armbruster <armbru@redhat.com>
Reported-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoUpdate version for 1.6.0-rc3 v1.6.0-rc3
Anthony Liguori [Mon, 12 Aug 2013 20:03:36 +0000 (15:03 -0500)]
Update version for 1.6.0-rc3

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoMerge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
Anthony Liguori [Mon, 12 Aug 2013 20:03:20 +0000 (15:03 -0500)]
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings

* Fix X86CPU Westmere CPUID for pc-*-1.4 and older

* afaerber/tags/qom-cpu-for-anthony:
  pc: Remove PCLMULQDQ from Westmere on pc-*-1.4 and older

Conflicts:
hw/i386/pc_piix.c
hw/i386/pc_q35.c

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agopc: drop external DSDT loading
Anthony Liguori [Mon, 12 Aug 2013 14:01:44 +0000 (09:01 -0500)]
pc: drop external DSDT loading

This breaks migration and is unneeded with modern SeaBIOS.

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

10 years agohw/misc: make pvpanic known to user
Marcel Apfelbaum [Sun, 11 Aug 2013 15:10:43 +0000 (18:10 +0300)]
hw/misc: make pvpanic known to user

This patch is based on Hu Tao's:
http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00125.html

The pvpanic device may be enabled now with "-device pvpanic"
from command line.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Message-id: 1376233843-19410-3-git-send-email-marcel.a@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agohw/misc: don't create pvpanic device by default
Marcel Apfelbaum [Sun, 11 Aug 2013 15:10:42 +0000 (18:10 +0300)]
hw/misc: don't create pvpanic device by default

This patch is based on Hu Tao's:
http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00124.html

No need to hard-code pvpanic as part of the machine.
It can be added with "-device pvpanic" from command line (The next patch).
Anyway, for backport compatibility it is still part of 1.5
machine.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Message-id: 1376233843-19410-2-git-send-email-marcel.a@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agopc: Remove PCLMULQDQ from Westmere on pc-*-1.4 and older
Eduardo Habkost [Fri, 9 Aug 2013 14:11:36 +0000 (11:11 -0300)]
pc: Remove PCLMULQDQ from Westmere on pc-*-1.4 and older

Commit 41cb383f42d0cb51d8e3e25e3ecebc954dd4196f made a guest-visible
change by adding the PCLMULQDQ bit to Westmere without adding
compatibility code to keep the ABI for older machine-types.
Fix it by adding the missing compat code.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
10 years agordma: remaining documentation fixes
Michael R. Hines [Fri, 9 Aug 2013 20:05:45 +0000 (16:05 -0400)]
rdma: remaining documentation fixes

Was missing 'setup-time' in some of the QMP documentation...

Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1376078746-24948-7-git-send-email-mrhines@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agordma: IPv6 over Ethernet (RoCE) is broken in linux - workaround
Michael R. Hines [Fri, 9 Aug 2013 20:05:44 +0000 (16:05 -0400)]
rdma: IPv6 over Ethernet (RoCE) is broken in linux - workaround

We've gotten reports from multiple testers (including Frank Yangjie
and myself) that RDMA IPv6 support over RocE (Ethernet) is broken
in linux.

A patch to Linux is still in review:

http://comments.gmane.org/gmane.linux.drivers.rdma/16448

If the user is listening on '[::]', then we will not have a opened a device
yet and have no way of verifying if the device is RoCE or not.

In this case, the source VM will throw an error for ALL types of
connections (both IPv4 and IPv6) if the destination machine does not have
a regular infiniband network available for use.

The only way to gaurantee that an error is thrown for broken kernels is
for the management software to choose a *specific* interface at bind time
and validate what time of hardware it is.

Unfortunately, this puts the user in a fix:

 If the source VM connects with an IPv4 address without knowing that the
 destination has bound to '[::]' the migration will unconditionally fail
 unless the management software is not explicitly listening on the the IPv4
 address while using a RoCE-based device.

 If the source VM connects with an IPv6 address, then we're OK because we can
 throw an error on the source (and similarly on the destination).

 But in mixed environments, this will be broken for a while until it is fixed
 inside linux.

We do provide a *tiny* bit of help in mixed environments, though in this patch:

We can list all of the devices in the system and check to see if all the
devices are RoCE or Infiniband.

If we detect that we have a *pure* RoCE environment, then we can safely
thrown an error even if the management sofware has specified '[::]' as the
bind address.

However, if there is are multiple hetergeneous devices, then we cannot make
this assumption and the user just has to be sure they know what they are doing.

Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
Message-id: 1376078746-24948-6-git-send-email-mrhines@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agordma: proper getaddrinfo() handling
Michael R. Hines [Fri, 9 Aug 2013 20:05:43 +0000 (16:05 -0400)]
rdma: proper getaddrinfo() handling

getaddrinfo() already knows what it's doing,
but it can potentially return multiple addresses.
We need to handle that...

Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
Message-id: 1376078746-24948-5-git-send-email-mrhines@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agordma: check if RDMAControlHeader::len match transferred byte
Isaku Yamahata [Fri, 9 Aug 2013 20:05:42 +0000 (16:05 -0400)]
rdma: check if RDMAControlHeader::len match transferred byte

RDMAControlHeader::len is provided from remote, so check if the value
match the actual transferred byte_len.

Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Michael R. Hines <mrhines@us.ibm.com>
Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp>
Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
Message-id: 1376078746-24948-4-git-send-email-mrhines@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agordma: validate RDMAControlHeader::len
Isaku Yamahata [Fri, 9 Aug 2013 20:05:41 +0000 (16:05 -0400)]
rdma: validate RDMAControlHeader::len

RMDAControlHeader::len is provided from remote, so validate it.

Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Michael R. Hines <mrhines@us.ibm.com>
Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp>
Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
Message-id: 1376078746-24948-3-git-send-email-mrhines@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agordma: use resp.len after validation in qemu_rdma_registration_stop
Isaku Yamahata [Fri, 9 Aug 2013 20:05:40 +0000 (16:05 -0400)]
rdma: use resp.len after validation in qemu_rdma_registration_stop

resp.len is given from remote host. So should be validated before use.
Otherwise memcpy can access beyond the buffer.

Cc: Michael R. Hines <mrhines@us.ibm.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Michael R. Hines <mrhines@us.ibm.com>
Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp>
Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
Message-id: 1376078746-24948-2-git-send-email-mrhines@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agopc_sysfw: do not make it a device anymore
Paolo Bonzini [Fri, 9 Aug 2013 17:35:02 +0000 (12:35 -0500)]
pc_sysfw: do not make it a device anymore

Move the code to hw/i386, the sole remaining property is available
as !pci_enabled.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1376069702-22330-4-git-send-email-aliguori@us.ibm.com

Rebased.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agopc_sysfw: remove the rom_only property
Paolo Bonzini [Fri, 9 Aug 2013 17:35:01 +0000 (12:35 -0500)]
pc_sysfw: remove the rom_only property

With the new semantics of pc_sysfw (no -pflash implies "old-style" ROM setup,
-pflash implies "new-style" ROM setup), there is no need anymore for a compat
property.  Old machines simply will never use -pflash, and thus will always
use old-style setup.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1376069702-22330-3-git-send-email-aliguori@us.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agosysfw: remove read-only pc_sysfw_flash_vs_rom_bug_compatible
Paolo Bonzini [Fri, 9 Aug 2013 17:35:00 +0000 (12:35 -0500)]
sysfw: remove read-only pc_sysfw_flash_vs_rom_bug_compatible

The variable is not written anymore.

This cleans up after 9e1c2ec (which accidentally left variable
pc_sysfw_flash_vs_rom_bug_compatible behind, value always zero), and
buries dead code from commit dafb82e (which resurrected the pc_sysfw
code for pc_sysfw_flash_vs_rom_bug_compatible by mistake).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1376069702-22330-2-git-send-email-aliguori@us.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agow32: Add missing version.o to all executables (fix regression)
Stefan Weil [Thu, 8 Aug 2013 18:18:07 +0000 (20:18 +0200)]
w32: Add missing version.o to all executables (fix regression)

QEMU executables for w32, w64 had included meta information built from
version.rc. These rules were changed several times some months ago.

The latest version added version.o to the tools, but not to the system
emulations.

This patch adds the meta information to all system emulations again.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1375985887-3984-1-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoqemu-option: Guard against qemu_opts_set_defaults() misuse
Markus Armbruster [Fri, 2 Aug 2013 07:34:00 +0000 (09:34 +0200)]
qemu-option: Guard against qemu_opts_set_defaults() misuse

Commit 6d4cd40 fixed qemu_opts_set_defaults() for an existing corner
case, but broke it for another one that can't be reached in current
code.

Quote from its commit message:

    I believe [opts_parse()] attempts to do the following:

        If options don't yet exist, create new options
        Else, if defaults, modify the existing options
        Else, if list->merge_lists, modify the existing options
        Else, fail

The only caller that passes true for defaults is
qemu_opts_set_defaults().

The commit message then claims:

    A straightforward call of qemu_opts_create() does exactly that.

Wrong.  When !list->merge_lists, and the option string doesn't contain
id=, and options without ID exist, then we don't actually modify the
existing options, we create new ones.

Not reachable, because we never pass lists with !list->merge_lists to
qemu_opts_set_defaults().

Guard against possible (if unlikely) future misuse with assert().

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1375428840-5275-1-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoLICENSE: clarify
Paolo Bonzini [Wed, 31 Jul 2013 06:19:52 +0000 (08:19 +0200)]
LICENSE: clarify

1) The GPL says that "if the Program does not specify a version number
of this License, you may choose any version ever published by the Free
Software Foundation".  This is not true, QEMU includes parts that are
v2-only.

2) Provide a default for files with no licensing information.

3) It is not just hardware emulation that is under BSD license.

4) Restrict GPLv2-only contributions to user mode emulation (due to
code from Linux) and PCI passthrough (due to code from Neocleus).

5) The rules were initially set by Fabrice but are being amended by
other people (already in commit ee12e1f, LICENSE: There is no libqemu.a
anymore, 2011-11-15).  Do not put words in his mouth.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Andreas Färber <afaerber@suse.de>
Message-id: 1375251592-2537-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoraw: add license header
Paolo Bonzini [Wed, 31 Jul 2013 06:19:51 +0000 (08:19 +0200)]
raw: add license header

Most of the block layer is under the BSD license, thus it is reasonable
to license block/raw.c the same way.  CCed people should ACK by replying
with a Signed-off-by line.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Jeff Cody <jcody@redhat.com>
Cc: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1375251592-2537-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoMerge remote-tracking branch 'mst/tags/for_anthony' into staging
Anthony Liguori [Mon, 12 Aug 2013 13:32:55 +0000 (08:32 -0500)]
Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pci,virtio fixes for 1.6

This includes some last-minute bugfixes for 1.6.
All very small patches that also look very safe to me.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Mon 12 Aug 2013 04:28:57 AM CDT using RSA key ID D28D5469
# gpg: Can't check signature: public key not found

# By Michael S. Tsirkin (2) and others
# Via Michael S. Tsirkin
* mst/tags/for_anthony:
  vhost: clear signalled_used_valid on vhost stop
  virtio: clear signalled_used_valid when switching from dataplane
  i82801b11: Fix i82801b11 PCI host bridge config space
  pc: disable pci-info for 1.6

Message-id: 1376308831-19978-1-git-send-email-mst@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoMerge remote-tracking branch 'pmaydell/tags/pull-arm-devs-20130812' into staging
Anthony Liguori [Mon, 12 Aug 2013 13:32:43 +0000 (08:32 -0500)]
Merge remote-tracking branch 'pmaydell/tags/pull-arm-devs-20130812' into staging

arm-devs queue

# gpg: Signature made Mon 12 Aug 2013 05:58:14 AM CDT using RSA key ID 14360CDE
# gpg: Can't check signature: public key not found

# By Peter Maydell
# Via Peter Maydell
* pmaydell/tags/pull-arm-devs-20130812:
  hw/virtio/virtio-mmio: Make QueueNumMax read 0 for unavailable queues
  hw/virtio/virtio: Don't allow guests to add/remove queues

Message-id: 1376305261-29561-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Mon, 12 Aug 2013 13:32:36 +0000 (08:32 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

# By Mike Qiu
# Via Kevin Wolf
* kwolf/for-anthony:
  block: Bugfix 'format' and 'snapshot' used in drive option

Message-id: 1376071141-3214-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Mon, 12 Aug 2013 13:30:49 +0000 (08:30 -0500)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Laszlo Ersek
# Via Luiz Capitulino
* luiz/queue/qmp:
  dump: rebase from host-private RAMBlock offsets to guest-physical addresses
  dump: populate guest_phys_blocks
  dump: introduce GuestPhysBlockList
  dump: clamp guest-provided mapping lengths to ramblock sizes

Message-id: 1375974809-1757-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoMerge remote-tracking branch 'kraxel/usb.87' into staging
Anthony Liguori [Mon, 12 Aug 2013 13:30:39 +0000 (08:30 -0500)]
Merge remote-tracking branch 'kraxel/usb.87' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/usb.87:
  xhci: implement warm port reset

Message-id: 1375961495-20970-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
10 years agoMerge remote-tracking branch 'origin/master' into staging
Anthony Liguori [Mon, 12 Aug 2013 13:28:56 +0000 (08:28 -0500)]
Merge remote-tracking branch 'origin/master' into staging

* origin/master:
  mips: revert commit b332d24a8e1290954029814d09156b06ede358e2
  tcg/mips: fix invalid op definition errors

Necessary because patches got pushed by Aurelien before I pushed
the -rc2 tag.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>