Remove dead code for ARM semihosting commandline handling
There are some bits in the code which were used to store the commandline forthe semihosting call. These bits are now write-only and can be removed.
Signed-off-by: Wolfgang Schildbach <wschi@dolby.com>...
Fix commandline handling for ARM semihosted executables
Use the copy of the command line that loader_build_argptr() sets up in guestmemory as the command line to return from the ARM SYS_GET_CMDLINE semihostingcall. Previously we were using a pointer to memory which had already been...
linux-user: Fix incorrect NaN detection in ARM nwfpe emulation
The code in the linux-user ARM nwfpe emulation was incorrectlychecking only for quiet NaNs when it should have been checkingfor any kind of NaN. This is probably because the code inquestion was taken from the Linux kernel, whose copy of the...
softfloat: Implement floatx80_is_any_nan() and float128_is_any_nan()
Implement versions of float*_is_any_nan() for the floatx80 andfloat128 types.
Acked-by: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
linux-user: Implement FS_IOC_FIEMAP ioctl
Implement the FS_IOC_FIEMAP ioctl using the new support forcustom handling of ioctls; this is needed because the structthat is passed includes a variable-length array.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
linux-user: Support ioctls whose parameter size is not constant
Some ioctls (for example FS_IOC_FIEMAP) use structures whose size isnot constant. The generic argument conversion code in do_ioctl()cannot handle this, so add support for implementing a special-case...
linux-user: Implement sync_file_range{,2} syscalls
Implement the missing syscalls sync_file_range and sync_file_range2.The latter in particular is used by newer versions of apt on Ubuntufor ARM.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
cris: Avoid useless tmp in t_gen_cc_jmp()
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
cirrus: delete GCC 4.6 warnings
Commit 92d675d1c1f23f3617e24b63c825074a1d1da44b triggered uninitializedvariables warning with GCC 4.6. Fix them by adding zero initializers.
Acked-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
softfloat: Implement flushing input denormals to zero
Add support to softfloat for flushing input denormal float32 and float64to zero. softfloat's existing 'flush_to_zero' flag only flushes denormalsto zero on output. Some CPUs need input denormals to be flushed before...
target-arm: Set softfloat cumulative exc flags from correct FPSCR bits
When handling a write to the ARM FPSCR, set the softfloat cumulativeexception flags from the cumulative flags in the FPSCR, not theexception-enable bits. Also don't apply a mask: vfp_exceptbits_to_host...
target-arm: wire up the softfloat flush_input_to_zero flag
Wire up the new softfloat support for flushing input denormalsto zero on ARM. The FPSCR FZ bit enables flush-to-zero forboth inputs and outputs, but the reporting of when inputs areflushed to zero is via a separate IDC bit rather than the UFC...
target-arm: fix SMMLA/SMMLS instructions
SMMLA and SMMLS are broken on both in normal and thumb mode, that isboth (different) implementations are wrong. They try to avoid a 64-bitadd for the rounding, which is not trivial if you want to support bothSMMLA and SMMLS with the same code....
block: delete a write-only variable
Avoid a warning with GCC 4.6.0:/src/qemu/block.c: In function 'bdrv_img_create':/src/qemu/block.c:2862:25: error: variable 'fmt' set but not used [-Werror=unused-but-set-variable]
CC: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cirrus_vga: Declare as little endian
This patch replaces explicit bswaps with endianness hints to themmio layer.
CC: Alexander Graf <agraf@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pc: move port 92 stuff back to pc.c from pckbd.c
956a3e6bb7386de48b642d4fee11f7f86a2fcf9a introduced a bug concerningreset bit for port 92.
Since the keyboard output port and port 92 are not compatible anyway,let's separate them.
Reported-by: Peter Lieven <pl@dlh.net>...
target-ppc: Implement correct NaN propagation rules
Implement the correct NaN propagation rules for PowerPC targets byproviding an appropriate pickNaN function.
Also fix the #ifdef tests for default NaN definition, the correct nameis TARGET_PPC instead of TARGET_POWERPC....
target-mips: Implement correct NaN propagation rules
Implement the correct NaN propagation rules for MIPS targets byproviding an appropriate pickNaN function.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
softfloat: use float{32,64,x80,128}_maybe_silence_nan()
Use float{32,64,x80,128}_maybe_silence_nan() instead of toggling thesNaN bit manually. This allow per target implementation of sNaN to qNaNconversion.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...
softfloat: add float{x80,128}_maybe_silence_nan()
Add float{x80,128}_maybe_silence_nan() functions, they will be need bypropagateFloat{x80,128}NaN().
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
softfloat: fix float{32,64}_maybe_silence_nan() for MIPS
On targets that define sNaN with the sNaN bit as one, simply clearingthis bit may correspond to an infinite value.
Convert it to a default NaN if SNAN_BIT_IS_ONE, as it corresponds tothe MIPS implementation, the only emulated CPU with SNAN_BIT_IS_ONE....
softfloat: rename *IsNaN variables to *IsQuietNaN
Similarly to what has been done in commit185698715dfb18c82ad2a5dbc169908602d43e81 rename the misnamed *IsNaNvariables into *IsQuietNaN.
softfloat: remove HPPA specific code
We don't have any HPPA target, so let's remove HPPA specific code. Itcan be re-added when someone adds an HPPA target.
This has been blessed by Stuart Brady <sdb@zubnet.me.uk>, author of thetarget-hppa fork.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
target-ppc: use float32_is_any_nan()
Use the new function float32_is_any_nan() instead offloat32_is_quiet_nan() || float32_is_signaling_nan().
Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-ppc: fix default qNaN
On PPC the default qNaN doesn't have the sign bit set.
target-ppc: remove PRECISE_EMULATION define
The PRECISE_EMULATION is "hardcoded" to one in target-ppc/exec.h and notsomething easily tunable. Remove it and non-precise emulation code asit doesn't make a noticeable difference in speed. People wanting speed...
microblaze: Use more TB chaining
For some workloads with tight loops this ~doubles the emulationspeed.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Fix curses on big endian hosts
On big endian hosts, the curses interface is unusable: the emulatedgraphic card only displays garbage, while the monitor interface displaysnothing (or rather only spaces).
The curses interface is waiting for data in native endianness, so...
cirrus_vga: fix division by 0 for color expansion rop
Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regressionwith Windows ME that leads to a division by 0 and a crash.
It uses the color expansion rop with the source pitch set to 0. This is...
noaudio: correctly account acquired samples
This will fix the return value of the function which otherwise returns toomany samples because sw->total_hw_samples_acquired isn't correctlyaccounted.
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: malc <av1474@comtv.ru>
target-arm: Implement correct NaN propagation rules
Implement the correct NaN propagation rules for ARM targets byproviding an appropriate pickNaN function.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
softfloat: abstract out target-specific NaN propagation rules
IEEE754 doesn't specify precisely what NaN should be returned asthe result of an operation on two input NaNs. This is thereforetarget-specific. Abstract out the code in propagateFloat*NaN()which was implementing the x87 propagation rules, so that it...
softfloat: Rename float*_is_nan() functions to float*_is_quiet_nan()
The softfloat functions float*_is_nan() were badly misnamed,because they return true only for quiet NaNs, not for all NaNs.Rename them to float*_is_quiet_nan() to more accurately reflect...
TCG: Improve tb_phys_hash_func()
Most of emulated CPU have instructions aligned on 16 or 32 bits, whileon others GCC tries to align the target jump location. This means that1/2 or 3/4 of tb_phys_hash entries are never used.
Update the hash function tb_phys_hash_func() to ignore the two lowest...
target-arm: fix UMAAL instruction
UMAAL should use unsigned multiply instead of signed.
This patch fixes this issue by handling UMAAL separately fromUMULL/UMLAL/SMULL/SMLAL as these instructions are differentenough. It also explicitly list instructions in case and catch...
Fix translation of unary PPC/SPE instructions (efdneg etc.).
Signed-off-by: Mike Pall <mike-lp10@luajit.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-sparc: fix udiv(cc) and sdiv(cc)
Since commit 5a4bb580cdb10b066f9fd67658b31cac4a4ea5e5, Xorg crashes ona Debian Etch image. The commit itself is fine, but it triggers a bugdue to wrong computation of flags for udiv(cc) and sdiv(cc).
This patch only compute cc_src2 for the cc version of udiv/sdiv. It...
Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu
x86: Filter out garbage from segment flags dump
Only bits 8..23 of the segment flags contain valid data, so only dumpthose when printing the CPU state.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix migrate set speed doc arg
We used to ignore any fractional part in 0.13, but due to recentchanges (started with 9f9b17a4f0865286391e4d3a0a735230122a2289)migrate_set_speed will reject the fractional part.
We don't expect existing clients to be relying on this, but we...
target-arm: correct cp15 c1_sys reset value for cortex-a8
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-arm: correct cp15 c1_sys reset value for arm1136 and cortex-a9
target-arm: fix vmsav6 access control
Override access control checks (including execute) for mmu translationtable descriptors assigned to manager domains.
target-arm: Correct result in saturating cases for VQSHL of s8/16/32
Where VQSHL of a signed 8/16/32 bit value saturated, the resultvalue was not being calculated correctly (it should be eitherthe minimum or maximum value for the size of the signed type)....
target-arm: remove pointless else clause in VQSHL of u64
Remove a pointless else clause in the neon_qshl_u64 helper.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-arm: Fix VQSHL of signed 64 bit values by shift counts >= 64
VQSHL of a signed 64 bit non-zero value by a shift count >= 64 shouldsaturate; return the correct value in this case.
target-arm: Fix VQSHL of signed 64 bit values
Add a missing '-' which meant that we were misinterpreting the shiftargument for VQSHL of 64 bit signed values and treating almost everyshift value as if it were an extremely large right shift.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>...
target-arm: Fix arguments passed to VQSHL helpers
Correct the arguments passed when generating neon qshl_{u,s}64()helpers so that we use the correct registers.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
target-arm: fix bug in translation of REVSH
The translation of REVSH shifted the low byte 8 steps left before performingan 8-bit sign extend, causing this part of the expression to alwas be 0.
Reported-by: Johan Bengtsson <teofrastius@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix a missing trailing newline
target-mips: fix host CPU consumption when guest is idle
When the CPU is in wait state, do not wake-up if an interrupt can't betaken. This avoid host CPU running at 100% if a device (e.g. timer) hasan interrupt line left enabled.
Also factorize code to check if interrupts are enabled in...
s390: compile fixes
The s390 target doesn't compile out of the box anymore. This patch fixes allthe obvious glitches that got introduced in the last few weeks.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips: fix translation of MT instructions
The translation of dmt/emt/dvpe/evpe was doing the moral equivalent of:
int x; ... /* no initialization of x */ x = f (x);
which confused later bits of TCG rather badly, leading to crashes.
Fix the helpers to only return results (those instructions have no...
Use mmap() within code_gen_alloc() for OpenBSD.
Signed-off-by: Brad Smith <brad@comstyle.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add OpenBSD to ifdef list since it has CLOCK_MONOTONIC.
Add support for OpenBSD to QEMU's tap driver.
tcg-arm: fix __clear_cache() warning
Use builtin_clear_cache() instead of __clear_cache() to avoid havingto define the function as extern. Fix the following warning:
| In file included from qemu/cpus.c:34: | qemu/exec-all.h: In function 'tb_set_jmp_target1':...
qdev: sysbus_get_default must not return a NULL pointer (fix regression)
Every system should have some sort of main system bus,so sysbus_get_default should always return a valid bus.
Without this patch, at least mipssim and malta no longerstart but raise a null pointer access exception (caused by...
sparc32: ledma extra registers need tracing too
Also trace the extra registers, and update the comments with newinfo from Artyom Tarasenko.
Signed-off-by: Bob Breuer <breuerr@mc.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-i386: Fix accidental use of SoftFloat uint64 type
softfloat.h's uint64 type has least-width semantics.Use uint64_t instead since that is used in helpers.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>...
wdt_ib700: Fix accidental use of SoftFloat int64 type
softfloat.h's int64 type has least-width semantics.Since we're assigning an int64_t, use plain int64_t.
apic: Fix accidental use of SoftFloat uint32 type
softfloat.h's uint32 type has least-width semantics.Surrounding code uses uint32_t, so use uint32_t here, too.
Avoid a warning from OpenBSD linker
Avoid the warning below by using snprintf:../libhw64/vl.o(.text+0x78d4): In function `get_boot_devices_list':/src/qemu/vl.c:763: warning: sprintf() is often misused, please use snprintf()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Sparc: implement monitor command 'info tlb'
Use existing dump_mmu() to implement monitor command 'info tlb'.
ahci: delete write-only variables (v2)
Avoid these warnings with GCC 4.6.0:/src/qemu/hw/ide/ahci.c: In function 'ahci_reset_port':/src/qemu/hw/ide/ahci.c:810:14: error: variable 'tfd' set but not used [-Werror=unused-but-set-variable]/src/qemu/hw/ide/ahci.c: In function 'handle_cmd':...
vga: Declare as little endian
CC: Alexander Graf <agraf@suse.de>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
win32: Fix CRLF problem in make_device_config.sh
QEMU source code with CRLF line endingswhich is quite common on windows hostsfails with current make_device_config.sh.
The awk script gets the name of the includedfile with \r, so instead of pci.mak it will...
sparc32: ledma extra registers
ledma has 0x20 bytes of registers according to OBP, and at least Solaris9reads the 5th register which is beyond what we've mapped. So let's setupa flag (inspired by a previous patch from Blue Swirl) to identify ledmafrom espdma, and map another 16 bytes of registers which return 0....
Fix warning on mingw32
Avoid this warning like other uses of setsockopt:/src/qemu/net/socket.c: In function 'net_socket_mcast_create':/src/qemu/net/socket.c:210: warning: passing argument 4 of 'setsockopt' from incompatible pointer type
ide: Build fix for via.c
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Fix build for cmd646.c
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Acked-by: Andreas Färber <andreas.faerber@web.de>
docs: Fix missing carets in QED specification
For some reason the carets ('^') in the QED specification disappeared.This patch puts them back.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Add proper -errno error return values to qcow2_open()
In addition this adds missing braces to the function to be consistentwith the coding style.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2.c: rename qcow_ functions to qcow2_
It doesn't really make sense for functions in qcow2.c to be namedqcow_ so convert the names to match correctly.
docs: Add QED image format specification
qed: Add QEMU Enhanced Disk image format
This patch introduces the qed on-disk layout and implements imagecreation. Later patches add read/write and other functionality.
qed: Table, L2 cache, and cluster functions
This patch adds code to look up data cluster offsets in the image viathe L1/L2 tables. The L2 tables are writethrough cached in memory forperformance (each read/write requires a lookup so it is essential tocache the tables)....
qed: Read/write support
This patch implements the read/write state machine. Operations arefully asynchronous and multiple operations may be active at any time.
Allocating writes lock tables to ensure metadata updates do notinterfere with each other. If two allocating writes need to update the...
qed: Consistency check support
This patch adds support for the qemu-img check command. It alsointroduces a dirty bit in the qed header to mark modified images asneeding a check. This bit is cleared when the image file is closedcleanly.
If an image file is opened and it has the dirty bit set, a consistency...
ahci: set SATA Mode Select
Set SATA Mode Select to AHCI in the Address Map Register.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: honor ncq for atapi
ATAPI also can do ncq, so let's expose the capability.
This patch makes CD-ROM support work on Windows 7 for me.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img: Call error_set_progname
Call error_set_progname during the qemu-img initialization, so that errormessages printed with error_report() use the right prefix.
qemu-img.c: Re-factor img_create()
This patch re-factors img_create() moving the code doing the actualwork into block.c where it can be shared with QEMU. This is needed tobe able to create images from QEMU to be used for live snapshots.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
Introduce do_snapshot_blkdev() and monitor command to handle it.
The monitor command is:snapshot_blkdev <device> [snapshot-file] [format]
Default format is qcow2. For now snapshots without a snapshot-file, eginternal snapshots, are not supported.
Prevent creating an image with the same filename as backing file
bdrv_img_create() use proper errno return values
Kevin suggested to have bdrv_img_create() return proper -errno valueson error.
qemu.img.c: Use error_report() instead of own error() implementation
Remove NULL checks for bdrv_new return value
It's an indirect call to qemu_malloc, which never returns an error.
ide: Register vm change state handler once only
We register the vm change state handler in a PCI BAR map() function.This function can be called multiple times throughout the lifetime of aPCI IDE device. This results in duplicate vm change state handlers...
block: add discard support
Add a new bdrv_discard method to free blocks in a mapping image, and a newdrive property to set the granularity for these discard. If no discardgranularity support is set discard support is disabled.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
scsi-disk: support WRITE SAME (16) with unmap bit
Support discards via the WRITE SAME command with the unmap bit set, andtell the initiator about the support for it via the block limit and thenew thin provisioning EVPD pages. Also fix the comment which incorrectly...
qemu-io: Add discard command
discard [-Cq] off len -- discards a number of bytes at a specifiedoffset
discards a range of bytes from the given offset
Example: 'discard 512 1k' - discards 1 kilobyte from 512 bytes into the file
Discards a segment of the currently open file....
raw-posix: add discard support
Add support to discard blocks in a raw image residing on an XFS filesystemby calling the XFS_IOC_UNRESVSP64 ioctl to punch holes. Support for otherhole punching mechanisms can be added when they become available.
qemu-io: Fix typo in help texts
ide: add ncq identify data for ahci sata drives
I modified ide_identify() to include the zero-based queue lengthvalue in word 75, and set bit 8 in word 76 to signal NCQ supportin the identify data for AHCI SATA drives.
Signed-off-by: Roland Elek <elek.roland@gmail.com>...
pci: add storage class for sata
This patch adds the storage sata class id.
pci: add ich9 pci id
We need a PCI ID for our new AHCI adapter. I just picked an ICH-9because that's the one in the Q35 chipset.
This patch adds a PCI ID define for an ICH-9 AHCI adapter.
ahci: add ahci emulation
This patch adds an emulation layer for an ICH-9 AHCI controller. For nowthis controller does not do IDE legacy emulation. It is a pure AHCI controller.
config: move ide core and pci to pci.mak
Every device that can do PCI should also be able to do IDE. So let's movethe IDE definitions over to pci.mak.
config: add ahci for pci capable machines
This patch enables AHCI for all machines supporting PCI.