target-arm: fix VSHLL Neon instruction.
Fix bit mask used when widening the result of shift on narrow input.
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
[PATCH] [MIPS] Clear softfpu exception state for round, trunc, ceil and floor
MIPS FPU instructions should start with a clean softfpu status. Thisis done for the arithmetic operations and cvt instructions, but notfor round, trunc, ceil and floor.
Signed-off-by: Chris Dearman <chris@mips.com>...
target-arm: Fix 32 bit signed saturating narrow
The returned value when doing saturating signed 64->32 bitconversion of a negative number was incorrect due to a missing cast.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-arm: Fix VQMOVUN Neon instruction.
VQMOVUN does a signed-to-unsigned saturating conversion. This isdifferent from both the signed-to-signed and unsigned-to-unsignedconversions already implemented, so we need a new set of helperfunctions (neon_unarrow_sat*)....
cris, microblaze: use cpu_has_work
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
x86: Fix MCA broadcast parameters for TCG case
When broadcasting MCEs, we need to set MCIP and RIPV in mcg_status likeit is done for KVM. Use the symbolic constants at this chance.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>...
qemu-timer: Fix compilation of new timer code for w32, w64
qemu_next_alarm_deadline() is needed by MinGW, too.
Cc: Paolo Bonzini <pbonzini@redhat.com>Cc: Anthony Liguori <aliguori@us.ibm.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
block-migration: actually disable dirty tracking on cleanup
Call to set_dirty_tracking() is misplaced.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev: add refcount to DriveInfo
The host part of a block device can be deleted with in progressblock migration.
To fix this, add a reference count to DriveInfo, freeing resourceson last reference.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>...
block-migration: add reference to target DriveInfo
So that ejection of attached device by guest does not free datain use by block migration instance.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>CC: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Add flag to indicate external users to block device
Certain operations such as drive_del or resize cannot be performedwhile external users (eg. block migration) reference the block device.
Add a flag to indicate that.
block: enable in_use flag
Set block device in use during block migration, disallow drive_del andbdrv_truncate for in use devices.
ahci: make number of ports runtime determined
Different AHCI controllers have a different number of ports, so the coreshouldn't care about the amount of ports available.
This patch makes the number of ports available to the AHCI core runtimeconfigurable, allowing us to have multiple different AHCI implementations...
ahci: Implement HBA reset
The ahci code was missing its soft reset functionality. This wasn't really anissue for Linux guests, but Windows gets confused when the controller doesn'treset when it tells it so.
Using this patch I can now successfully boot Windows 7 from AHCI using AHCI...
ahci: send init d2h fis on fis enable
The drive sends a d2h init fis on initialization. Usually, the guest doesn'treceive fises yet at that point though, so the delivery is deferred.
Let's reflect that by sending the init fis on fis receive enablement....
ahci: split ICH and AHCI even more
Sebastian's patch already did a pretty good job at splitting up ICH-9AHCI code and the AHCI core. We need some more though. Copyright was missing,the lspci dump belongs to ICH-9, we don't need the AHCI core to have its...
ahci: add license header in ahci.h
Due to popular request, this patch adds a license header to ahci.h
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ahci: split ICH9 from core
There are multiple ahci devices out there. The currently implemented ich-9is only one of the many. So let's split that one out into a separate fileto stress the difference.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>Signed-off-by: Alexander Graf <agraf@suse.de>...
block/vdi: Fix wrong size in conditionally used memset, memcmp
Error report from cppcheck:block/vdi.c:122: error: Using sizeof for array given as function argument returns the size of pointer.block/vdi.c:128: error: Using sizeof for array given as function argument returns the size of pointer....
Documentation: add Sheepdog disk images
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Really use cache=unsafe for image creation
For cache=unsafe we also need to set BDRV_O_CACHE_WB, otherwise we have somestrange unsafe writethrough mode.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
checkpatch.pl: don't complain about old lines with tabs
Don't complain when the patch includes lines with tabsonly in the hunk's untouched context.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-arm: Clean up handling of MPIDR
The ARM cp15 register 0,c0,c0,5 is standardised in the v7 architectureas the MPIDR. Clean up its implementation to remove A9 specific handling.
This commit includes fixing an error in the value returned for theMPIDR on A9, where we were erroneously claiming a cluster ID of 9....
target-arm: Fix decoding of preload and memory hint space
Correct the decoding of the ARM preload and memory hint space,by adding decoding of PLI, PLDW and the v7MP unallocated hintspace. This commit also corrects a slightly overexuberantdecoding of PLD which was not checking that bit 4...
target-arm: Fix decoding of Thumb preload and hint space
Refine the decoding of the Thumb preload and hint space, so weUNDEF on the patterns that are supposed to UNDEF rather than NOP.We also move the tests for this space earlier, so we don't emitharmless but unnecessary address generation code for preload...
target-arm: Add CPU feature flag for v7MP
Add a CPU feature flag for v7MP (the multiprocessing extensions); someinstructions exist only for v7MP and not for the base v7 architecture.
do not pass NULL to strdup.
Also use qemu_strdup() instead of strdup() in bootindex code.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Set the right overflow bit for neon 32 and 64 bit saturating add/sub.
target-arm: Fix Neon vsra instructions.
This patch fixes the errors reported by my tests in VSRA.
target-sh4: fix negc
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
savevm: fix corruption in vmstate_subsection_load().
Although it's rare to happen in live migration, when the head of abyte stream contains 0x05 which is the marker of subsection, theloader gets corrupted because vmstate_subsection_load() continues even...
use nanoseconds everywhere for timeout computation
Suggested by Aurelien Jarno.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Correct alarm deadline computation
When the QEMU_CLOCK_HOST clock was added, computation of itsdeadline was added to qemu_next_deadline, which is correct butincomplete.
I noticed this by reading the very convoluted rules wherebyqemu_next_deadline_dyntick is computed, which miss QEMU_CLOCK_HOST...
Unify alarm deadline computation
This patch shows how using the correct formula forqemu_next_deadline_dyntick can simplify the code ofhost_alarm_handler and eliminate useless duplication.
ui/sdl: Fix handling of caps lock and num lock keys
Starting with SDL version 1.2.14, caps lock and num lock keyswill send a SDL_KEYUP when SDL_DISABLE_LOCK_KEYS=1 is set inthe environment.
The new code sets the environment unconditionally(it won't harm old versions which do not know it)....
virtio-serial: Make sure virtqueue is ready before discarding data
This can happen if a port gets unplugged before guest has chance toinitialise vqs.
Reported-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: qemu can die if the client is disconnected while updating screen
agraf reported that qemu_mutex_destroy(vs->output_mutex) while failingin vnc_disconnect_finish().
It's because vnc_worker_thread_loop() tries to unlock the mutex whilenot locked. The unlocking call doesn't fail (pthread bug ?), but...
ioapic: Implement EOI handling for level-triggered IRQs
Add the missing EOI broadcast from local APIC to the IOAPICs oncompletion of level-triggered IRQs. This ensures that a still assertedIRQ source properly re-triggers an APIC IRQ.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
ioapic: Save/restore irr
This is a guest modifiable state that must be saved/restored properly.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ioapic: Add support for qemu-kvm's vmstate v2
qemu-kvm carries the IOAPIC base address in its v2 vmstate. We onlysupport the default base address so far, and saving even that in thedevice state was rejected.
Add a padding field to be able to read qemu-kvm's old state, but...
ioapic: Style & magics cleanup
Fix a few style issues and convert magic numbers into prober symbolicconstants, also fixing the wrong but unused IOAPIC_DM_SIPI value.
Open up the 0.15 development branch
Update version for 0.14.0-rc0
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Update SeaBIOS to 0.6.1.2
- 06d0bdd Minor build fixes. - 33abfc0 Update version to 0.6.1.2. - 484dd56 fix virtio-blk failure after reboot - dd9c0d3 Update version to 0.6.1.1. - 50ecfa8 mark irq9 active high in DSDT
fix QemuOpts leak
Now that no backend's open function saves the passed QemuOpts, fix a leakin the qemu_chr_open backwards-compatible parser.
Add bootindex handling into usb storage device.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add boot index documentation.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
tap: safe sndbuf default
With current sndbuf default value, a blockedtarget guest can prevent another guest fromtransmitting any packets. While currentsndbuf value (1M) is reported to help someUDP based workloads, the default shouldbe safe (0).
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
vhost: force vhost off for non-MSI guests
When MSI is off, each interrupt needs to be bounced through the iothread when it's set/cleared, so vhost-net causes more context switches andhigher CPU utilization than userspace virtio which handles networking in...
remove broken code for tty
This code is taking the settings for a serial port and moving it tofd 0 when qemu exits. This is likely just cut-and-paste, rip it.
add qemu_chr_set_echo
move atexit(term_exit) and O_NONBLOCK to qemu_chr_open_stdio
In the next patch, term_init will be changed to enable or disableecho at will. Move extraneous stuff out of it.
add set_echo implementation for qemu_chr_stdio
This also requires moving QemuOpts out of term_init.
Clearing ISIG is independent of whether echo is enabled or disabled.
create TextConsole together with the CharDeviceState
A nicer solution would be to get rid of the opaque pointer anduse containment, but it would also be a much bigger patch.
add set_echo implementation for text consoles
remove text_console_opts
Merge remote branch 'qemu-kvm/uq/master' into staging
aliguori: fix build with !defined(KVM_CAP_ASYNC_PF)
Merge remote branch 'spice/spice.v29.pull' into staging
Conflicts: trace-events
Merge remote branch 'spice/usb.5' into staging
Merge remote branch 'amit/for-anthony' into staging
vnc: Fix password expiration through 'change vnc ""' (v2)
commit 52c18be9e99dabe295321153fda7fce9f76647ac introduced a regression in thechange vnc password command that changed the behavior of setting the VNCpassword to an empty string from disabling login to disabling authentication....
linux-user: avoid gcc array overrun warning for sparc
Suppress a gcc array bounds overrun warning when filling in the SPARCsignal frame by adjusting our definition of the structure so that thefp and callers_pc membes are part of the ins[] array rather than...
hw/slavio_intctl.c: fix gcc warning about array bounds overrun
The Ubuntu 10.10 gcc for ARM complains that we might be overrunningthe cpu_irqs[][] array: silence this by correcting the bounds on theloop. (In fact we would not have overrun the array because bit...
SPARC: Fix Leon3 cache control
The "leon3_cache_control_int" (op_helper.c) function is called within leon3.cwhich leads to segfault error with the global "env".
Now cache control is a CPU feature and everything is handled in op_helper.c.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>...
Merge remote branch 'mst/for_anthony' into staging
blockdev: Fix drive_add for drives without media
Watch this:
(qemu) drive_add 0 if=none (qemu) info block none0: type=hd removable=0 [not inserted] (qemu) drive_del none0 Segmentation fault (core dumped)
add_init_drive() is confused about drive_init()'s failure modes, and...
blockdev: Replace drive_add()'s fmt, ... by optstr parameter
Let the callers build the optstr. Only one wants to. All the othersbecome simpler, because they don't have to worry about escaping '%'.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev: Reject multiple definitions for the same drive
We silently ignore multiple definitions for the same drive:
$ qemu-system-x86_64 -nodefaults -vnc :1 -S -monitor stdio -drive if=ide,index=1,file=tmp.qcow2 -drive if=ide,index=1,file=nonexistant...
blockdev: New drive_get_by_index()
blockdev: Factor drive_index_to_{bus,unit}_id out of drive_init()
blockdev: Make drive_add() take explicit type, index parameters
Before, type & index were hidden in printf-like fmt, ... parameters,which get expanded into an option string. Rather inconvenient foruses later in this series.
New IF_DEFAULT to ask for the machine's default interface. Before,...
blockdev: Fix regression in -drive if=scsi,index=N
Before commit 622b520f, index=12 meant bus=1,unit=5.
Since the commit, it means bus=0,unit=12. The drive is created, butnot the guest device. That's because the controllers we use withif=scsi drives (lsi53c895a and esp) support only 7 units, and...
blockdev: Put BlockInterfaceType names and max_devs in tables
Turns drive_init()'s lengthy conditional into a concise loop, andmakes the data available elsewhere.
blockdev: Move BlockInterfaceType from qemu-common.h to blockdev.h
blockdev: New drive_get_next(), replacing qdev_init_bdrv()
qdev_init_bdrv() doesn't belong into qdev.c; it's about drives, notqdevs. Rename to drive_get_next, move to blockdev.c, drop the bogusDeviceState argument, and return DriveInfo instead ofBlockDriverState....
qcow2-refcount: remove write-only variables
Variables l2_modified and l2_size are not really used, remove them.Spotted by GCC 4.6.0: CC block/qcow2-refcount.o/src/qemu/block/qcow2-refcount.c: In function 'qcow2_update_snapshot_refcount':/src/qemu/block/qcow2-refcount.c:708:37: error: variable 'l2_modified' set but not used [-Werror=unused-but-set-variable]...
strtosz() use qemu_toupper() to simplify switch statement
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
strtosz(): Fix name confusion in use of modf()
strtosz(): Use suffix macros in switch() statement
block: add block_resize monitor command
Add a monitor command that allows resizing of block devices whileqemu is running. It uses the existing bdrv_truncate method alreadyused by qemu-img to do it's work. Compared to qemu-img the sizeparsing is very simplicistic, but I think having a properly numering...
block: tell drivers about an image resize
Extend the change_cb callback with a reason argument, and use itto tell drivers about size changes.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: tell the guest about size changes
Raise a config change interrupt when the size changed. This allowsvirtio-blk guest drivers to read-read the information from theconfig space once it got the config chaged interrupt.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD
It is not possible to use virtio-ioeventfd when building without an I/Othread. We rely on a signal to kick us out of vcpu execution. Timersand AIO use SIGALRM and SIGUSR2 respectively. Unfortunately eventfd...
Add documentation for STRTOSZ_DEFSUFFIX_ macros
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Acked-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ahci: Fix cpu_physical_memory_unmap() argument ordering
The len and is_write arguments to cpu_physical_memory_unmap() wereswapped. This patch changes calls to use the correct argument ordering.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
Reorganize struct Qcow2Cache for better struct packing
Move size after the two pointers in struct Qcow2Cache to get betterpacking of struct elements on 64 bit architectures.
sheepdog: support creating images on remote hosts
This patch parses the input filename in sd_create(), and enables usspecifying a target server to create sheepdog images.
qemu-io: Fix discard command
qemu-io passed bytes where it's supposed to pass sectors, so discard requestswere off.
qcow2: Add bdrv_discard support
This adds a bdrv_discard function to qcow2 that frees the discarded clusters.It does not yet pass the discard on to the underlying file system driver, butthe space can be reused by future writes to the image.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
qed: Images with backing file do not require QED_F_NEED_CHECK
The consistency check on open is necessary in order to fix inconsistenttable offsets left as a result of a crash mid-operation. Images with abacking file actually flush before updating table offsets and are...
raw-win32: Fix bdrv_flush return value
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi hotplug: Set DriveInfo member bus correctly
drive_init() picks the first free bus and unit number, unless the userspecifies them.
This isn't a good fit for the drive_add monitor command, because therewe specify the controller by PCI address instead of using bus number...
strtosz(): use unsigned char and switch to qemu_isspace()
isspace() behavior is undefined for signed char.
Bug pointed out by Eric Blake, thanks!
Update OpenBIOS images to r1018
sdl: remove unused variable
Variable rec is not used, remove it. Spotted by GCC 4.6.0: CC ui/sdl.o/src/qemu/ui/sdl.c: In function 'sdl_setdata':/src/qemu/ui/sdl.c:90:14: error: variable 'rec' set but not used [-Werror=unused-but-set-variable]
New trace-event backend: stderr
This backend sends trace events to standard error output during the emulation.
Also add a "--list-backends" option to tracetool, so configure script candisplay the list of available backends.
prep: Disable second IDE channel, as long as ISA IDE emulation doesn't support same irq for both channels
Cc: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
prep: Remove bogus BIOS size check
r3480 added this check to account for the entry vector 0xfff00100 to beavailable for CPUs that need it. Today however, the NIP is not yetinitialized at this point (zero), so the check always triggers.
Moreover, BIOS size check is already done previously, so this part can...
mc146818rtc: update registers after a format change
For some unknown reason, the MIPS kernel briefly changes the RTC tobinary mode during boot, switch back to BCD mode and read the time. Asthe registers are updated only every second, they may still be in the...
mc146818rtc: constantify