]> git.proxmox.com Git - qemu.git/log
qemu.git
12 years agoblockdev: open images with BDRV_O_INCOMING on incoming live migration
Benoît Canet [Fri, 23 Mar 2012 07:36:50 +0000 (08:36 +0100)]
blockdev: open images with BDRV_O_INCOMING on incoming live migration

Open images with BDRV_O_INCOMING in order to inform block drivers
that an incoming live migration is coming.

Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: add a function to clear incoming live migration flags
Benoît Canet [Fri, 23 Mar 2012 07:36:49 +0000 (08:36 +0100)]
block: add a function to clear incoming live migration flags

This function will clear all BDRV_O_INCOMING flags.

Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Add new BDRV_O_INCOMING flag to notice incoming live migration
Benoît Canet [Fri, 23 Mar 2012 07:36:48 +0000 (08:36 +0100)]
block: Add new BDRV_O_INCOMING flag to notice incoming live migration

From original patch with Patchwork-id: 31110 by
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

"Add a flag to indicate that incoming migration is pending and care needs
to be taken for data consistency.  Block drivers should not modify the
image file before incoming migration is complete since the migration
source host is still using the image file."

The rationale for not using bdrv->read_only is the following.

"Unfortunately this is not possible because too many other places in QEMU
test bdrv_is_read_only() and use it for their own evil purposes.  For
example, ide_init_drive() will error out because read-only harddisks are
not supported.  We're mixing guest and host side read-only concepts so
this simpler alternative does not work."

Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock stream: close unused files and update ->backing_hd
Marcelo Tosatti [Tue, 27 Mar 2012 00:22:10 +0000 (21:22 -0300)]
block stream: close unused files and update ->backing_hd

Close the now unused images that were part of the previous backing file
chain and adjust ->backing_hd, backing_filename and backing_format
properly.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=801449

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: Fix call syntax for qemu-io
Stefan Weil [Wed, 14 Mar 2012 18:57:24 +0000 (19:57 +0100)]
qemu-iotests: Fix call syntax for qemu-io

qemu-io requires options first, then fixed parameters.

GNU getopt also allows options at the end, but POSIX getopt
doesn't. Try "export POSIXLY_CORRECT=y" to get the POSIX
behaviour with GNU getopt, too.

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: Fix call syntax for qemu-img
Stefan Weil [Wed, 14 Mar 2012 18:57:23 +0000 (19:57 +0100)]
qemu-iotests: Fix call syntax for qemu-img

qemu-img requires first options, then file name, then size.

GNU getopt also allows options at the end, but POSIX getopt
doesn't. Try "export POSIXLY_CORRECT=y" to get the POSIX
behaviour with GNU getopt, too.

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: Test unknown qcow2 header extensions
Kevin Wolf [Thu, 16 Feb 2012 15:55:01 +0000 (16:55 +0100)]
qemu-iotests: Test unknown qcow2 header extensions

The immportant thing here is that header extensions don't get silently
dropped when the header is rewritten, e.g. during a rebase.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: qcow2.py
Kevin Wolf [Wed, 15 Feb 2012 15:36:03 +0000 (16:36 +0100)]
qemu-iotests: qcow2.py

This adds a tool that is meant to inspect and edit qcow2 files in a
low-level way, that wouldn't be possible with qemu-img/io, for example
by adding yet unknown extensions or flags. This way we can test whether
qemu deals properly with future backwards compatible extensions.

For now, let's start with the image header and header extensions.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agosheepdog: fix send req helpers
Liu Yuan [Tue, 3 Apr 2012 10:04:21 +0000 (18:04 +0800)]
sheepdog: fix send req helpers

We should return if reading of the header fails.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Acked-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agosheepdog: implement SD_OP_FLUSH_VDI operation
Liu Yuan [Tue, 3 Apr 2012 20:03:58 +0000 (04:03 +0800)]
sheepdog: implement SD_OP_FLUSH_VDI operation

Flush operation is supposed to flush the write-back cache of
sheepdog cluster.

By issuing flush operation, we can assure the Guest of data
reaching the sheepdog cluster storage.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: bdrv_append() fixes
Jeff Cody [Tue, 27 Mar 2012 20:30:19 +0000 (16:30 -0400)]
block: bdrv_append() fixes

A few fixups for bdrv_append():

The new bs (bs_new) passed into bdrv_append() should be anonymous.  Rather
than call bdrv_make_anon() to enforce this, use an assert to catch when a caller
is passing in a bs_new that is not anonymous.

Also, the new top layer should have its backing_format reflect the original
top's format.

And last, after the swap of bs contents, the device_name will have been copied
down. This needs to be cleared to reflect the anonymity of the bs that was
pushed down.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqed: track dirty flag status
Dong Xu Wang [Thu, 15 Mar 2012 12:13:34 +0000 (20:13 +0800)]
qed: track dirty flag status

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-img: add dirty flag status
Dong Xu Wang [Thu, 15 Mar 2012 12:13:33 +0000 (20:13 +0800)]
qemu-img: add dirty flag status

Some block drivers can verify their image files are clean or not. So we can show
it while using "qemu-img info".

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqed: image fragmentation statistics
Dong Xu Wang [Thu, 15 Mar 2012 12:13:32 +0000 (20:13 +0800)]
qed: image fragmentation statistics

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-img: add image fragmentation statistics
Dong Xu Wang [Thu, 15 Mar 2012 12:13:31 +0000 (20:13 +0800)]
qemu-img: add image fragmentation statistics

Discussion can be found at:
http://patchwork.ozlabs.org/patch/128730/

This patch add image fragmentation statistics while using qemu-img check.

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: document job API
Paolo Bonzini [Fri, 30 Mar 2012 11:17:13 +0000 (13:17 +0200)]
block: document job API

I am not sure that these are really proper GtkDoc, but they follow
the existing documentation in block_int.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: set job->speed in block_set_speed
Paolo Bonzini [Fri, 30 Mar 2012 11:17:12 +0000 (13:17 +0200)]
block: set job->speed in block_set_speed

There is no need to do this in every implementation of set_speed
(even though there is only one right now).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: fix streaming/closing race
Paolo Bonzini [Fri, 30 Mar 2012 11:17:11 +0000 (13:17 +0200)]
block: fix streaming/closing race

Streaming can issue I/O while qcow2_close is running.  This causes the
L2 caches to become very confused or, alternatively, could cause a
segfault when the streaming coroutine is reentered after closing its
block device.  The fix is to cancel streaming jobs when closing their
underlying device.

The cancellation must be synchronous, on the other hand qemu_aio_wait
will not restart a coroutine that is sleeping in co_sleep.  So add
a flag saying whether streaming has in-flight I/O.  If the busy flag
is false, the coroutine is quiescent and, when cancelled, will not
issue any new I/O.

This protects streaming against closing, but not against deleting.
We have a reference count protecting us against concurrent deletion,
but I still added an assertion to ensure nothing bad happens.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: cancel jobs when a device is ready to go away
Paolo Bonzini [Fri, 30 Mar 2012 11:17:10 +0000 (13:17 +0200)]
block: cancel jobs when a device is ready to go away

We do not want jobs to keep a device busy for a possibly very long
time, and management could become confused because they thought a
device was not even there anymore.  So, cancel long-running jobs
as soon as their device is going to disappear.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: disable I/O throttling on sync api
Zhi Yong Wu [Mon, 2 Apr 2012 10:59:34 +0000 (18:59 +0800)]
block: disable I/O throttling on sync api

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoUse DMADirection type for dma_bdrv_io
David Gibson [Tue, 27 Mar 2012 02:42:23 +0000 (13:42 +1100)]
Use DMADirection type for dma_bdrv_io

Currently dma_bdrv_io() takes a 'to_dev' boolean parameter to
determine the direction of DMA it is emulating.  We already have a
DMADirection enum designed specifically to encode DMA directions.
This patch uses it for dma_bdrv_io() as well.  This involves removing
the DMADirection definition from the #ifdef it was inside, but since that
only existed to protect the definition of dma_addr_t from places where
config.h is not included, there wasn't any reason for it to be there in
the first place.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovdi: change goto to loop
Paolo Bonzini [Mon, 19 Mar 2012 17:07:51 +0000 (18:07 +0100)]
vdi: change goto to loop

Finally reindent all code and change goto statements to a loop.

Acked-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovdi: do not create useless iovecs
Paolo Bonzini [Mon, 19 Mar 2012 17:07:50 +0000 (18:07 +0100)]
vdi: do not create useless iovecs

Reads and writes to the underlying file can also occur with the simple
non-vectored I/O interfaces.

Acked-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovdi: leave bounce buffering to block layer
Paolo Bonzini [Mon, 19 Mar 2012 17:07:49 +0000 (18:07 +0100)]
vdi: leave bounce buffering to block layer

vdi.c really works as if it implemented bdrv_read and bdrv_write.  However,
because only vector I/O is supported by the asynchronous callbacks, it
went through extra pain to bounce-buffer the I/O.  This can be handled
by the block layer now that the format is coroutine-based.

Acked-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovdi: move aiocb fields to locals
Paolo Bonzini [Mon, 19 Mar 2012 17:07:48 +0000 (18:07 +0100)]
vdi: move aiocb fields to locals

Most of the AIOCB really holds local variables that need to persist
across callback invocation.  It can go away now.

Acked-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovdi: merge aio_read_cb and aio_write_cb into callers
Paolo Bonzini [Mon, 19 Mar 2012 17:07:47 +0000 (18:07 +0100)]
vdi: merge aio_read_cb and aio_write_cb into callers

Now inline the former AIO callbacks into vdi_co_readv and vdi_co_writev.
While many cleanups are possible, the code now really looks synchronous.

Acked-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovdi: move end-of-I/O handling at the end
Paolo Bonzini [Mon, 19 Mar 2012 17:07:46 +0000 (18:07 +0100)]
vdi: move end-of-I/O handling at the end

The next step is to take code that only triggers after the first operation,
and move it at the end of vdi_aio_read_cb and vdi_aio_write_cb.

Acked-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovdi: basic conversion to coroutines
Paolo Bonzini [Mon, 19 Mar 2012 17:07:45 +0000 (18:07 +0100)]
vdi: basic conversion to coroutines

Even a basic conversion changing the bdrv_aio_readv/bdrv_aio_writev calls
to bdrv_co_readv/bdrv_co_writev, and callbacks to goto statements can
eliminate a lot of code.  This is because error handling is simplified
and indirections through bottom halves can go away.

After this patch, I/O to the underlying file already happens via
coroutines, but the code still looks a lot like if asynchronous I/O was
being used.

Acked-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: enforce constraints on block size properties
Stefan Hajnoczi [Wed, 14 Mar 2012 15:57:06 +0000 (15:57 +0000)]
block: enforce constraints on block size properties

Nicolae Mogoreanu <mogo@google.com> noticed that I/O requests can lead
to QEMU crashes when the logical_block_size property is smaller than 512
bytes.

Using the new "blocksize" property we can properly enforce constraints
on the block size such that QEMU's block layer is able to operate
correctly.

Reported-by: Nicolae Mogoreanu <mogo@google.com>
Reported-by: Michael Halcrow <mhalcrow@google.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqdev: add blocksize property type
Stefan Hajnoczi [Wed, 14 Mar 2012 15:57:05 +0000 (15:57 +0000)]
qdev: add blocksize property type

Storage interfaces like virtio-blk can be configured with block size
information so that the guest can take advantage of efficient I/O
request sizes.

According to the SCSI Block Commands (SBC) standard a device's block
size is "almost always greater than one byte and may be a multiple of
512 bytes".  QEMU currently has a 512 byte minimum block size because
the block layer functions work at that granularity.  Furthermore, the
block size should be a power of 2 because QEMU calculates bitmasks from
the value.

Introduce a "blocksize" property type so devices can enforce these
constraints on block size values.  If the constraints are relaxed in the
future then this property can be updated.

Introduce the new PropertyValueNotPowerOf2 QError so QMP clients know
exactly why a block size value was rejected.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqerror: fix QERR_PROPERTY_VALUE_OUT_OF_RANGE description
Stefan Hajnoczi [Wed, 14 Mar 2012 15:57:04 +0000 (15:57 +0000)]
qerror: fix QERR_PROPERTY_VALUE_OUT_OF_RANGE description

Fix a typo in the description for QERR_PROPERTY_VALUE_OUT_OF_RANGE where
"'" was used instead of ")".

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock/vpc: write checksum back to footer after check
Zhang Shengju [Tue, 13 Mar 2012 14:38:13 +0000 (22:38 +0800)]
block/vpc: write checksum back to footer after check

After validation check, the 'checksum' is not written back
to footer, which leave it with zero.

This results in errors while loadding it under Microsoft's
Hyper-V environment, and also errors from utilities like
Citrix's vhd-util.

Signed-off-by: Zhang Shengju <sean_zhang@trendmicro.com.cn>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Adds wwn=hex qdev option
Floris Bos [Tue, 13 Mar 2012 12:31:47 +0000 (13:31 +0100)]
ide: Adds wwn=hex qdev option

Allow the user to specify a disk's World Wide Name.

Linux guests can address disks by their unique World Wide Name number
(e.g. /dev/disk/by-id/wwn-0x5001517959123522). This patch adds support
for assigning a World Wide Name number to a virtual IDE disk.

Cc: kwolf@redhat.com
Signed-off-by: Floris Bos <dev@noc-ps.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Change serial number strncpy() to pstrcpy()
Floris Bos [Mon, 12 Mar 2012 20:05:10 +0000 (21:05 +0100)]
ide: Change serial number strncpy() to pstrcpy()

strncpy may not null-terminate the destination string.

Cc: kwolf@redhat.com
Signed-off-by: Floris Bos <dev@noc-ps.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Add "model=s" qdev option
Floris Bos [Mon, 12 Mar 2012 20:05:09 +0000 (21:05 +0100)]
ide: Add "model=s" qdev option

Allow the user to override the default disk model name "QEMU HARDDISK".

Some Linux distributions use the /dev/disk/by-id/scsi-SATA_name-of-disk-
model_serial addressing scheme when refering to partitions in /etc/fstab
and elsewhere. This causes problems when starting a disk image taken from
an existing physical server under qemu, because when running under qemu
name-of-disk-model is always "QEMU HARDDISK".

This patch introduces a model=s option which in combination with the
existing serial=s option can be used to fake the disk the operating
system was previously on, allowing the OS to boot properly.

Cc: kwolf@redhat.com
Signed-off-by: Floris Bos <dev@noc-ps.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: IDENTIFY word 86 bit 14 is reserved
Kevin Wolf [Tue, 13 Mar 2012 13:44:22 +0000 (14:44 +0100)]
ide: IDENTIFY word 86 bit 14 is reserved

Reserved bits should be cleared to zero.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoaio: move BlockDriverAIOCB to qemu-aio.h
Paolo Bonzini [Mon, 12 Mar 2012 16:01:48 +0000 (17:01 +0100)]
aio: move BlockDriverAIOCB to qemu-aio.h

And remove several block_int.h inclusions that should not be there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: push recursive flushing up from drivers
Paolo Bonzini [Mon, 12 Mar 2012 17:26:01 +0000 (18:26 +0100)]
block: push recursive flushing up from drivers

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-io: add option to enable tracing
Stefan Hajnoczi [Mon, 12 Mar 2012 16:36:07 +0000 (16:36 +0000)]
qemu-io: add option to enable tracing

It can be useful to enable QEMU tracing when trying out block layer
interfaces via qemu-io.  Tracing can be enabled using the new -T FILE
option where the given file contains a list of trace events to enable
(just like the qemu --trace events=FILE option).

  $ echo qemu_vfree >my-events
  $ ./qemu-io -T my-events ...

Remember to use ./configure --enable-trace-backend=BACKEND when building
qemu-io.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: Remove unused parameter in get_cluster_table()
Kevin Wolf [Mon, 12 Mar 2012 16:46:51 +0000 (17:46 +0100)]
qcow2: Remove unused parameter in get_cluster_table()

Since everything goes through the cache, callers don't use the L2 table
offset any more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotracetool: Forbid argument name 'next'
Kevin Wolf [Mon, 12 Mar 2012 09:30:02 +0000 (10:30 +0100)]
tracetool: Forbid argument name 'next'

It has happened more than once that patches that look perfectly sane
and work with simpletrace broke systemtap because they use 'next' as an
argument name for a tracing function. However, 'next' is a keyword for
systemtap, so we shouldn't use it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agotrace-events: Rename 'next' argument
Kevin Wolf [Mon, 12 Mar 2012 09:28:34 +0000 (10:28 +0100)]
trace-events: Rename 'next' argument

'next' is a systemtap keyword, so it's a bad idea to use it as an
argument name.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoMerge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf
Blue Swirl [Wed, 4 Apr 2012 20:45:03 +0000 (20:45 +0000)]
Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf

* 's390-for-upstream' of git://repo.or.cz/qemu/agraf:
  target-s390x: Update s390x_{tod,cpu}_timer() to use S390CPU
  target-s390x: QOM'ify CPU init
  target-s390x: QOM'ify CPU reset
  target-s390x: QOM'ify CPU

12 years agoImprove interrupt handling priority
Artyom Tarasenko [Tue, 3 Apr 2012 15:49:05 +0000 (17:49 +0200)]
Improve interrupt handling priority

The vector interrupt has higher priority than interrupt_level_n.
Also check only interrupt_level_n concurency when TL > 0, the traps of
other types may be nested.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix vector interrupt handling
Artyom Tarasenko [Tue, 3 Apr 2012 15:49:04 +0000 (17:49 +0200)]
Fix vector interrupt handling

Don't produce stray irq 5, don't overwrite ivec_data if still busy with
processing of the previous interrupt.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-s390x: Update s390x_{tod,cpu}_timer() to use S390CPU
Andreas Färber [Mon, 2 Apr 2012 12:00:43 +0000 (14:00 +0200)]
target-s390x: Update s390x_{tod,cpu}_timer() to use S390CPU

In place of CPUS390XState pass S390CPU as opaque from the new initfn.
cpu_interrupt() is anticipated to take a CPUState in the future.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
12 years agotarget-s390x: QOM'ify CPU init
Andreas Färber [Mon, 2 Apr 2012 11:56:29 +0000 (13:56 +0200)]
target-s390x: QOM'ify CPU init

Move code from cpu_s390x_init() into an initfn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
12 years agotarget-s390x: QOM'ify CPU reset
Andreas Färber [Mon, 2 Apr 2012 11:31:59 +0000 (13:31 +0200)]
target-s390x: QOM'ify CPU reset

Move code from cpu_state_reset() to s390_cpu_reset().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
12 years agotarget-s390x: QOM'ify CPU
Andreas Färber [Mon, 2 Apr 2012 09:39:23 +0000 (11:39 +0200)]
target-s390x: QOM'ify CPU

Embed CPUS390XState as first member of S390CPU.
Since -cpu is being ignored, make TYPE_S390_CPU non-abstract.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
12 years agoqdev: put all devices under /machine
Paolo Bonzini [Wed, 28 Mar 2012 14:34:12 +0000 (16:34 +0200)]
qdev: put all devices under /machine

Avoid cluttering too much the QOM root.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: give all devices a canonical path
Paolo Bonzini [Tue, 27 Mar 2012 16:38:47 +0000 (18:38 +0200)]
qdev: give all devices a canonical path

A strong limitation of QOM right now is that unconverted ports
(e.g. all...) do not give a canonical path to devices that are
part of the board.  This in turn makes it impossible to replace
PROP_PTR with a QOM link for example.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: add children before qdev_init
Paolo Bonzini [Tue, 27 Mar 2012 16:38:46 +0000 (18:38 +0200)]
qdev: add children before qdev_init

We want the composition tree to to be in order by the time we call
qdev_init, so that a single set of the toplevel realize property can
propagate all the way down the composition tree.

This is not the case so far.  Unfortunately, this is incompatible
with calling qdev_init in the constructor wrappers for devices,
so for now we need to unattach some devices that are created through
those wrappers.  This will be fixed by removing qdev_init and instead
setting the toplevel realize property after machine init.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqom: add container_get
Paolo Bonzini [Tue, 27 Mar 2012 16:38:45 +0000 (18:38 +0200)]
qom: add container_get

This is QOM "mkdir -p".  It is useful when referring to
container objects such as "/machine".

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Mon, 2 Apr 2012 14:46:45 +0000 (09:46 -0500)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

* kiszka/queues/slirp:
  slirp: Signal free input buffer space to io-thread
  w32/slirp: Undefine error constants before their redefinition
  slirp: use socket_set_nonblock
  slirp: clean up conflicts with system headers

12 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Mon, 2 Apr 2012 14:44:35 +0000 (09:44 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging

* stefanha/tracing:
  tracetool: dtrace: handle in and next reserved words
  tracetool: dtrace disabled-events fix
  Makefile.target: code stp dependency on trace-events

12 years agoserial: clear LSR.TEMT when populating the TSR
Anthony Liguori [Sun, 1 Apr 2012 19:18:30 +0000 (14:18 -0500)]
serial: clear LSR.TEMT when populating the TSR

We never actually clear the TEMT (transmit sending register empty) flag when
populating the TSR.  We set the flag, but since it's never cleared, setting it
is sort of pointless..

I found this with a unit test case.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoserial: fix retry logic
Anthony Liguori [Sun, 1 Apr 2012 19:03:21 +0000 (14:03 -0500)]
serial: fix retry logic

I'm not sure if the retry logic has ever worked when not using FIFO mode.  I
found this while writing a test case although code inspection confirms it is
definitely broken.

The TSR retry logic will never actually happen because it is guarded by an
'if (s->tsr_rety > 0)' but this is the only place that can ever make the
variable greater than zero.  That effectively makes the retry logic an 'if (0)'.

I believe this is a typo and the intention was >= 0.  Once this is fixed though,
I see double transmits with my test case.  This is because in the non FIFO
case, serial_xmit may get invoked while LSR.THRE is still high because the
character was processed but the retransmit timer was still active.

We can handle this by simply checking for LSR.THRE and returning early.  It's
possible that the FIFO paths also need some attention.

Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqtest: use qemu_gettimeofday()
Anthony Liguori [Fri, 30 Mar 2012 19:04:04 +0000 (14:04 -0500)]
qtest: use qemu_gettimeofday()

On linux, qemu_timeval will always be two long ints.  On windows, we use our
own struct definition.  This should fix win64.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomilkymist-vgafb: add missing register
Michael Walle [Sat, 31 Mar 2012 17:55:25 +0000 (19:55 +0200)]
milkymist-vgafb: add missing register

This bug existed since the first commit. Fortunately, the affected
registers have no functionality in qemu. This will only prevent the
following warning:
  milkymist_vgafb: write access to unknown register 0x00000034

Signed-off-by: Michael Walle <michael@walle.cc>
12 years agotarget-lm32: add simple disassembler
Michael Walle [Sat, 31 Mar 2012 17:54:20 +0000 (19:54 +0200)]
target-lm32: add simple disassembler

Because binutils disassembler is based on libopcode, this is a rewrite from
scratch.

Signed-off-by: Michael Walle <michael@walle.cc>
12 years agomilkymist-sysctl: support for new core version
Michael Walle [Sat, 31 Mar 2012 17:54:09 +0000 (19:54 +0200)]
milkymist-sysctl: support for new core version

The new version introduces the following new registers:
 - SoC clock frequency: read-only of system clock used on the SoC
 - debug scratchpad: 8 bit scratchpad register
 - debug write lock: write once register, without any function on QEMU

Signed-off-by: Michael Walle <michael@walle.cc>
12 years agotarget-lm32: init tcg only if available
Michael Walle [Sat, 31 Mar 2012 17:54:05 +0000 (19:54 +0200)]
target-lm32: init tcg only if available

Once qtest support for target-lm32 arrives, tcg may be disabled.

Signed-off-by: Michael Walle <michael@walle.cc>
12 years agotests: fix out-of-tree building for lm32 target
Michael Walle [Sat, 31 Mar 2012 17:53:51 +0000 (19:53 +0200)]
tests: fix out-of-tree building for lm32 target

Signed-off-by: Michael Walle <michael@walle.cc>
12 years agoMerge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Blue Swirl [Sat, 31 Mar 2012 12:10:07 +0000 (12:10 +0000)]
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm

* 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm:
  pl031: switch clock base to rtc_clock
  pl031: rearm alarm timer upon load
  arm: switch real-time clocks to rtc_clock
  omap: switch omap_lpg to vm_clock
  rtc: add -rtc clock=rt

12 years agoMerge branch 'qom-cpu-unicore32.v3' of git://github.com/afaerber/qemu-cpu
Blue Swirl [Sat, 31 Mar 2012 12:09:06 +0000 (12:09 +0000)]
Merge branch 'qom-cpu-unicore32.v3' of git://github.com/afaerber/qemu-cpu

* 'qom-cpu-unicore32.v3' of git://github.com/afaerber/qemu-cpu:
  target-unicore32: Move CPU-dependent init into initfn
  target-unicore32: QOM'ify CPU
  target-unicore32: License future contributions under GPLv2+
  target-unicore32: Relicense to GPLv2+
  MAINTAINERS: Add entry for UniCore32

12 years agoMerge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Blue Swirl [Sat, 31 Mar 2012 12:06:10 +0000 (12:06 +0000)]
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm

* 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm:
  ARM: Permit any ARMv6K CPU to read the MVFR0 and MVFR1 VFP registers.
  target-arm: Minimalistic CPU QOM'ification
  target-arm: Drop cpu_arm_close()

12 years agobuildfix: check for old pod2man versions
Gerd Hoffmann [Thu, 29 Mar 2012 08:55:18 +0000 (10:55 +0200)]
buildfix: check for old pod2man versions

Older pod2man don't have a --utf8 switch, check for this in conffigure
and use it only when present.  Fixes build on RHEL-5.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix conversion from lower to upper case with Turkish locale
Stefan Weil [Tue, 27 Mar 2012 17:23:53 +0000 (19:23 +0200)]
Fix conversion from lower to upper case with Turkish locale

Some locale settings let make fail or create wrong results
because tr '[:lower:]' '[:upper:]' which is used to convert
from lower to upper case depends on the locale.

With locale tr_TR.UTF-8, lower case 'i' is not converted to 'I'.
This results in wrong entries in config-host.h like these ones:

  #define CONFIG_QEMU_PREFiX "/usr/local"
  #define CONFIG_QEMU_BiNDiR "/usr/local/bin"

This problem was reported by Emre Ersin.

The same problem occurs when configure creates the target specific
files config-target.mak. They get wrong declarations:

TARGET_CRiS=y
TARGET_i386=y
TARGET_MiCROBLAZE=y
TARGET_MiPS64=y
TARGET_MiPS=y
TARGET_UNiCORE32=y

It is sufficient to restrict the conversion to the characters a-z.

Using this explicit range avoids the dependency on the locale
settings and is also shorter.

v2:
POSIX says that 'tr a-z' is unspecified outside of the POSIX
locale, so we must set LC_ALL=C to make sure that we are using
POSIX (hint from Eric Blake, thanks).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqtest: avoid a warning with RTC test
Blue Swirl [Fri, 30 Mar 2012 17:42:27 +0000 (17:42 +0000)]
qtest: avoid a warning with RTC test

Avoid this warning on OpenBSD:
  CC    tests/rtc-test.o
/src/qemu/tests/rtc-test.c: In function 'check_time':
/src/qemu/tests/rtc-test.c:171: warning: format '%ld' expects type 'long int', but argument 2 has type 'time_t'
/src/qemu/tests/rtc-test.c:173: warning: format '%ld' expects type 'long int', but argument 2 has type 'time_t'

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqtest: fix 32-bit build
Anthony Liguori [Fri, 30 Mar 2012 17:53:54 +0000 (12:53 -0500)]
qtest: fix 32-bit build

time_t appears to be an unsigned long so use %ld.

Reported-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoslirp: Signal free input buffer space to io-thread
Jan Kiszka [Fri, 30 Mar 2012 17:29:08 +0000 (19:29 +0200)]
slirp: Signal free input buffer space to io-thread

This massively accelerates slirp reception speed: If data arrives
faster than the guest can read it from the input buffer, the file
descriptor for the corresponding socket was taken out of the fdset for
select. However, the event of the guest reading enough data from the
buffer was not signaled. Thus, the io-thread only noticed this change
on the next time-driven poll. Fix this by kicking the io-thread as
required.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoqtest: fix out of tree build
Blue Swirl [Fri, 30 Mar 2012 17:39:33 +0000 (17:39 +0000)]
qtest: fix out of tree build

Trace objects are also needed if tracing is enabled.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqtest: add rtc-test test-case
Anthony Liguori [Wed, 28 Mar 2012 13:42:07 +0000 (15:42 +0200)]
qtest: add rtc-test test-case

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agortc: split out macros into a header file and use in test case
Anthony Liguori [Wed, 28 Mar 2012 13:42:06 +0000 (15:42 +0200)]
rtc: split out macros into a header file and use in test case

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqtest: add C version of test infrastructure
Anthony Liguori [Wed, 28 Mar 2012 13:42:05 +0000 (15:42 +0200)]
qtest: add C version of test infrastructure

This also includes a qtest wrapper script to make it easier to launch qtest
tests directly.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqtest: add clock management
Paolo Bonzini [Wed, 28 Mar 2012 13:42:04 +0000 (15:42 +0200)]
qtest: add clock management

This patch combines qtest and -icount together to turn the vm_clock
into a source that can be fully managed by the client.  To this end new
commands clock_step and clock_set are added.  Hooking them with libqtest
is left as an exercise to the reader.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqtest: IRQ interception infrastructure
Paolo Bonzini [Wed, 28 Mar 2012 13:42:03 +0000 (15:42 +0200)]
qtest: IRQ interception infrastructure

Since /i440fx/piix3 is being removed from the composition tree, the
IO-APIC is placed under /i440fx.  This is wrong and should be changed
as soon as the /i440fx/piix3 path is put back.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqtest: add test framework
Anthony Liguori [Wed, 28 Mar 2012 13:42:02 +0000 (15:42 +0200)]
qtest: add test framework

The idea behind qtest is pretty simple.  Instead of executing a CPU via TCG or
KVM, rely on an external process to send events to the device model that the CPU
would normally generate.

qtest presents itself as an accelerator.  In addition, a new option is added to
establish a qtest server (-qtest) that takes a character device.  This is what
allows the external process to send CPU events to the device model.

qtest uses a simple line based protocol to send the events.  Documentation of
that protocol is in qtest.c.

I considered reusing the monitor for this job.  Adding interrupts would be a bit
difficult.  In addition, logging would also be difficult.

qtest has extensive logging support.  All protocol commands are logged with
time stamps using a new command line option (-qtest-log).  Logging is important
since ultimately, this is a feature for debugging.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agotest makefile overhaul
Paolo Bonzini [Wed, 28 Mar 2012 13:42:01 +0000 (15:42 +0200)]
test makefile overhaul

This introduces new test reporting infrastructure based on
gtester and gtester-report.

Also, all existing tests are moved to tests/, and tests/Makefile
is reorganized to factor out the commonalities in the rules.

Signed-off-by: Anthony Liguori <aliguori@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agotracetool: dtrace: handle in and next reserved words
Alon Levy [Thu, 29 Mar 2012 21:35:36 +0000 (23:35 +0200)]
tracetool: dtrace: handle in and next reserved words

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotracetool: dtrace disabled-events fix
Lee Essen [Tue, 20 Mar 2012 17:02:40 +0000 (17:02 +0000)]
tracetool: dtrace disabled-events fix

If there are "disabled" entries in the trace-events file then
linetod_nop() is called if the backend is dtrace, it's currently
not present. Also equivalent fix for stap.

Signed-off-by: Lee Essen <lee.essen@nowonline.co.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoMakefile.target: code stp dependency on trace-events
Alon Levy [Sun, 18 Mar 2012 07:47:15 +0000 (08:47 +0100)]
Makefile.target: code stp dependency on trace-events

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agopl031: switch clock base to rtc_clock
Paolo Bonzini [Fri, 30 Mar 2012 10:31:23 +0000 (10:31 +0000)]
pl031: switch clock base to rtc_clock

This lets the user specify the desired semantics.  By default, the RTC
will follow adjustments from the host's NTP client, and will remain in
sync when the virtual machine is stopped.  The previous behavior, which
provides determinism with both icount and qtest, remains available with
"-rtc clock=vm".

pl031 supports migration, so we need to convert the time base from
rtc_clock to vm_clock and back for backwards compatibility.  (The
rtc_clock may not be synchronized on the two machines, especially with
savevm/loadvm, so the conversion is needed anyway.  And since any time
base will do, why not pick the one base that is backwards compatible).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agopl031: rearm alarm timer upon load
Paolo Bonzini [Fri, 30 Mar 2012 10:31:22 +0000 (10:31 +0000)]
pl031: rearm alarm timer upon load

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoarm: switch real-time clocks to rtc_clock
Paolo Bonzini [Fri, 30 Mar 2012 10:31:22 +0000 (10:31 +0000)]
arm: switch real-time clocks to rtc_clock

This lets the user specify the desired semantics.  By default, the RTC
will follow adjustments from the host's NTP client.  "-rtc clock=vm" will
improve determinism with both icount and qtest.  Finally, the previous
behavior is available with "-rtc clock=rt".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap: switch omap_lpg to vm_clock
Paolo Bonzini [Fri, 30 Mar 2012 10:31:22 +0000 (10:31 +0000)]
omap: switch omap_lpg to vm_clock

The output of the pulse generator needs to be deterministic when
running in -icount mode, and to remain constant whenever the VM is
stopped.  So the right clock to use is vm_clock.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agortc: add -rtc clock=rt
Paolo Bonzini [Fri, 30 Mar 2012 10:31:21 +0000 (10:31 +0000)]
rtc: add -rtc clock=rt

This will let people use backwards-compatible semantics for devices that
will be affected by the following patches.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoARM: Permit any ARMv6K CPU to read the MVFR0 and MVFR1 VFP registers.
Andrew Towers [Thu, 29 Mar 2012 02:41:08 +0000 (02:41 +0000)]
ARM: Permit any ARMv6K CPU to read the MVFR0 and MVFR1 VFP registers.

This patch replaces the ARM_FEATURE_VFP3 test when reading MVFR registers
with a test for a new feature flag ARM_FEATURE_MVFR, and sets this feature
for all ARMv6K cores (ARM1156 is not a v6K core, yet supports MVFR; qemu
does not support ARM1156 at this time.)

MVFR0 and MVFR1 were introduced in ARM1136JF-S r1p0 (ARMv6K, VFPv2) and are
present in ARM1156T2F-S (non-v6K), ARM1176JZF-S, ARM11MPCore and newer cores.
Reference: ARM DDI 0211H, 0290G, 0301H, 0360E.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0211h/Ffbefjag.html

Without this change, the linux kernel will not boot with VFP support enabled
under ARM1176 system emulation, due to the unconditional use of MVFR1 at the
end of vfp_init() in arch/arm/vfp/vfpmodule.c:

  VFP support v0.3: implemetor 41 architecture 1 part 20 variant b rev 5
  Internal error: Oops - undefined instruction: 0 [#1]

Signed-off-by: Andrew Towers <atowers@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-unicore32: Move CPU-dependent init into initfn
Andreas Färber [Thu, 29 Mar 2012 16:03:18 +0000 (18:03 +0200)]
target-unicore32: Move CPU-dependent init into initfn

Instead of setting values in a CPUID switch, do so in initfn functions.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
12 years agotarget-unicore32: QOM'ify CPU
Andreas Färber [Tue, 14 Feb 2012 00:16:17 +0000 (01:16 +0100)]
target-unicore32: QOM'ify CPU

Embed CPUUniCore32State as first member of UniCore32CPU.

Contributed under GPLv2+.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
12 years agotarget-unicore32: License future contributions under GPLv2+
Andreas Färber [Thu, 15 Mar 2012 14:02:14 +0000 (15:02 +0100)]
target-unicore32: License future contributions under GPLv2+

This is to limit relicensing obstacles to the pending IBM investigation.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
12 years agotarget-unicore32: Relicense to GPLv2+
Andreas Färber [Tue, 13 Mar 2012 15:48:19 +0000 (16:48 +0100)]
target-unicore32: Relicense to GPLv2+

Adopt the license text suggested by Guan Xue-tao (with a minor
simplification) for all target-unicore/ files except helper.c.

To helper.c Anthony Liguori contributed a qemu_malloc() -> g_malloc()
conversion, still pending IBM relicensing approval, so that remains
GPLv2 for now.

By relicensing all possible parts now, we avoid having to formally
relicense new, e.g., QOM code.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Dor Laor <dlaor@redhat.com>
12 years agoMAINTAINERS: Add entry for UniCore32
Andreas Färber [Tue, 13 Mar 2012 23:45:43 +0000 (00:45 +0100)]
MAINTAINERS: Add entry for UniCore32

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
12 years agoMerge remote-tracking branch 'origin/master' into staging
Anthony Liguori [Thu, 29 Mar 2012 18:32:41 +0000 (13:32 -0500)]
Merge remote-tracking branch 'origin/master' into staging

* origin/master:
  qemu tcg: Remove one entry of INDEX_op_ld_i64 from ppc_op_defs

12 years agotarget-arm: Minimalistic CPU QOM'ification
Andreas Färber [Thu, 29 Mar 2012 04:50:31 +0000 (04:50 +0000)]
target-arm: Minimalistic CPU QOM'ification

Introduce only one non-abstract type TYPE_ARM_CPU and do not touch
cp15 registers to not interfere with Peter's ongoing remodelling.
Embed CPUARMState as first (additional) field of ARMCPU.

Let CPUClass::reset() call cpu_state_reset() for now.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Drop cpu_arm_close()
Andreas Färber [Thu, 29 Mar 2012 04:50:30 +0000 (04:50 +0000)]
target-arm: Drop cpu_arm_close()

It's unused, so no need to QOM'ify it later.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoqemu tcg: Remove one entry of INDEX_op_ld_i64 from ppc_op_defs
Li Zhang [Thu, 29 Mar 2012 03:29:02 +0000 (14:29 +1100)]
qemu tcg: Remove one entry of INDEX_op_ld_i64 from ppc_op_defs

There two entries of INDEX_op_ld_i64 in the ppc_op_defs.  That causes an
assertion failure in tcg_add_target_add_op_defs() when --enable-debug is
used on a ppc64 backend (that's ppc64 host, not target).

Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: malc <av1474@comtv.ru>
12 years agow32/slirp: Undefine error constants before their redefinition
Jan Kiszka [Wed, 28 Mar 2012 19:03:42 +0000 (21:03 +0200)]
w32/slirp: Undefine error constants before their redefinition

Less warnings for your console.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: use socket_set_nonblock
Paolo Bonzini [Thu, 22 Mar 2012 00:02:52 +0000 (01:02 +0100)]
slirp: use socket_set_nonblock

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: clean up conflicts with system headers
Paolo Bonzini [Thu, 22 Mar 2012 00:02:51 +0000 (01:02 +0100)]
slirp: clean up conflicts with system headers

Right now, slirp/slirp.h cannot include some system headers and,
indirectly, qemu_socket.h.  Clean this up, and remove a duplicate
prototype that was introduced because of that.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>