Pavel Hrdina [Wed, 13 Jun 2012 13:43:11 +0000 (15:43 +0200)]
fdc: fix implied seek while there is no media in drive
The Windows uses 'READ' command at the start of an instalation
without checking the 'dir' register. We have to abort the transfer
with an abnormal termination if there is no media in the drive.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Stefan Hajnoczi [Thu, 14 Jun 2012 10:42:23 +0000 (11:42 +0100)]
qcow2: fix autoclear image header update
The autoclear feature bits can be used for qcow2 file format features
that are safe to "drop" by old programs that do not understand the
feature. Upon opening the image file unknown autoclear feature bits are
cleared and the image file header is rewritten, but this was happening
too early in the code when critical header fields were not yet loaded.
Process autoclear feature bits after all necessary header information
has been loaded.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Wed, 13 Jun 2012 08:11:50 +0000 (10:11 +0200)]
xen: Don't peek behind the BlockDriverState abstraction
First offender is xen_config_dev_blk()'s use of disk->bdrv->filename.
Get the filename from disk->opts instead. Same result, except for
snapshots: there, we now get the filename specified by the user
instead of the name of the temporary image created by bdrv_open().
Should be an improvement.
Second offender is blk_init()'s use of blkdev->bs->drv->format_name.
Simply use the appropriate interface to get the format name.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Wed, 13 Jun 2012 08:11:49 +0000 (10:11 +0200)]
xen: Don't change -drive if=xen device name during machine init
A "top" BlockDriverState has a non-empty device_name. If the user
doesn't specify one with -drive parameter id, the system supplies a
default name.
xen_config_dev_blk() changes this name, during machine initialization.
Naughty. Don't do that.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Wed, 13 Jun 2012 08:11:48 +0000 (10:11 +0200)]
block: Replace bdrv_get_format() by bdrv_get_format_name()
So callers don't need to know anything about maximum name length.
Returning a pointer is safe, because the name string lives as long as
the block driver it names, and block drivers don't die.
Requested by Peter Maydell.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Stefan Hajnoczi [Wed, 13 Jun 2012 13:29:15 +0000 (14:29 +0100)]
qemu-img: document qed format on qemu-img man page
The qemu-img.1 man page is missing the qed format from its list of
supported formats. Document the image creation options for qed.
Suggested-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Wed, 13 Jun 2012 15:15:14 +0000 (17:15 +0200)]
qemu-iotests: COW with many AIO requests on the same cluster
This one is a bit more interesting. The COW operation isn't performed
completely synchronously, and therefore dependencies must be handled
correctly when multiple requests write to the same unallocated cluster.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Kevin Wolf [Wed, 13 Jun 2012 14:01:31 +0000 (16:01 +0200)]
qemu-iotests: Some backing file COW tests
Looks like we're still missing these very basic tests for backing file
handling.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Kevin Wolf [Tue, 22 May 2012 15:01:20 +0000 (17:01 +0200)]
qcow2: Fix avail_sectors in cluster allocation code
avail_sectors should really be the number of sectors from the start of
the allocation, not from the start of the write request.
We're lucky enough that this mistake didn't cause any real bug.
avail_sectors is only used in the intialiser of QCowL2Meta:
.nb_available = MIN(requested_sectors, avail_sectors),
m->nb_available in turn is only used for COW at the end of the
allocation. A COW occurs only if the request wasn't cluster aligned,
which in turn would imply that requested_sectors was less than
avail_sectors (both in the original and in the fixed version). In this
case avail_sectors is ignored and therefore the mistake doesn't cause
any misbehaviour.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Tue, 22 May 2012 14:58:48 +0000 (16:58 +0200)]
qcow2: Simplify calculation for COW area at the end
copy_sectors() always uses the sum (cluster_offset + n_start) or
(start_sect + n_start), so if some value is added to both cluster_offset
and start_sect, and subtracted from n_start, it's cancelled out anyway.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:55 +0000 (00:04 +0200)]
qcow2: always operate caches in writeback mode
Writethrough does not need special-casing anymore in the qcow2 caches.
The block layer adds flushes after every guest-initiated data write,
and these will also flush the qcow2 caches to the OS.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:54 +0000 (00:04 +0200)]
ide: support enable/disable write cache
Enabling or disabling the write cache is done with the SET FEATURES
command. The command can be issued with sg_sat_set_features from
sg3-utils.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:53 +0000 (00:04 +0200)]
block: always open drivers in writeback mode
Formats are entirely in charge of flushes for metadata writes. For
guest-initiated writes, a writethrough cache is faked in the block layer.
So we can always open in writeback mode.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:52 +0000 (00:04 +0200)]
block: add bdrv_set_enable_write_cache
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:51 +0000 (00:04 +0200)]
block: copy enable_write_cache in bdrv_append
Because the guest will be able to flip enable_write_cache, the actual
state may not match what is used to open the new snapshot.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:50 +0000 (00:04 +0200)]
savevm: flush after saving vm state
Writing vm state uses bdrv_pwrite, so it will automatically get flushes
in writethrough mode. But doing a flush at the end in writeback mode
is probably a good idea anyway.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 5 Jun 2012 22:04:49 +0000 (00:04 +0200)]
block: flush in writethrough mode after writes
We want to make the formats handle their own flushes
autonomously, while keeping for guests the ability to use a writethrough
cache. Since formats will write metadata via bs->file, bdrv_co_do_writev
is the only place where we need to add a flush.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Wed, 6 Jun 2012 14:23:27 +0000 (16:23 +0200)]
qemu-iotests: start vms in qtest mode
This way, they will not execute any VM code at all. However, right now
the cancellation test is "relying" on being slowed down by TCG executing
BIOS code. So, change the timeouts.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Wed, 6 Jun 2012 14:23:26 +0000 (16:23 +0200)]
qemu-iotests: fill streaming test image with data
The TestStreamStop test case is racy; if the job completes before we can
cancel it, it fails. If we remove the sleep the job will be canceled
before it has even started, and the test succeeds but it is also not
testing anything interesting.
But if the image is left sparse, then the job has really nothing to do.
For qcow2 it will read one L2-table, for raw it will issue a bunch of
ioctls. This also falls under "not testing anything interesting", and
this may be happening right now (depending on the filesystem) since the
file protocol got an is_allocated method.
Filling the test image with data ensures that the test covers the
intended case. It also slows down the test, which will be particularly
important after the next patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Tue, 5 Jun 2012 14:49:25 +0000 (16:49 +0200)]
scsi-disk: Don't peek behind the BlockDriverState abstraction
Use the appropriate interface instead.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Tue, 5 Jun 2012 14:49:24 +0000 (16:49 +0200)]
block: New bdrv_get_flags()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Pavel Dovgaluk [Wed, 30 May 2012 06:08:04 +0000 (10:08 +0400)]
Prevent disk data loss when closing qemu
Prevent disk data loss when closing qemu console window
under Windows 7.
v3. Comment for Sleep() parameter was updated.
Signed-off-by: Pavel Dovgalyuk<pavel.dovgaluk@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Tue, 5 Jun 2012 12:52:53 +0000 (14:52 +0200)]
block: Simplify how drive_init() computes default ID
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
MORITA Kazutaka [Wed, 30 May 2012 00:03:55 +0000 (09:03 +0900)]
sheepdog: add coroutine_fn markers to coroutine functions
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Josh Durgin [Thu, 17 May 2012 20:42:29 +0000 (13:42 -0700)]
rbd: hook up cache options
Writeback caching was added in Ceph 0.46, and writethrough will be in
0.47. These are controlled by general config options, so there's no
need to check for librbd version.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Fri, 11 May 2012 16:18:36 +0000 (18:18 +0200)]
qcow2: Support for fixing refcount inconsistencies
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Fri, 11 May 2012 16:16:54 +0000 (18:16 +0200)]
qemu-img check: Print fixed clusters and recheck
When any inconsistencies have been fixed, print the statistics and run
another check to make sure everything is correct now.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Fri, 11 May 2012 14:07:02 +0000 (16:07 +0200)]
qemu-img check -r for repairing images
The QED block driver already provides the functionality to not only
detect inconsistencies in images, but also fix them. However, this
functionality cannot be manually invoked with qemu-img, but the
check happens only automatically during bdrv_open().
This adds a -r switch to qemu-img check that allows manual invocation
of an image repair.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster [Fri, 11 May 2012 15:22:19 +0000 (17:22 +0200)]
Un-inline fdctrl_init_isa()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Max Filippov [Fri, 8 Jun 2012 09:50:34 +0000 (13:50 +0400)]
xtensa_lx60: add missing #include "blockdev.h"
This should fix the following build failure:
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c: In function 'lx_init':
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: warning: implicit declaration of function 'drive_get'
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: warning: nested extern declaration of 'drive_get'
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: error: 'IF_PFLASH' undeclared (first use in this function)
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: error: (Each undeclared identifier is reported only once
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: error: for each function it appears in.)
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:216: error: dereferencing pointer to incomplete type
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Wed, 9 May 2012 14:09:46 +0000 (16:09 +0200)]
stream: move rate limiting to a separate header file
Make the code reusable.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 8 May 2012 14:52:01 +0000 (16:52 +0200)]
stream: move is_allocated_above to block.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Tue, 8 May 2012 14:52:00 +0000 (16:52 +0200)]
stream: tweak usage of bdrv_co_is_allocated
is_allocated_base has complex semantics that are not really usable
outside streaming. Split the check in two parts, where the allocated
state for the top bs is moved to the caller. The resulting function
is more generally useful.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Paolo Bonzini [Wed, 9 May 2012 14:49:58 +0000 (16:49 +0200)]
block: implement is_allocated for raw
Either FIEMAP, or SEEK_DATA+SEEK_HOLE can be used to implement the
is_allocated callback for raw files. On Linux ext4, btrfs and XFS
all support it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Zhi Yong Wu [Sat, 28 Apr 2012 07:38:08 +0000 (15:38 +0800)]
qcow2: fix endianness conversion
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>
Zhi Yong Wu [Sat, 28 Apr 2012 07:37:42 +0000 (15:37 +0800)]
qcow2: remove a line of unnecessary code
Commit
3948d1d4 removed the pointer argument we filled in with l2_offset
but forgot to remove the unnecessary l2_offset assignment.
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>
malc [Fri, 15 Jun 2012 11:53:34 +0000 (15:53 +0400)]
Merge branch 'master' of git://git.qemu.org/qemu
Kevin Wolf [Fri, 15 Jun 2012 11:43:18 +0000 (13:43 +0200)]
qcow2: Silence false warning
Some gcc versions seem not to be able to figure out that the switch
statement covers all possible values and that c is therefore always
initialised. Add a default branch for them.
Reported-by: malc <av1474@comtv.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
Lars Persson [Thu, 14 Jun 2012 14:23:55 +0000 (16:23 +0200)]
cris: Fix NMI-flag handling on crisv10.
- The M-flag is encoded in different bits on cris v10 and cris v32.
Signed-off-by: Lars Persson <larper@axis.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:51 +0000 (14:46 +1000)]
xilinx_axidma: changed device name
Changed device name to xlnx,axi-dma. This is the exact name of the device in the
Xilinx EDK development tools.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:49 +0000 (14:46 +1000)]
xilinx_axienet: changed device name
Changed device name to xlnx,axi-ethernet. This is the exact name of the
device in the xilinx EDK development tools.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:48 +0000 (14:46 +1000)]
xilinx_axienet: droped the c_ on parameters
Even though the xilinx tools do have C_ on all params by default, drop this
for consistency with all the other xilinx IP (I.E. param names are the xilinx
names without the C_ prefix)
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:47 +0000 (14:46 +1000)]
xilinx_ethlite: changed device name
Changed device name to xlnx,xps-ethernetlite. This is the exact name of the
device in the xilinx EDK development tools.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:46 +0000 (14:46 +1000)]
xilinx_ethlite: tweaked naming of ping-pong props
Changed "txpingpong" prop to "tx-ping-pong". Same for rx. This is done to
make the property name exactly match what is output by the xilinx tools for
this IP.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:45 +0000 (14:46 +1000)]
xilinx_intc: changed device name
Changed device name to xlnx,xps-intc. This is the exact name of the device
in the xilinx EDK development tools.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:44 +0000 (14:46 +1000)]
xilinx_timer: changed device name
Changed device name to xlnx,xps-timer. This is the exact name of the device
in the xilinx EDK development tools.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:43 +0000 (14:46 +1000)]
xilinx_timer: changed nr_timers to one_timer_only
The configurable property for this IP in the Xilinx tools is a boolean switch
"one-timer-only" that flicks this timer from being dual channel to single.
Updated QEMU to work the same way for better match with the IP core and its TRM.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:42 +0000 (14:46 +1000)]
xilinx_timer: added default frequency
Added a reasonable default frequency for the xilinx timer (the 62MHz from
s3adsp machine model).
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:41 +0000 (14:46 +1000)]
xilinx_uartlite: changed device name
Changed device name to xlnx,xps-uartlite. This is the exact name of the device
in the xilinx EDK development tools.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter A. G. Crosthwaite [Wed, 13 Jun 2012 04:46:50 +0000 (14:46 +1000)]
xilinx_axidma: (un)reversed irq initialisation
The axidma irq orders are reversed in both the device model and the instantion.
Undid both reversal (for no net change). Also needs to be reversed for
consistency with Xilinx tools IRQ listing.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Andreas Färber [Sat, 9 Jun 2012 01:54:31 +0000 (03:54 +0200)]
xilinx_axi*: Share devices between microblaze and microblazeel
Speeds up the build.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Andreas Färber [Sat, 9 Jun 2012 01:54:30 +0000 (03:54 +0200)]
qemu-log: Allow usage in libhw
Add #ifdef to avoid complaint about use of poisoned "env".
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Andreas Färber [Sat, 9 Jun 2012 01:54:29 +0000 (03:54 +0200)]
hw/xilinx_*: Share Xilinx devices between ppc and microblaze
Speeds up the build.
xilinx_ethlite uses tswap32() and is thus target-dependent.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Edgar E. Iglesias [Tue, 5 Jul 2011 10:56:41 +0000 (12:56 +0200)]
cris: Add break support for v10.
Still no retb
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
Anthony Liguori [Mon, 11 Jun 2012 17:15:52 +0000 (12:15 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
* qemu-kvm/uq/master:
kvm: i8254: Fix conversion of in-kernel to userspace state
kvm/apic: correct short memset
Anthony Liguori [Mon, 11 Jun 2012 17:15:51 +0000 (12:15 -0500)]
Merge remote-tracking branch 'sstabellini/for_1.1.1' into staging
* sstabellini/for_1.1.1:
qemu/xendisk: set maximum number of grants to be used
Anthony Liguori [Mon, 11 Jun 2012 17:15:51 +0000 (12:15 -0500)]
Merge remote-tracking branch 'afaerber-or/qom-cpu-3a' into staging
* afaerber-or/qom-cpu-3a: (27 commits)
target-s390x: Pass S390CPU to s390_cpu_restart()
s390-virtio: Let s390_cpu_addr2state() return S390CPU
s390-virtio: Use cpu_s390x_init() to obtain S390CPU
target-s390x: Let cpu_s390x_init() return S390CPU
xen_machine_pv: Use cpu_x86_init() to obtain X86CPU
arm_pic: Pass ARMCPU to arm_pic_init_cpu()
arm_boot: Pass ARMCPU to arm_load_kernel()
xilinx_zynq: Use cpu_arm_init() to obtain ARMCPU
pxa2xx_gpio: Store ARMCPU in PXA2xxGPIOInfo
pxa2xx_pic: Store ARMCPU in PXA2xxPICState
pxa2xx: Pass ARMCPU to pxa2xx_pic_init()
exynos4210: Use cpu_arm_init() to store ARMCPU
vexpress: Use cpu_arm_init() to obtain ARMCPU
realview: Use cpu_arm_init() to obtain ARMCPU
arm_boot: Pass ARMCPU to arm_boot_info::secondary_cpu_reset_hook()
arm_boot: Pass ARMCPU to arm_boot_info::write_secondary_boot()
versatilepb: Use cpu_arm_init() to obtain ARMCPU
musicpal: Use cpu_arm_init() to obtain ARMCPU
integratorcp: Use cpu_arm_init() to obtain ARMCPU
strongarm: Use cpu_arm_init() to store ARMCPU in StrongARMState
...
Anthony Liguori [Mon, 11 Jun 2012 17:15:51 +0000 (12:15 -0500)]
Merge remote-tracking branch 'afaerber-or/qom-next-1' into staging
* afaerber-or/qom-next-1:
target-i386: Use uint32 visitor for [x]level properties
qdev: Remove PropertyInfo range checking
qdev: Switch property accessors to fixed-width visitor interfaces
qdev: Use int32_t container for devfn property
qapi: Add String visitor coverage to serialization unit tests
qapi: String visitor, use %f representation for floats
qapi: Unit tests for visitor-based serialization
qapi: Add Visitor interfaces for uint*_t and int*_t
Anthony Liguori [Mon, 11 Jun 2012 17:15:51 +0000 (12:15 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
* stefanha/trivial-patches:
configure: report missing libraries for virtfs
trace/simple.c: fix deprecated glib2 interface
Clarify comments of tb_invalidate_phys_[page_]range
Anthony Liguori [Mon, 11 Jun 2012 17:07:00 +0000 (12:07 -0500)]
Merge remote-tracking branch 'kraxel/usb.52' into staging
* kraxel/usb.52: (37 commits)
ehci: rework frame skipping
ehci: adaptive wakeup rate.
ehci: create ehci_update_frindex
ehci: remove unused attach_poll_counter
ehci: fix halt status handling
ehci: update status bits in ehci_set_state
ehci: add ehci_*_enabled() helpers
ehci: fix reset
ehci: kick async schedule on wakeup
ehci: schedule async bh on async packet completion
ehci: move async schedule to bottom half
ehci: add async field to EHCIQueue
ehci: tweak queue initialization
ehci: add queuing support
ehci: move ehci_flush_qh
ehci: cache USBDevice in EHCIQueue
ehci: make ehci_execute work on EHCIPacket instead of EHCIQueue
ehci: add EHCIPacket
xhci: trace: slots
xhci: trace: transfers
...
Jan Kiszka [Wed, 6 Jun 2012 14:28:42 +0000 (16:28 +0200)]
kvm: i8254: Fix conversion of in-kernel to userspace state
Due to a offset between the clock used to generate the in-kernel
count_load_time (CLOCK_MONOTONIC) and the clock used for processing this
in userspace (vm_clock), reading back the output of PIT channel 2 via
port 0x61 was broken. One use cases that suffered from it was the CPU
frequency calibration of SeaBIOS, which also affected IDE/AHCI timeouts.
This fixes it by calibrating the offset between both clocks on
kvm_pit_get and adjusting the kernel value before saving it in the
userspace state. As the calibration only works while the vm_clock is
running, we cache the in-kernel state across stopped phases.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Jan Beulich [Mon, 11 Jun 2012 09:52:27 +0000 (09:52 +0000)]
qemu/xendisk: set maximum number of grants to be used
Legacy (non-pvops) gntdev drivers may require this to be done when the
number of grants intended to be used simultaneously exceeds a certain
driver specific default limit.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Jim Meyering [Thu, 10 May 2012 16:19:47 +0000 (18:19 +0200)]
kvm/apic: correct short memset
kvm_put_apic_state's attempt to clear *kapic before setting its
bits cleared sizeof(void*) bytes (no more than 8) rather than the
intended 1024 (KVM_APIC_REG_SIZE) bytes. Spotted by coverity.
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Andreas Färber [Thu, 3 May 2012 02:32:00 +0000 (04:32 +0200)]
target-s390x: Pass S390CPU to s390_cpu_restart()
Needed for qemu_cpu_kick().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Thu, 3 May 2012 02:28:14 +0000 (04:28 +0200)]
s390-virtio: Let s390_cpu_addr2state() return S390CPU
Convert ipi_states to S390CPU**.
Needed for s390_cpu_restart() in handle_sigp().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Thu, 3 May 2012 02:16:07 +0000 (04:16 +0200)]
s390-virtio: Use cpu_s390x_init() to obtain S390CPU
Needed to store S390CPU in ipi_states[].
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Thu, 3 May 2012 02:13:04 +0000 (04:13 +0200)]
target-s390x: Let cpu_s390x_init() return S390CPU
Let cpu_init() return CPUS390XState for backwards compatibility.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Andreas Färber [Tue, 22 May 2012 23:51:57 +0000 (01:51 +0200)]
xen_machine_pv: Use cpu_x86_init() to obtain X86CPU
Needed for moving halted field to CPUState.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Andreas Färber [Mon, 14 May 2012 02:21:52 +0000 (04:21 +0200)]
arm_pic: Pass ARMCPU to arm_pic_init_cpu()
Pass it through to arm_pic_cpu_handler().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> (for exynos)
Andreas Färber [Mon, 14 May 2012 00:39:57 +0000 (02:39 +0200)]
arm_boot: Pass ARMCPU to arm_load_kernel()
In particular this simplifies the &s->mpu->cpu->env expression again.
first_cpu and ->next_cpu are expected to be QOM'ified later.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> (for exynos)
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Mon, 14 May 2012 00:55:25 +0000 (02:55 +0200)]
xilinx_zynq: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_load_kernel().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter A.G. Crosthwaite <peter.crosthwaite@petalogix.com>
Andreas Färber [Thu, 3 May 2012 22:23:14 +0000 (00:23 +0200)]
pxa2xx_gpio: Store ARMCPU in PXA2xxGPIOInfo
Prepares for moving halted field into CPUState.
Add missing braces.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Thu, 3 May 2012 22:05:29 +0000 (00:05 +0200)]
pxa2xx_pic: Store ARMCPU in PXA2xxPICState
Prepares for moving halted field to CPUState.
Add missing braces.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Thu, 3 May 2012 22:01:27 +0000 (00:01 +0200)]
pxa2xx: Pass ARMCPU to pxa2xx_pic_init()
Cleans up after storing ARMCPU in PXA2xxState.
Prepares for storing ARMCPU in PXA2xxPICState.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Mon, 14 May 2012 02:09:55 +0000 (04:09 +0200)]
exynos4210: Use cpu_arm_init() to store ARMCPU
Needed for arm_pic_init_cpu().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
Andreas Färber [Mon, 14 May 2012 01:58:46 +0000 (03:58 +0200)]
vexpress: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_pic_init_cpu().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Mon, 14 May 2012 01:50:56 +0000 (03:50 +0200)]
realview: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_pic_init_cpu().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:05:40 +0000 (01:05 +0200)]
arm_boot: Pass ARMCPU to arm_boot_info::secondary_cpu_reset_hook()
Adapt highbank accordingly.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 22:08:10 +0000 (00:08 +0200)]
arm_boot: Pass ARMCPU to arm_boot_info::write_secondary_boot()
Adapt exynos4210 and highbank accordingly.
The parameter itself is unused.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> (for exynos)
Andreas Färber [Mon, 14 May 2012 00:04:38 +0000 (02:04 +0200)]
versatilepb: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_load_kernel().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:54:18 +0000 (01:54 +0200)]
musicpal: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_load_kernel().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:51:01 +0000 (01:51 +0200)]
integratorcp: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_load_kernel().
Add missing braces.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:42:57 +0000 (01:42 +0200)]
strongarm: Use cpu_arm_init() to store ARMCPU in StrongARMState
Adapt collie accordingly.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:25:55 +0000 (01:25 +0200)]
z2: Rename PXA2xxState variable
Avoid cpu->cpu by using "mpu" as variable name.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:24:05 +0000 (01:24 +0200)]
tosa: Rename PXA2xxState variable
Avoid cpu->cpu by using "mpu" as variable name.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:22:03 +0000 (01:22 +0200)]
spitz: Rename PXA2xxState variable
Avoid cpu->cpu by using "mpu" as variable name.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:11:15 +0000 (01:11 +0200)]
mainstone: Rename PXA2xxState variable
Avoid cpu->cpu by using "mpu" as variable name.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:20:13 +0000 (01:20 +0200)]
palm: Rename omap_mpu_state_s variable
Avoid cpu->cpu by using "mpu" as variable name.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 23:17:03 +0000 (01:17 +0200)]
omap_sx1: Rename omap_mpu_state_s variable
Avoid cpu->cpu by using "mpu" as variable name.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber [Sun, 13 May 2012 20:13:15 +0000 (22:13 +0200)]
nseries: Rename n800_s::cpu to mpu
omap_mpu_state_s::env was renamed to cpu while changing its type.
With n800_s::cpu of type omap_mpu_state_s* this leads to s->cpu->cpu.
Rename the field to "mpu" to avoid this ugliness.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Blue Swirl [Sun, 10 Jun 2012 20:29:19 +0000 (20:29 +0000)]
Revert "build: compile oslib-obj-y once"
This reverts commit
25f27a4f7160d077d6992e811021b4bc3a82abc1
because of bsd-user breakage.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Max Filippov [Sun, 10 Jun 2012 07:33:12 +0000 (11:33 +0400)]
target-xtensa: switch to AREG0-free mode
Add env parameter to every helper function that needs it, update
'configure' script.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Max Filippov [Sun, 10 Jun 2012 07:33:11 +0000 (11:33 +0400)]
target-xtensa: add attributes to helper functions
Mark exception generating functions 'noreturn' and pure constant
functions as such.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Peter Portante [Sun, 10 Jun 2012 07:33:10 +0000 (11:33 +0400)]
target-xtensa: remove unnecessary include of dyngen-exec.h
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Max Filippov [Sun, 27 May 2012 23:18:33 +0000 (03:18 +0400)]
target-xtensa: fix CCOUNT for conditional branches
Taken conditional branches fail to update CCOUNT register because
accumulated ccount_delta is reset during translation of non-taken
branch. To fix it only update CCOUNT once per conditional branch
instruction translation.
This fixes guest linux freeze on LTP waitpid06 test.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Max Filippov [Sun, 27 May 2012 16:21:08 +0000 (20:21 +0400)]
exec: fix TB invalidation after breakpoint insertion/deletion
tb_invalidate_phys_addr has to be called with the exact physical address of
the breakpoint we add/remove, not just the page's base address.
Otherwise we easily fail to flush the right TB.
This breakage was introduced by the commit
f3705d5329 "memory: make
phys_page_find() return an unadjusted".
This appeared to work for some guest architectures because their
cpu_get_phys_page_debug implementation returns full translated physical
address, not just the base of the TARGET_PAGE_SIZE-sized page.
Reported-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Max Filippov [Sun, 27 May 2012 14:34:54 +0000 (18:34 +0400)]
target-xtensa: add MMU pagewalking tests
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Max Filippov [Sun, 27 May 2012 14:34:53 +0000 (18:34 +0400)]
target-xtensa: control page table lookup explicitly
Hardware pagetable walking may not be nested. Stop guessing and pass
explicit flag to the get_physical_addr_mmu function that controls page
table lookup.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Max Filippov [Sun, 27 May 2012 14:34:52 +0000 (18:34 +0400)]
target-xtensa: update autorefill TLB entries conditionally
This is to avoid interference of internal QEMU helpers
(cpu_get_phys_page_debug, tb_invalidate_virtual_addr) with guest-visible
TLB state.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Max Filippov [Sun, 27 May 2012 14:34:51 +0000 (18:34 +0400)]
target-xtensa: extract TLB entry setting method
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>