kvm: x86: Fix initial kvm_has_msr_star
KVM_GET_MSR_INDEX_LIST returns -E2BIG when the provided space is toosmall for all MSRs. But this is precisely the error we trigger with theinitial request in order to obtain that size. Do not fail in that case.
This caused a subtle corruption of the guest state as MSR_STAR was not...
TCG: Mac OS X support for ppc64 target
Darwin/ppc64 does not use function descriptors,adapt prologue and tcg_out_call accordingly.GPR2 is available for general use, so let's use it.
http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/LowLevelABI/110-64-bit_PowerPC_Function_Calling_Conventions/64bitPowerPC.html...
Update OpenBIOS images to r640
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
S390 GDB stub
In order to debug funny kernel breakages it's always good to have a workinggdb stub around.
While Uli's patches don't include one one, I needed one that's at least goodenough for 'bt' and some variable examinations during early bootup.
So here it is - the absolute basics to get the qemu gdb stub running with s390x...
Set default console to virtio on S390x
All "normal" system emulation targets in qemu I'm aware of display outputon either VGA or serial output.
Our S390x virtio machine doesn't have such kind of legacy hardware. Soinstead we need to default to a virtio console....
Add S390 maintainer information
This patch adds information about who handles what when it comes to S390.I'll gladly support anything that's related to the device emulation model andS390 KVM parts.
Since this patchset doesn't implement S390 CPU emulation, I left that part...
Add support for S390x system emulation
Let's enable the basics for system emulation so we can run virtual machineswith KVM!
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Add S390x virtio machine bus
On S390x we don't want to go through the hassle of emulating real existinghardware, because we don't need to for running Linux.
So let's instead implement a machine that is 100% based on VirtIO which wefortunately implement already....
Add S390x virtio machine description
In order to use the new S390x virtio bus we just introduced, we alsoneed a machine description that sets up the machine according to ourPV specification.
Let's add that machine description and be happy!
Signed-off-by: Alexander Graf <agraf@suse.de>...
Add KVM support for S390x
S390x was one of the first platforms that received support for KVM back in theday. Unfortunately until now there hasn't been a qemu implementation that wouldenable users to actually run guests.
So let's include support for KVM S390x in qemu!...
Allocate physical memory in low virtual address space
KVM on S390x requires the virtual address space of the guest's RAM to bewithin the first 256GB.
The general direction I'd like to see KVM on S390 move is that this requirementis losened, but for now that's what we're stuck with....
S/390 CPU fake emulation
Because Qemu currently requires a TCG target to exist and there are quite someuseful helpers here to lay the groundwork for out KVM target, let's create astub TCG emulation target for S390X CPUs.
This is required to make tcg happy. The emulation target itself won't work...
S/390 host/target build system support
This patch makes configure aware of S390 hosts and guests. When not explicitlydefined using --target-list= no S390 targets will be built though.
S/390 fake TCG implementation
Qemu won't let us run a KVM target without having host TCG support. Well, fornow we don't have any so let's implement a fake target that only stubs outeverything.
I tried to keep the patch as close to Uli's source as possible, so whenever...
Sparc64: handle MMU global bit and nucleus context
monitor: fix use of plain integer as NULL pointer, spotted by Sparse
Add "static" to please Sparse
scsi: fix incorrect ?: use
Fixes OpenBSD build.
monitor: use qemu_gettimeofday(), not gettimeofday()
Fix mingw32 build.
win32: fix variable use before initialization
monitor: rename EVENT_* to QEVENT_* to avoid conflict on mingw32
Partially fixes mingw32 build.
Sparc64: fix compilation with DEBUG_MMU
eepro100: Allocate a larger buffer for regname()
This should avoid truncating the register name when debugging.
Signed-off-by: David Benjamin <davidben@mit.edu>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove rule for config-devices.h
Since commit a992fe3d0fc185112677286f7a02204d8245b61econfig-devices.h is no longer used.
So there is no need to keep the dependency rulesany longer.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eepro100: Improve debug messages
ide: Use some already defined page macros instead of constants
Some PAGE constants were used instead of the macros we already havedefined in internal.h.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: implement stub for audio control/volume read
This implements the audio control or volume read support as needed bysome systems. A Conectiva Parolin system required this to detect an IDEdevice as CD-ROM, through the CDVOLREAD ioctl.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>...
Fix compile error when LSI_DEBUG is defined
This patch fixes the follow error when LSI_DEBUG is set.
CC libhw64/lsi53c895a.occ1: warnings being treated as errorsqemu/hw/lsi53c895a.c: In function 'lsi_io_mapfunc':qemu/hw/lsi53c895a.c:1932: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t'...
qemu-img: Fix memory leak
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
posix-aio-compat: Fix error check
Checking for nbytes < 0 is pointless as long as it's a size_t. If we want touse negative numbers for error codes, we should use signed types.
multiboot: Use signed type for negative error numbers
In mb_mod_length a return value is stored that is negative in error case. Withan unsigned type the check goes wrong.
Fix build for mingw32 on windows ($@ in macro)
Make using mingw32 on windows does not preserve $@ in macroswhen they are modified using this pattern:target: macro += something
This behaviour results in an error when QEMU_CFLAGS containing"-MMD -MP -MT $@" is modified for compilation of source files...
Fix build for mingw32 on windows ($$ expansion)
Make using mingw32 on windows fails when running grep "=y$$".The command is expanded to grep "=y$ and the missing " results in an error.
I don't expect a file config-devices.mak with =y somewhere inthe middle of a line (they are always at the end of the line),...
Fix description of size parameter in qemu-img's help text
Valid description taken from qemu-img.texi, although it would be betterto have this information recorded in only one place.
Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix recently introduced bugs in -usbdevice host
Commit 26a9e82a has the following flaws:
Make -kernel for linux work with bochsbios
While trying to run -kernel with -bios pc-bios/pcbios.bin, I realizedthat I was actually writing data to %es, but only set up %ds to a 32-bitsegment we want to write to.
So at the end of the day the data hasn't actually been copied. Oops....
multiboot: Fix module loading and setting of mmap.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
e1000: Fix warning from code review
A code review run by Steve Grubb complained about code in e1000.c:
In hw/e1000.c at line 89, vlan is declared to be 4 bytes.At line 382 is an attempt to do a memmove over it with a size of 12.
This was fixed by splitting the memmove in two calls and...
kvm: x86: Add support for VCPU event states
This patch extends the qemu-kvm state sync logic with support forKVM_GET/SET_VCPU_EVENTS, giving access to yet missing exception,interrupt and NMI states.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
SCSI: Fix Standard INQUIRY data
Vendor identification, product identification and product revision levelshould be padded with spaces without a terminating NULL character, seeSCSI-2 standard, 8.2.5.1 Standard INQUIRY data.
Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com>...
Rename DriveInfo.onerror to on_write_error
Either rename variables and functions to refer to write errors (which is whatthey actually do) or introduce a parameter to distinguish reads and writes.
Suppress optionrom build on Solaris x86
To avoid the build failing with:
gcc Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fnobuiltin -I/export/home/andreas/QEMU/qemu -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -I/export/home/andreas/QEMU/...
kvm: x86: Fix merge artifact of f8d926e9 about mp_state
targe-ppc: Sync CPU state for KVM
Some recent change made PPC guests always start at address 0x0 because envisn't synced to kvm_state on first bootup.
I'm not sure if this is the correct bugfix, but at least it makes PPC bootagain with KVM enabled.
target-ppc: Get MMU state on register sync
While x86 only needs to sync cr0-4 to know all about its MMU state and enableqemu to resolve virtual to physical addresses, we need to sync all of thesegment registers on PPC to know which mapping we're in.
So let's grab the segment register contents to be able to use the "x" monitor...
qcow2: Fix some more qemu_malloc fallout
Oh joy...
qemu-img: There is more than one host device driver
I haven't heard yet of anyone using qemu-img to copy an image to a real floppy,but it's a valid use case.
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on filedescriptors that don't need to be passed to children to stop this misbehaviour.
qemu: make cirrus init value pci spec compliant
PCI memory should be disabled at reset, otherwisewe might claim transactions at address 0.I/O should also be disabled, although for cirrusit is harmless to enable it as we do nothave I/O bar.
Note: bios fix needed for this patch to work...
qemu: cleanup unused macros in cirrus
Cirrus vga has a copy of many PCI macros,and it doesn't even use them. Clean up.We also don't need to override header typeas it is NORMAL by default.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>...
live migration: Serialize vmstate saving in stage 2
The effect of this patch with current block migration is that its stage2, ie. the first full walk-through of the block devices will beperformed completely before RAM migration starts. This ensures that...
qemu-opts: Release id on deletion
The opts id is always allocated via qemu_strdup, so it need not beconst, but it has to be released on opts deletion.
ram migration: Properly reset statistics
As we may do more than one migration (cancellation, live backup), resetbytes_transferred on stage 1.
Introduce rerror option for drives
rerror controls the action to be taken when an error occurs while accessing theguest image file. It corresponds to werror which already controls the actiontake for write errors.
This purely introduces parsing rerror command line option into the right...
ide: Implement rerror option
virtio-blk: Implement rerror option
qcow2: Store exact backing format length
Currently qcow2 unnecessarily rounds up the length of the backing format stringto the next multiple of 8. At the same time, the array in BlockDriverState canonly hold 15 characters, so in effect backing formats with 9 characters or more...
block migration: Skip zero-sized disks
No need to migrate emptiness (risking divide by zero later on).
block migration: Add support for restore progress reporting
Inject progress report in percentage into the block live stream. Thiscan be read out and displayed easily on restore.
block migration: Increase dirty chunk size to 1M
4K is too small for efficiently saving and restoring multi-GB blockdevices.
block migration: Clean up use of total_sectors
We already save total_sectors in BlkMigDevState, let's use this valueduring the migration and avoid to recalculate it needlessly.
block migration: Consolidate mig_read_device_bulk into mig_save_device_bulk
Both functions share a lot of code, so make them one.
block migration: Consolidate block transmission
Based on the original patch by Pierre Riteau: Use a common blk_sendfunction to transmit a block.
block migration: Add error handling/propagation
ram migration: Stop loading on error
Besides catching real errors, this also allows to interrrupt the qemuprocess during restore.
live migration: Allow cleanup after cancellation or error
Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel alive migration. This gives the involved subsystems a chance to clean updynamically allocated resources. Namely, the block migration layer can...
block migration: Report overall migration progress
So far progress reporting only works for the first block device. Fixthis by keeping an overall sum of sectors to be migratated, calculatingthe sum of all processed sectors, and finally basing the progress...
live migration: Propagate output monitor to callback handler
In order to allow proper progress reporting to the monitor thatinitiated the migration, forward the monitor reference through themigration layer down to SaveLiveStateHandler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
block migration: Fix outgoing progress output
Report progress of an outgoing live migration to the monitor instead ofstdout.
block migration: Report progress also via info migration
block migration: Fix coding style and whitespaces
No functional changes.
block migration: Rework constants API
Instead of duplicating the definition of constants or introducingtrivial retrieval functions move the SECTOR constants into the publicblock API. This also obsoletes sector_per_block in BlkMigState.
block migration: Cleanup dirty tracking code
This switches the dirty bitmap to a true bitmap, reducing its footprint(specifically in caches). It moreover fixes off-by-one bugs inset_dirty_bitmap (nb_sectors+1 were marked) and bdrv_get_dirty (limitcheck allowed one sector behind end of drive). And is drops redundant...
block migration: Avoid large stack buffer
Move a potentially large buffer from stack to heap.
block migration: Avoid indirection of block_mig_state
No need to push block_mig_state to the heap and, thus, establish anindirection.
block migration: Drop dead code
Import a simple queue implementation from NetBSD
Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block migration: Switch device and block lists to QSIMPLEQ
Based on the original patch by Pierre Riteau.
block migration: Initialize remaining BlkMigState fields
In case we restart a migration, submitted, read_done, transferred, andprint_completion need to be reinitialized to 0.
migration: Fix use of file after release
qemu_fclose frees the passed file structure, but do_migrate_set_speedmay access it later on. Fix it by setting file NULL inmigrate_fd_cleanup and checking for this.
migration: Catch multiple start commands
savevm: Port to qdev.vmsd all devices that have qdev
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: vmstate_register() already assign consecutive numbers starting at 0
qdev: enable vmstate_unregister() support
Now vmstate_unregister have the right type
vmstate: Add support for VBUFFERS
Support for buffer that are pointed by a pointer (i.e. not embedded)where the size that we want to use is a field in the state.We also need a new place to store where to start in the middle of thebuffer, as now it is a pointer, not the offset of the 1st field....
vmstate: Introduce VMSTATE_STRUCT_TEST
vmstate: Introduce VMSTATE_STRUCT_POINTER_TEST
vmstate: Introduce UINT16_TEST support
vmstate: remove usused VMSTATE_STRUCT_ARRAY_SIZE_UINT8
vmstate: Add support for multiplying size for a constant
When the size that we want to transmit is in another field, but in anunit different that bytes
vmstate: Avoid seeking
Seeking on vmstate save/load does not work if the underlying file is astream. We could try to make all QEMUFile* forward-seek-aware, but firstattempts in this direction indicated that it's saner to convert the fewqemu_fseek-on-vmstates users to plain reads/writes....
vmstate: Fix info field of VMSTATE_MACADDR
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: fix missing ARRAY_OF_POINTERS support on save state
lsi53c895a: Use alternative address when already reselected
See SCRIPTS, 3.2.17 SELECT.
Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
lsi53c895a: Implement IRQ on reselection
The critical part of this change is how to deal with simultaneaousgeneration of interrupts. The only (normal) case when this happens inthe emulation is near simultaneous reselection + selection. If selectioncomes first, there is no problem, since the target attempting...
lsi53c895a: Whitespace and typo fixes
lsi53c895a: Add support for LSI53C700 Family Compatibility bit
lsi53c895a: Fix message code of DISCONNECT
See SCSI-2, 6.5 Message system description/message codes.
lsi53c895a: Fix SDID in SELECT ID command
See SCRIPTS Programming Guide, 3.2.17 SELECT.