spapr-rtas: add CPU argument to RTAS calls
RTAS is a hypervisor provided binary blob that a guest loads andcalls into to execute certain functions. It's similar to thevsyscall page in Linux or the short lived VMCI paravirt interfacefrom VMware.
The QEMU implementation of the RTAS blob is simply a passthrough...
pseries: Fix compiler warning (conversion of pointer to integral value)
This kind of type cast must use uintptr_t or target_ulong to be portablefor hosts with sizeof(void *) != sizeof(long).
Here the value is assigned to a variable of type target_ulong....
target-ppc kvm: save cr register
This adds a missing code to save CR (condition register) viakvm_arch_put_registers(). kvm_arch_get_registers() already has it.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
pseries: Update MAINTAINERS information
I'm no longer at IBM, and therefore no long actively working on the pseries(aka sPAPR) qemu machine type. This patch removes my information in theMAINTAINERS file.
While we're at it, I've added some extra file patterns for pseries specific...
Graphics: Switch to 800x600x32 as default mode
We have stayed at 800x600x15 as default graphics mode for the last 9 years.If there ever was a reason to be there, surely nobody remembers it.
However, recently non-Linux PPC guests started to show bad effects on 15 bit...
intc/openpic: Convert to QOM realize
Split qdev initfn into instance_init and realize functions.Change one occurrence of "klass" while at it.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
intc/openpic_kvm: Fix QOM and build issues
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
mpc8544_guts: Fix MemoryRegion name
6544 -> 8544
mpc8544_guts: QOM'ify
Introduce type constant, cast macro and rename parent field.
mpc8544_guts: Turn qdev initfn into instance_init
SysBus can deal with NULL SysBusDeviceClass::init since 4ce5dae.
target-ppc: Drop redundant flags assignments from CPU families
Previous code has #define POWERPC_INSNS2_<family> PPC_NONE in someplaces for macrofied assignment to insns_flags2 field.
PPC_NONE is defined as zero though and QOM classes are zero-initialized,...
ppc: do not register IABR SPR twice for 603e
IABR SPR is already registered in gen_spr_603(), called from init_proc_603E().
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
target-ppc: Change default machine for 64-bit
Currently, for qemu-system-ppc64, the default machine type is 'mac99'.The mac99 machine is not being actively maintained, and represents abizarre hybrid of components that never actually existed as a real system....
KVM: Export kvm_init_irq_routing
On PPC, we can have different types of interrupt controllers, so we reallyonly know that we are going to use one when we created it.
Export kvm_init_irq_routing() to common code, so that we don't have to callkvm_irqchip_create()....
KVM: MSI: Swap payload to native endianness
The usual MSI injection mechanism writes msi.data into memory using anle32 wrapper. So on big endian guests, this swaps msg.data into theexpected byte order.
For irqfd however, we don't swap the payload right now, rendering...
openpic: factor out some common defines into openpic.h
...for use by the KVM in-kernel irqchip stub.
Signed-off-by: Scott Wood <scottwood@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: e500: factor out mpic init code
KVM in-kernel MPIC support is going to expand this even more,so let's keep it contained.
KVM: PIC: Only commit irq routing when necessary
The current logic updates KVM's view of our interrupt map every time wechange it. While this is nice and bullet proof, it slows things downbadly for me. QEMU spends about 3 seconds on every start telling KVM what...
PPC: Add non-kvm stub file
There are cases where a kvm provided function is called from generichw code that doesn't know whether kvm is available or not. Providea stub file which can provide simple replacement functions for thosecases.
Signed-off-by: Alexander Graf <agraf@suse.de>...
kvm/openpic: in-kernel mpic support
Enables support for the in-kernel MPIC that thas been merged into theKVM next branch. This includes irqfd/KVM_IRQ_LINE support from AlexGraf (along with some other improvements).
Note from Alex regarding kvm_irqchip_create():...
intc/openpic: QOM'ify
Introduce type constant and cast macro.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Alexander Graf <agraf@suse.de>
KVM: Don't assume that mpstate exists with in-kernel PIC always
On PPC, we don't support MP state. So far it's not necessary and I'mnot convinced yet that we really need to support it ever.
However, the current idle logic in QEMU assumes that an in-kernel PIC...
Merge remote-tracking branch 'mjt/trivial-patches' into staging
qemu-char: Fix ID reuse after chardev-remove for qapi-based init
Commit 2c5f488 introduced qapi-based character device initializationas a new code path in qemu_chr_new_from_opts(). Unfortunately, itfailed to store parameter opts in the new chardev. Therefore,...
console: Hook QemuConsoles into qom tree
Put them named "console[$index]" below "/backend", so you canlist & inspect them via QMP.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Message-id: 1372150171-8707-1-git-send-email-kraxel@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
gtk: add support for surface conversion
Also use CAIRO_FORMAT_RGB24 unconditionally. DisplaySurfaces will neverever see 8bpp surfaces. And using CAIRO_FORMAT_RGB16_565 for the 16bppcase doesn't seem to be a good idea too.
<quote src="/usr/include/cairo/cairo.h">...
vl: convert -smp to qemu_opts_parse()
This also introduces a new suboption, "cpus=",which is the default. So after this patch,
-smp n,sockets=y
is the same as
-smp cpus=n,sockets=y
(with "cpu" being some generic thing, referring toeither cores, or threads, or sockets, as before)....
multiboot: Don't forget last mmap entry
When the BIOS returns ebx = 0, the current entry is still valid andneeds to be included in the Multiboot memory map.
Fixing this meant that using bx as the entry index doesn't work anymore because it's 0 on the last entry (and it was SeaBIOS-specific...
multiboot: Calculate upper_mem in the ROM
The upper_mem field of the Multiboot information struct doesn't reallycontain the RAM size - 1 MB like we used to calculate it, but only thememory from 1 MB up to the first (upper) memory hole.
In order to correctly retrieve this information, the multiboot ROM now...
multiboot: Updated ROM binary
Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1372018066-21822-4-git-send-email-mail@kevin-wolf.deSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
arch_init: Fix format string by using RAM_ADDR_FMT
length is a ram_addr_t, so RAM_ADDR_FMT must be used instead of %ld.This fixes a recently introduced regression for w64 builds.
Using RAM_ADDR_FMT also changes decimal output to sedecimal.This is good here because length and block->length should both...
qemu-char: add -chardev mux support
Allow to explicitly create mux chardevs on the command line,like you can using QMP.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
qemu-char: report udp backend errors
qemu-socket: don't leak opts on error
doc: we use seabios, not bochs bios
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
qemu-socket: zero-initialize SocketAddress
qemu-socket: drop pointless allocation
qemu-socket: catch monitor_get_fd failures
qemu-char: check optional fields using has_*
qemu-char: use more specific error_setg_* variants
qemu-char: print notification to stderr
qemu-char: fix documentation for telnet+wait socket flags
qemu-char: don't leak opts on error
qemu-char: use ChardevBackendKind in CharDriver
qemu-char: minor mux chardev fixes
mux failure path has a memory leak. creating a mux chardev can'tfail though, so just assert() that instead of fixing an error pathwhich never ever runs anyway ...
Also fix bid being leaked while being at it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
cmd646: fix build when DEBUG_IDE is enabled.
Make sure we use the correct TARGET/PRI macros in the debug statements.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>CC: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: change default of .has_zero_init to 0
.has_zero_init defaults to 1 for all formats and protocols.
this is a dangerous default since this means that allnew added drivers need to manually overwrite it to 0 ifthey do not ensure that a device is zero initialized...
gdbstub: Set gdb_set_stop_cpu() argument to CPUState
Use CPUState::env_ptr for now.
Prepares for changing cpu_handle_guest_debug() argument to CPUState.
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Andreas Färber <afaerber@suse.de>
cpus: Change cpu_handle_guest_debug() argument to CPUState
CPUArchState is no longer needed.
Prepares for changing qemu_kvm_cpu_thread_fn() opaque to CPUState.
cpus: Change qemu_kvm_start_vcpu() argument to CPUState
Pass it on to qemu_kvm_cpu_thread_fn().
Prepares for changing qemu_init_vcpu() argument to CPUState.
cpus: Change qemu_dummy_start_vcpu() argument to CPUState
Pass it to qemu_dummy_cpu_thread_fn().Use CPUState::env_ptr for cpu_single_env.
cpu: Change qemu_init_vcpu() argument to CPUState
This allows to move the call into CPUState's realizefn.Therefore move the stub into libqemustub.a.
hwaddr: Make hwaddr type usable beyond softmmu
While not normally needed for *-user, it can safely be used there sincealways based on uint64_t, to avoid ifdeffery.
To avoid accidental uses, move the guards from exec/hwaddr.h to itsinclusion sites. No need for them in include/hw/....
cpu: Turn cpu_unassigned_access() into a CPUState hook
Use it for all targets, but be careful not to pass invalid CPUState.cpu_single_env can be NULL, e.g. on Xen.
Signed-off-by: Andreas Färber <afaerber@suse.de>
target-alpha: Register VMStateDescription for AlphaCPU
Commit b758aca1f6cdb175634812b79f5560c36c902d00 (target-alpha: Enablethe alpha-softmmu target.) introduced cpu_{save,load}() functions butdidn't define CPU_SAVE_VERSION, so they were never registered....
target-openrisc: Register VMStateDescription for OpenRISCCPU
Since commit e67db06e9f6d7e514ee2a9b9b769ecd42977f6fb (target-or32: Addtarget stubs and QOM cpu) a VMStateDescription existed, butCPU_SAVE_VERSION was not set, so it was never registered.
Drop cpu_{save,load}() and register VMStateDescription via DeviceState....
cpu: Guard cpu_{save,load}() definitions
A few targets already managed to implement cpu_save() and cpu_load()without defining CPU_SAVE_VERSION that causes them to be registered.
Guard the prototypes with CPU_SAVE_VERSION to avoid this happening againuntil all targets are converted to VMState (or QIDL)....
gdbstub: Simplify find_cpu()
Use qemu_get_cpu() and CPUState::env_ptr.
kvm: Change kvm_cpu_synchronize_state() argument to CPUState
It no longer relies on CPUArchState since 20d695a.
Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>...
kvm: Change cpu_synchronize_state() argument to CPUState
Change Monitor::mon_cpu to CPUState as well.
Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Change cpu_exit() argument to CPUState
It no longer depends on CPUArchState, so move it to qom/cpu.c.
Prepares for changing GDBState::c_cpu to CPUState.
cpus: Change cpu_thread_is_idle() argument to CPUState
It no longer needs CPUArchState.
Prepares for changing all_cpu_threads_idle() CPU loop to CPUState andneeded for changing qemu_kvm_wait_io_event() argument to CPUState.
Reviewed-by: Richard Henderson <rth@twiddle.net>...
cpus: Change qemu_kvm_wait_io_event() argument to CPUState
It no longer uses CPUArchState.
kvm: Change kvm_set_signal_mask() argument to CPUState
Prepares for changing qemu_kvm_init_cpu_signals() argument to CPUState.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>...
cpus: Change qemu_kvm_init_cpu_signals() argument to CPUState
cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks
Make cpustats monitor command available unconditionally.
Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()arguments to CPUState.
kvm: Change kvm_handle_internal_error() argument to CPUState
Prepares for changing kvm_cpu_exec() argument to CPUState.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Andreas Färber <afaerber@suse.de>
kvm: Change kvm_cpu_exec() argument to CPUState
cpu: Fix cpu_class_set_vmsd() documentation
It's CPUClass::vmsd, not CPUState::vmsd.
Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Introduce device_class_set_vmsd() helper
It's the equivalent to cpu_class_set_vmsd(), to assignDeviceClass::vmsd. It wasn't needed before since only static,unmigratable VMStateDescriptions were assigned so far.
Reviewed-by: Juan Quintela <quintela@redhat.com>...
cpu: Introduce VMSTATE_CPU() macro for CPUState
To be used to embed common CPU state into CPU subclasses.
Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
vpc: Implement .bdrv_has_zero_init
Depending on the subformat, has_zero_init on VHD must behave like rawand query the underlying storage (fixed) or like other sparse formatsthat can always return 1 (dynamic, differencing).
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev: add DriveBackup transaction
This patch adds a transactional version of the drive-backup QMP command.It allows atomic snapshots of multiple drives along with automaticcleanup if there is a failure to start one of the backup jobs.
Note that QMP events are emitted for block job completion/cancellation...
blockdev: add Abort transaction
The Abort action can be used to test QMP 'transaction' failure. Add itas the last action to exercise the .abort() and .cleanup() code pathsfor all previous actions.
Reviewed-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>...
qemu-iotests: extract wait_until_completed() into iotests.py
The 'drive-mirror' tests often issue 'block-job-complete' and wait forthe QMP completion event. Other types of block jobs also want to waitfor completion but they may not need to issue 'block-job-complete'....
qemu-iotests: add 055 drive-backup test case
Testing drive-backup is similar to image streaming and drive mirroring.This test case is based on 041.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Make BlockJobTypes const
block/ssh: Set bdrv_has_zero_init according to the file type.
If the remote is a regular file, set it to true (ie. reads ofuninitialized areas in a newly created file will return zeroes).If we can't prove that, return false (a safe default).
Tested by adding a debugging print statement [not part of this commit]...
gluster: Return bdrv_has_zero_init = 0
GlusterFS volumes can be backed by block devices, in which casebdrv_create() doesn't make sure that the image is zeroed out. It iscurrently not possibly to detect whether a given image is backed by afile or a block device, and incorrectly assuming that it is zeroed...
vmdk: remove wrong calculation of relative path
When creating image with backing file, the driver tries to calculate therelative path from created image file to backing file, but the pathcomputation is incorrect. e.g.:
$ qemu-img create -f vmdk -b vmdk-data-disk.vmdk vmdk-data-snapshot1...
raw-posix: Fix /dev/cdrom magic on OS X
The raw-posix driver has code to provide a /dev/cdrom on OS X eventhough it doesn't really exist. However, since commit c66a6157 the realfilename is dismissed after finding it, so opening /dev/cdrom fails.Put the filename back into the options QDict to make this work again....
notify: add NotiferWithReturn so notifier list can abort
notifier_list_notify() has no return value. This is fine when we justwant to invoke side-effects.
Sometimes it's useful for notifiers to produce a return value. Thisallows notifiers to "veto" an operation and will be used by the block...
block: add bdrv_add_before_write_notifier()
The bdrv_add_before_write_notifier() function installs a callback thatis invoked before a write request is processed. This will be used toimplement copy-on-write point-in-time snapshots where we need to copy...
block: add basic backup support to block driver
backup_start() creates a block job that copies a point-in-time snapshotof a block device to a target block device.
We call backup_do_cow() for each write during backup. That functionreads the original data from the block device before it gets...
blockdev: drop redundant proto_drv check
It is not necessary to check that we can find a protocol block driversince we create or open the image file. This produces the error that weneed anyway.
Besides, the QERR_INVALID_BLOCK_FORMAT is inappropriate since the...
blockdev: use bdrv_getlength() in qmp_drive_mirror()
Use bdrv_getlength() for its byte units and error return instead ofbdrv_get_geometry().
Reported-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>...
block: add drive-backup QMP command
@drive-backup
Start a point-in-time copy of a block device to a new destination. Thestatus of ongoing drive-backup operations can be checked withquery-block-jobs where the BlockJobInfo.type field has the value 'backup'....
blockdev: rename BlkTransactionStates to singular
The QMP 'transaction' command keeps a list of in-flight transactions.The transaction state structure is called BlkTransactionStates eventhough it only deals with a single transaction. The only plural thing...
blockdev: allow BdrvActionOps->commit() to be NULL
Some QMP 'transaction' types don't need to do anything on .commit().Make .commit() optional just like .abort().
The "drive-backup" action will take advantage of this, it only needs tocancel the block job on .abort(). Other block job actions will probably...
linux-user: Fix compilation failure
Fix compilation failures for linux-user targets following recentmigration related commits bd2fa51fcd and 43487c67.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1372362818-4740-1-git-send-email-peter.maydell@linaro.org...
Merge remote-tracking branch 'quintela/migration.next' into staging
rdma: export yield_until_fd_readable()
The RDMA event channel can be made non-blocking just like a TCPsocket. Exporting this function allows us to yield so that theQEMU monitor remains available.
Reviewed-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>...
rdma: export throughput w/ MigrationStats QMP
This exposes throughput (in megabits/sec) through QMP.
Reviewed-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Chegu Vinod <chegu_vinod@hp.com>Tested-by: Chegu Vinod <chegu_vinod@hp.com>...
rdma: introduce qemu_file_mode_is_not_valid()
QEMUFileRDMA also has read and write modes. This function is nowshared to reduce code duplication.
Reviewed-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Chegu Vinod <chegu_vinod@hp.com>...
rdma: export qemu_fflush()
RDMA uses this to flush the control channel before sending itsown message to handle page registrations.
rdma: introduce qemu_ram_foreach_block()
This is used during RDMA initialization in order totransmit a description of all the RAM blocks to thepeer for later dynamic chunk registration purposes.
rdma: new QEMUFileOps hooks
These are the prototypes and implementation of new hooks thatRDMA takes advantage of to perform dynamic page registration.
An optional hook is also introduced for a custom functionto be able to override the default save_page function....
rdma: introduce capability x-rdma-pin-all
This capability allows you to disable dynamic chunk registrationfor better throughput on high-performance links.
For example, using an 8GB RAM virtual machine with all 8GB of memory inactive use and the VM itself is completely idle using a 40 gbps infiniband link:...