summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-04-21target-arm: Move CTR setup to per cpu init fnsPeter Maydell3-12/+24
Move CTR (cache type register) value to an ARMCPU field set up by per-cpu init fns. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <afaerber@suse.de>
2012-04-21target-arm: Move MVFR* setup to per cpu init fnsPeter Maydell3-12/+18
Move the MVFR* VFP feature register values to ARMCPU, so they are set up by the implementation-specific instance init functions rather than in cpu_reset_model_id(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <afaerber@suse.de>
2012-04-21target-arm: Move FPSID config to cpu init fnsPeter Maydell3-8/+12
Move the reset FPSID to the ARMCPU struct, and set it in the per-implementation instance init function. At reset we then just copy the reset value into the CPUARMState field. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <afaerber@suse.de>
2012-04-21target-arm: Move feature bit settings to CPU init fnsPeter Maydell4-99/+137
Move the setting of the feature bits from cpu_reset_model_id() to each CPU's instance init function. This requires us to move the features field in CPUARMState so that it is not cleared on reset. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <afaerber@suse.de>
2012-04-21target-arm: Add QOM subclasses for each ARM cpu implementationPeter Maydell3-65/+282
Register subclasses for each ARM CPU implementation. Let arm_cpu_list() enumerate CPU subclasses in alphabetical order, except for special value "any". Replace cpu_arm_find_by_name()'s string -> CPUID lookup by storing the CPUID (aka MIDR, Main ID Register) value in the class. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-04-21target-arm: remind to keep arm features in sync with linux-user/elfload.cBenoit Canet1-0/+4
Signed-off-by: Benoit Canet <benoit.canet@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-04-21Merge branch 'arm-devs.for-upstream' of ↵Blue Swirl5-81/+133
git://git.linaro.org/people/pmaydell/qemu-arm * 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm: versatiblepb: add NOR flash support hw/arm_mptimer: Reset the qemu_timer at reset versatilepb: add ds1338 rtc device realview: break out versatile i2c controller code
2012-04-21tci: GETPC() macro must return an uintptr_tStefan Weil2-3/+3
Change the data type of tci_tb_ptr, so GETPC() returns an uintptr_t now (like for all other TCG targets). This completes commit 2050396801ca0c8359364d61eaadece951006057 and fixes builds with TCI. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-21gdbstub: Synchronize CPU state unconditionally in gdb_set_cpu_pcPeter Maydell1-2/+1
Synchronize the CPU state via cpu_sychronize_state() unconditionally in gdb_set_cpu_pc() rather than only in some of the target ifdef ladder cases. We can divide the CPUs into three categories: * non-KVM targets: no change of behaviour since we will use the kvm-stub.c no-op function. * i386 and s390: no change of behaviour since they were already calling this function * PPC (in KVM mode): this fixes an error: failing to synchronise was accidental and probably a bug. This also paves the way for other targets (specifically ARM) which can add KVM support in future without having to add another target specific change to this bit of code. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-21softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compileJuan Quintela1-2/+2
This change makes it compile and return the same value than the #undef one. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-21target-xtensa: add tests for LOOPNEZ and LOOPGTZMax Filippov1-0/+36
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-21target-xtensa: fix LOOPNEZ/LOOPGTZ translationMax Filippov1-1/+1
Translation of LOOP instructions used to call LEND SR write handler to update LEND and invalidate relevant TBs. Now that LEND SR write handler ends TB, LOOPNEZ and LOOPGTZ generate wrong code (same as for simple LOOP). Fix it by calling wsr_lend helper directly. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-21qtest: add m48t59 tests for SparcBlue Swirl2-0/+262
Add simple m48t59 qtests, enable test only for Sparc32 and Sparc64. On PPC, the device is behind PCI bus. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-20versatiblepb: add NOR flash supportEric Benard1-0/+16
- add support for the 64MB NOR CFI01 flash available at 0x34000000 on the versatilepb board http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0225d/BBAJIHEC.html - tested with barebox bootloader Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-04-20hw/arm_mptimer: Reset the qemu_timer at resetPeter Maydell1-0/+3
On reset of the mpcore timer/watchdog block we need to delete the qemu_timer in case it was running. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-04-20versatilepb: add ds1338 rtc deviceOskar Andero1-0/+6
Add ds1338 rtc attached on i2c. Signed-off-by: Oskar Andero <oskar.andero@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-04-20realview: break out versatile i2c controller codeOskar Andero3-81/+108
The versatile i2c controller implementation was separated to its own file called versatile_i2c.c. This is done as a preparation for adding i2c support to the versatilepb board. Signed-off-by: Oskar Andero <oskar.andero@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-04-20qemu-iotests: Fix test 031 for qcow2 v3 supportKevin Wolf3-26/+172
qcow2.py must be updated to work with version 3 images at all, the output has changed since the feature table extension has been added, and version 2 and version 3 images can't possibly have the same test output. Change the test case to completely ignore IMGOPTS and run the test for both compat=1.1 and compat=0.10 regardless of the ./check command line. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qemu-iotests: Add -o and make v3 the default for qcow2Kevin Wolf3-5/+52
This adds an -o option to qemu-iotests, which is an option string that is passed through to qemu-img create -o... This allows testing different subformat with a command like './check -qcow2 -o compat=0.10'. For qcow2, if no compat option is specified, compat=1.1 is the new default. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Zero write supportKevin Wolf4-3/+105
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qemu-iotests: Test backing file COW with zero clustersKevin Wolf3-0/+195
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qemu-iotests: add a simple test for write_zeroesPaolo Bonzini3-0/+103
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Support for feature table header extensionKevin Wolf2-9/+69
Instead of printing an ugly bitmask, qemu can now print a more helpful string even for yet unknown features. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Support reading zero clustersKevin Wolf4-4/+33
This adds support for reading zero clusters in version 3 images. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Version 3 imagesKevin Wolf3-15/+149
This adds the basic infrastructure to qcow2 to handle version 3 images. It includes code to create v3 images, allow header updates for v3 images and checks feature bits. It still misses support for zero clusters, so this is not a fully compliant implementation of v3 yet. The default for creating new images stays at v2 for now. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Ignore reserved bits in check_refcountsKevin Wolf1-44/+54
Also don't infer the cluster type directly from the L2 entries, but use qcow2_get_cluster_type() to keep everything in a single place. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Ignore reserved bits in refcount table entriesKevin Wolf2-1/+3
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Simplify count_cow_clustersKevin Wolf1-18/+15
count_cow_clusters() tries to reuse existing functions, and all it achieves is to make things much more complicated than they really are: Everything needs COW, unless it's a normal cluster with refcount 1. This patch implements the obvious way of doing this, and by using qcow2_get_cluster_type() it gets rid of all flag magic. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Refactor qcow2_free_any_clustersKevin Wolf1-19/+22
Zero clusters will add another cluster type. Refactor the open-coded cluster type detection into a switch of QCOW2_CLUSTER_* options so that the detection is in a single place. This makes it easier to add new cluster types. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Ignore reserved bits in L1/L2 entriesKevin Wolf2-19/+19
This changes the still existing places that assume that the only flags are QCOW_OFLAG_COPIED and QCOW_OFLAG_COMPRESSED to properly mask out reserved bits. It does not convert bdrv_check yet. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Fail write_compressed when overwriting dataKevin Wolf1-4/+3
qcow2_alloc_compressed_cluster_offset() already fails if the copied flag is set, because qcow2_write_compressed() doesn't perform COW as it would have to do to allow this. However, what we really want to check here is whether the cluster is allocated or not. With internal snapshots the copied flag may not be set on allocated clusters. Check the cluster offset instead. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Ignore reserved bits in count_contiguous_clusters()Kevin Wolf1-10/+28
Until now, count_contiguous_clusters() has an argument that allowed to specify flags that should be ignored in the comparison, i.e. that are allowed to change between contiguous clusters. This patch changes the function so that it ignores all flags by default now and you need to pass the flags on which it should stop. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Ignore reserved bits in get_cluster_offsetKevin Wolf3-19/+60
With this change, reading from a qcow2 image ignores all reserved bits that are set in an L1 or L2 table entry. Now get_cluster_offset() assigns *cluster_offset only the offset without any other flags. The cluster type is not longer encoded in the offset, but a positive return value in case of success. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Save disk size in snapshot headerKevin Wolf2-0/+17
This allows that different snapshots of an image can have different sizes, which is a requirement for enabling image resizing even with images that have internal snapshots. We don't do the actual support for it now, but make sure that the additional field is present and not completely ignored in all version 3 images. When trying to load a snapshot of different size, it returns an error. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20Specification for qcow2 version 3Kevin Wolf1-23/+99
This updates the qcow2 specification to cover version 3. It contains the following changes: - Added compatible/incompatible/auto-clear feature bits plus an optional feature name table to allow useful error messages even if an older version doesn't know some feature at all. - Configurable refcount width. If you don't want to use internal snapshots, make refcounts one bit and save cache space and I/O. - Zero cluster flags. This allows discard even with a backing file that doesn't contain zeros. It is also useful for copy-on-read/image streaming, as you'll want to keep sparseness without accessing the remote image for an unallocated cluster all the time. - Fixed internal snapshot metadata to use 64 bit VM state size. You can't save a snapshot of a VM with >= 4 GB RAM today. - Extended internal snapshot metadata to contain the disk size, so that resizing images that have snapshots can be allowed in the future. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at()Kevin Wolf1-0/+6
Refcount block allocation and refcount table growth rely on s->free_cluster_index pointing to somewhere after the current allocation. Change qcow2_alloc_cluster_at() to fulfill this assumption. Without this change it could happen that a newly allocated refcount block and the allocated data block point to the same area in the image file, causing data corruption in the long run. This fixes a bug that became first visible after commit 250196f1. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20Add .gitignore for tests/David Gibson1-0/+13
The new autotests in tests/ generate a number of files, both executable and source, which are not caught by the existing .gitignore files. This patch adds a new .gitignore in tests/ which covers these. [Changed 'rtc-test' to '*-test' so future tests do not need to be added to .gitignore on a case-by-case basis. Stefan] Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-20e1000: Fix spelling (segmentaion -> segmentation) in debug outputStefan Weil1-1/+1
This was reported by https://bugs.launchpad.net/qemu/+bug/984476. I also changed the case for 'error'. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-20spice-qemu-char.c: Show what name is unsupportedEduardo Elias Ferreira1-1/+1
Signed-off-by: Eduardo Elias Ferreira <edusf@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-20pflash_cfi01: remove redundant lineEric Bénard1-1/+0
Signed-off-by: Eric Bénard <eric@eukrea.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-20qxl: Add missing GCC_FMT_ATTR and fix format specifierStefan Weil2-2/+2
val is an uint64_t, therefore %d was not correct. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-20fix block_job_set_speed name in documentationPaolo Bonzini1-2/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-20error.c: don't return value for void functionAmos Kong1-1/+1
It is invalid to return a value from a function returning void. [C99 6.8.6.4 says "A return statement with an expression shall not appear in a function whose return type is void" but gcc 4.6.3 with QEMU compile flags does not complain. It's still worth fixing this. Stefan] Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-20iotests: Resolve test failures caused by hostnameAndreas Färber1-1/+1
`hostname -s` may output an errror: hostname: Name or service not known This causes all tests to fail for `make check-block`. Suppress such error messages, letting the tests succeed. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-20qemu-img: let 'qemu-img convert' flush dataLiu Yuan2-2/+3
The 'qemu-img convert -h' advertise that the default cache mode is 'writeback', while in fact it is 'unsafe'. This patch 1) fix the help manual and 2) let bdrv_close() call bdrv_flush() 2) is needed because some backend storage doesn't have a self-flush mechanism(for e.g., sheepdog), so we need to call bdrv_flush() to make sure the image is really writen to the storage instead of hanging around writeback cache forever. Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19sparc: fix qtestBlue Swirl1-1/+3
Initialize TCG only when enabled. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-19qtest: add dummy functions for user emulatorsBlue Swirl1-0/+18
Allow qtest to be used also in files used for user emulators by introducing dummy functions. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-19qtest: add register fuzzing to RTC testBlue Swirl1-0/+17
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-19qemu-ga: fix help outputMichael Roth1-3/+4
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-04-19qemu-ga: generate missing stubs for fsfreezeMichael Roth1-16/+20
When linux-specific commands (including guest-fsfreeze-*) were consolidated under defined(__linux__), we forgot to account for the case where defined(__linux__) && !defined(FIFREEZE). As a result stubs are no longer being generated on linux hosts that don't have FIFREEZE support. Fix this. Tested-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>