Support for TPM command line options
This patch adds support for TPM command line options.The command line options supported here are
./qemu-... -tpmdev passthrough,path=<path to TPM device>,id=<id> -device tpm-tis,tpmdev=<id>,id=<other id>...
Merge remote-tracking branch 'quintela/migration.next' into staging
arm: fix compilation with CONFIG_FDT
A conflict was resolved the wrong way when merging commit 320ba5f (build:always link device_tree.o into emulators if libfdt available, 2013-02-05).This causes a build failure for the arm-softmmu target due to multiply...
migration: move contents of migration_close to migrate_fd_cleanup
With this patch, the migration_file is not needed anymore.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
migration: eliminate s->migration_file
The indirection is useless now. Backends can open s->file directly.
migration: inline migrate_fd_close
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
Fix page_cache leak in cache_resize
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Juan Quintela <quintela@redhat.com>
Fix cache_resize to keep old entry age
Instead of using cache_insert do the update itself
page_cache: fix memory leak
XBZRLE encoded migration introduced a MRU page cachemeachnism. Unfortunately, cached items where never freed incase of a collision in the page cache on cache_insert().
This lead to out of memory conditions during XBZRLE migration...
page_cache: dup memory on insert
The page cache frees all data on finish, on resize andif there is collision on insert. So it should be the cachesresponsibility to dup the data that is stored in the cache.
Signed-off-by: Peter Lieven <pl@kamp.de>Signed-off-by: Orit Wasserman <owasserm@redhat.com>...
migration: yay, buffering is gone
Buffering was needed because blocking writes could take a long timeand starve other threads seeking to grab the big QEMU mutex.
Now that all writes (except within _complete callbacks) are doneoutside the big QEMU mutex, we do not need buffering at all....
Rename buffered_ to migration_
This is consistent once that we have moved everything to migration.c
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
qemu-file: make qemu_fflush and qemu_file_set_error private again
migration: eliminate last_round
We will go around the loop exactly once after setting last_round.Eliminate the variable altogether.
migration: detect error before sleeping
migration: remove useless qemu_file_get_error check
migration_put_buffer is never called if there has been an error.
migration: use qemu_file_rate_limit consistently
migration: merge qemu_popen_cmd with qemu_popen
There is no reason for outgoing exec migration to do popen manuallyanymore (the reason used to be that we needed the FILE* to make itnon-blocking). Use qemu_popen_cmd.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>...
qemu-file: fsync a writable stdio QEMUFile
This is what fd_close does. Prepare for switching to a QEMUFile.
qemu-file: check exit status when closing a pipe QEMUFile
This is what exec_close does. Move this to the underlying QEMUFile.
qemu-file: add writable socket QEMUFile
qemu-file: simplify and export qemu_ftell
Force a flush when qemu_ftell is called. This simplifies the buffer magic(it also breaks qemu_ftell for input QEMUFiles, but we never use it).
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>...
migration: use QEMUFile for migration channel lifetime
As a start, use QEMUFile to store the destination and close it.qemu_get_fd gets a file descriptor that will be used by the writecallbacks.
migration: use QEMUFile for writing outgoing migration data
Second, drop the file descriptor indirection, and write directly to theQEMUFile.
migration: use qemu_ftell to compute bandwidth
Prepare for when s->bytes_xfer will be removed.
migration: small changes around rate-limiting
This patch extracts a few small changes from the next patch, whichare unrelated to adding generic rate-limiting functionality toQEMUFile. Make migration_set_rate_limit a simple accessor, anduse qemu_file_set_rate_limit consistently. Also fix a typo where...
migration: move rate limiting to QEMUFile
Rate limiting is now simply a byte counter; client callqemu_file_rate_limit() manually to determine if they have to exit.So it is possible and simple to move the functionality to QEMUFile.
This makes the remaining functionality of s->file redundant;...
qemu-file: pass errno from qemu_fflush via f->last_error
This is done by almost all callers of qemu_fflush, move the codedirectly to qemu_fflush.
migration: use qemu_file_set_error to pass error codes back to qemu_savevm_state
qemu-file: temporarily expose qemu_file_set_error and qemu_fflush
Right now, migration cannot entirely rely on QEMUFile's automaticdrop of I/O after an error, because it does its "real" I/O outsidethe put_buffer callback. To fix this until buffering is gone, expose...
migration: flush all data to fd when buffered_flush is called
Including data that resided in the QEMUFile's own buffer.
migration: use qemu_file_set_error
Remove the return value of buffered_flush, pass it via the error codeof s->file. Once this is done, the error can be retrieved simplyvia migrate_fd_close's call to qemu_fclose.
migration: simplify error handling
Always use qemu_file_get_error to detect errors, since that is howQEMUFile itself drops I/O after an error occurs. There is no needto propagate and check return values all the time.
Also remove the "complete" member, since we know that it is set (via...
migration: do not nest flushing of device data
Completion of migration is currently done with a "nested" loop thatinvokes buffered_flush: migrate_fd_completed is called bybuffered_file_thread, which calls migrate_fd_cleanup, which callsbuffered_close (via qemu_fclose), which flushes the buffer....
migration: add migrate_set_state tracepoint
Signed-off-by: Kazuya Saito <saito.kazuya@jp.fujitsu.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: prepare to access s->state outside critical sections
Accessing s->state outside the big QEMU lock will simplify a bit thelocking/unlocking of the iothread lock.
We need to keep the lock in migrate_fd_error and migrate_fd_completed,however, because they call migrate_fd_cleanup....
migration: cleanup migration (including thread) in the iothread
Perform final cleanup in a bottom half, and add joining the thread tothe series of cleanup actions.
migrate_fd_error remains for connection error, but it doesn't needto cleanup anything anymore....
block-migration: remove variables that are never read
block-migration: small preparatory changes for locking
Some small changes that will simplify the positioning of lock/unlockprimitives.
block-migration: document usage of state across threads
block-migration: add lock
Some state is shared between the block migration code and its AIOcallbacks. Once block migration will run outside the iothread,the block migration code and the AIO callbacks will be able torun concurrently. Protect the critical sections with a separate...
migration: reorder SaveVMHandlers members
This groups together the callbacks that later will have similarlocking rules.
migration: run pending/iterate callbacks out of big lock
This makes it possible to do blocking writes directly to the socket,with no buffer in the middle. For RAM, only the migration_bitmap_sync()call needs the iothread lock. For block migration, it is needed by...
migration: run setup callbacks out of big lock
Only the migration_bitmap_sync() call needs the iothread lock.
migration: simplify while loop
Unify the goto around the loop, with the exit condition at the end of it.Both can be expressed as "while (ret >= 0)".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: always use vm_stop_force_state
vm_stop_force_state does:
if (runstate_is_running()) { vm_stop(state); } else { runstate_set(state); }
migration.c does:
if (runstate_is_running()) { vm_stop(state); } else {...
migration: move more error handling to migrate_fd_cleanup
The next patch will add more cases where qemu_savevm_state_cancelneeds to be called; prepare for that already, the function can becalled twice with no ill effect.
migration: push qemu_savevm_state_cancel out of qemu_savevm_state_*
This is useful, because it lets us keep the cancellation callbacksinside the big lock while pushing the others out.
block-migration: remove useless calls to blk_mig_cleanup
Now that the cancel callback is called consistently for all errors,we can avoid doing its work in the other callbacks.
Merge remote-tracking branch 'origin/master' into staging
Merge remote-tracking branch 'bonzini/hw-dirs' into staging
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'bonzini/scsi-next' into staging
baum: fix build
08744c98115cfa144ed3493556024e400b2e2573 removed hw/baum.hbut did not adjust hw/baum.c, breaking build. Fix.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Message-id: c50406bda98f8b277e8b9004a0012fa5e5c124d0.1362822910.git.blauwirbel@gmail.com...
qemu-char: fix win32 build
96c6384776d631839a9c8fe02bf135f9ba22586c did not adjustWin32 #ifdeffery properly, breaking build in later commits. Fix.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Tested-by: Igor Mitsyanko <i.mitsyanko@gmail.com>Message-id: 0ba5565b1ed44380c57d4a5fab86e9549f581ebf.1362822910.git.blauwirbel@gmail.com...
tcg: Don't make exitreq flag a local temporary
The value is not actually live across basic blocks, so there's noneed for the local property. This eliminates storing the temporaryto its home location at the branch.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
Revert "make_device_config.sh: Fix target path in generated dependency file"
This reverts commit 23bf49b5eca716aaad073f2b47613434e1515cb5.
While *-softmmu/config-devices.mak.d is included through *.d pattern viaMakefile.target, the make_devices_config.sh call these dependencies are...
make_device_config.sh: Emit dependency file to directory where included
Placing the config-devices.mak.d file alongside the config-devices.makfile in -softmmu/ lead to it getting included into through-softmmu/Makefile in addition to ./Makefile, leading to confusion....
Makefile: Add subdir dependency on config-devices-all.mak
What 23bf49b5eca716aaad073f2b47613434e1515cb5 really seemed to try tofix is that Makefile could recurse into *-softmmu/ subdirectories beforea new *-softmmu/config-devices.mak was generated from pci.mak....
Merge branch 's390-for-upstream' of git://github.com/agraf/qemu
Merge branch 'ppc-for-upstream' of git://github.com/agraf/qemu
s390: simplify kvm cpu init
There is no special code right now and the reset ioctl is done lateron in the the reset handler anyway. Lets simplify the cpu init.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>Signed-off-by: Alexander Graf <agraf@suse.de>
s390: virtio-ccw maintainer
Add myself as maintainer for virtio-ccw and the s390-ccw-virtio machine.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>[agraf: add myself for virtio-ccw machine]Signed-off-by: Alexander Graf <agraf@suse.de>
Allow virtio-net features for legacy s390 virtio bus
Enable all virtio-net features for the legacy s390 virtio bus. This also fixeskernel BUG at /usr/src/packages/BUILD/kernel-default-3.0.58/linux-3.0/drivers/s390/kvm/kvm_virtio.c:121!
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>...
s390/css: Fix subchannel detection
We have to consider the m bit to find the real channel subsystem whendetermining the last subchannel.
If we fail to take this into account, removal of a subchannel inthe middle of a big list of devices will stop device detection after...
s390/virtio-ccw: remove redundant call to blockdev_mark_auto_del
blockdev_mark_auto_del is already called in virtio-blk-exit.Remove the redundant call.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>...
target-ppc: Fix PPC_DUMP_SPR_ACCESS build
A victim of the d523dd00a7d73b28f2e99acf45a4b3f92e56e40a AREG0conversion, insert the missing cpu_env arguments.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: Fix dma interrupt
In openbios (drivers/ide.c) they are set to
0000000d 00000000 00000002 000000000000000e 00000000 00000003 000000000000000f 00000000 00000004 00000000(The last one seems to be not implemented in qemu)
It follows convention of how they are set on real machines,...
PPC: xnu kernel expects FLUSH to be cleared on STOP
otherwise it gets stuck in a loopso clear it when unsetting run when flush is set
voidIODBDMAStop( volatile IODBDMAChannelRegisters *registers) {
IOSetDBDMAChannelControl( registers, IOClearDBDMAChannelControlBits( kdbdmaRun )...
target-ppc: Make host CPU a subclass of the host's CPU model
This avoids assigning individual class fields and contributorsforgetting to add field assignments in KVM-only code.
ppc_cpu_class_find_by_pvr() requires the CPU model classes to beregistered, so defer host CPU type registration to kvm_arch_init()....
target-ppc: List alias names alongside CPU models
Revert adding a separate -cpu ? output section for aliases and list themper CPU subclass.
Requested-by: Alexander Graf <agraf@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
target-ppc: Report CPU aliases for QMP
The QMP query-cpu-definitions implementation iterated over CPU classesonly, which were getting less and less as aliases were extracted.
Keep them in QMP as valid -cpu arguments even if not guaranteed stable.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
target-ppc: Move CPU aliases out of translate_init.c
Move array of CPU aliases to cpu-models.c, alongside model definitions.This requires to zero-terminate the aliases array since ARRAY_SIZE() canno longer be used in translate_init.c then.
Suggested-by: Alexander Graf <agraf@suse.de>...
pseries: Add compatible property to root of device tree
Currently, for the pseries machine the device tree supplied by qemu to SLOFand from there to the guest does not include a 'compatible property' at theroot level. Usually that works fine, since in this case the compatible...
target-ppc: Turn descriptive CPU model comments into device descriptions
Fix microcontroller typo while at it.
target-ppc: Update Coding Style for CPU models
Drop the space in #if defined (TODO).
target-ppc: Split model definitions out of translate_init.c
Now that model definitions only reference their parent type, modeldefinitions are independent of the family definitions and can becompiled independently of TCG translation.
Keep all #if defined(TODO) code local to cpu-models.c....
target-ppc: Fix remaining microcontroller typos among models
controler -> controller
target-ppc: Change "POWER7" CPU alias
Let it resolve to v2.3 rather than v2.0.
Suggested-by: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
pseries: Implement h_read hcall
This h_call is useful for DLPAR in future amongst other things. Given an indexit fetches the corresponding PTE stored in the htab.
Signed-off-by: Erlon Cruz <erlon.cruz@br.flextronics.com>Acked-by: David Gibson <david@gibson.dropbear.id.au>...
Save memory allocation in the elf loader
The current elf loader uses too much memory. For example, I have aexecutable with a bss section of 400 MB and I set the ram size to 512MB. Qemu uses about 780MB of RAM (which is fine), but there's a peak at1.6 GB during initialization (this is not fine)....
target-ppc: Add mechanism for synchronizing SPRs with KVM
Currently when runing under KVM on ppc, we synchronize a certain number ofvital SPRs to KVM through the SET_SREGS call. This leaves out quite a lotof important SPRs which are maintained in KVM. It would be helpful to...
target-ppc: Synchronize FPU state with KVM
Currently qemu does not get and put the state of the floating point andvector registers to KVM. This is obviously a problem for savevm, as wellas possibly being problematic for debugging of FP-using guests.
This patch fixes this by using new extensions to the ONE_REG interface to...
target-ppc: Convert CPU definitions
Turn the array of model definitions into a set of self-registering QOMtypes with their own class_init. Unique identifiers are obtained fromthe combination of PVR, SVR and family identifiers; this requires allalias #defines to be removed from the list. Possibly there are some more...
target-ppc: Introduce abstract CPU family types
Instead of assigning *_<family> constants, set .parent to a family type.
Introduce a POWERPC_FAMILY() macro to keep type registration close toits implementation. This macro will need tweaking later.
target-ppc: Set instruction flags on CPU family classes
target-ppc: Register all types for TARGET_PPCEMB
Don't attempt to suppress registration of CPU types, since the criteriais actually a property of the class and should thus become a field.Since we can't check a field set in a class_init function beforeregistering the type that leads to execution of that function, guard the...
target-ppc: Set remaining fields on CPU family classes
Now POWERPC_DEF_SVR() no longer sets family-specific fields itself.
target-ppc: Turn descriptive CPU family comments into device descriptions
This gets rid of some more overly long comments that have lost most oftheir purpose now that in most cases there's only two functions left perCPU family.
The class field is inherited by the actual CPU models, so override it....
target-ppc: Extract 970 aliases
target-ppc: Extract POWER7 alias
target-ppc: Get model name from type name
We are about to drop the redundant name field along with ppc_def_t.
target-ppc: Extract MPC82xx_HiP{3, 4} aliases
target-ppc: Extract MPC52xx alias
target-ppc: Extract MPC5200/MPC5200B aliases
target-ppc: Extract MPC8240 alias
target-ppc: Extract 405GPe alias
target-ppc: Extract MPC82xx alias
target-ppc: Extract MPC8247/MPC8248/MPC8270-80 aliases
This depends on the fix for "G2leGP3" PVR.
target-ppc: Extract MPC82xx aliases to *_HiP4