adlib: replace register_ioport*
Convert over to memory regions to obsolete register_ioport*.
CC: malc <av1474@comtv.ru>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
dma: keep a device alive while it has SGLists
Reviewed-by: Anthony Liguori <aliguori@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi: keep device alive while it has requests
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
int128: optimize and add test cases
For add, the carry only requires checking one of the arguments.For sub and neg, we can similarly optimize computation of thecarry.
For ge, we can just do lexicographic order.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Merge remote-tracking branch 'agraf/ppc-for-upstream' into staging
Merge remote-tracking branch 'cohuck/virtio-ccw-upstr' into staging
Message-id: 1372669523-4039-1-git-send-email-cornelia.huck@de.ibm.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'luiz/queue/qmp' into staging
Message-id: 1372452199-23237-1-git-send-email-lcapitulino@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-ccw: fix build breakage on windows
event_notifier_get_fd() is not available on windows hosts. Fix this bymoving the calls to event_notifier_get_fd() to the kvm code.
Reported-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>...
PPC: Add dump_mmu() for 6xx
"(qemu) info tlb" is a very useful tool for debugging, so I implementedthe missing 6xx version.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>[agraf: fix printfs on hwaddr to PRI]Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: Fix GDB read on code area for PPC6xx
On PPC 6xx, data and code have separated TLBs. Until now QEMU was onlylooking at data TLBs, which is not good when GDB wants to read code.
This patch adds a second call to get_physical_address() with anACCESS_CODE type of access when the first call with ACCESS_INT fails....
PPC: Introduce an alias cache for faster lookups
When running QEMU with "-cpu ?" we walk through every alias for everytarget CPU we know about. This takes several seconds on my very fasthost system.
Let's introduce a class object cache in the alias table. Using that we...
PPC: Add clock-frequency export for Mac machines
Support in fwcfg has been around for exposure of the clock-frequencyCPU property. OpenBIOS reads it, we just never exposed it.
Since Mac OS X is very picky about its clock frequency values, let'sjust take a known good value and always expose that....
PPC: Newworld: Add uninorth token register
Mac OS X expects the uninorth control register set to contain oneregister that always reads back what it writes in. Expose that.
This is just a temporary hack. Eventually, we want to expose theuninorth (/uni-n in device tree) as a separate QOM device....
PPC: Newworld: Add second uninorth control register set
Mac OS X requires a second uninorth register set to be mapped a fewbytes above the first one. Let's just expose it to make it happy.
Signed-off-by: Alexander Graf <agraf@suse.de>
mac-io: Add escc-legacy memory alias region
Mac OS X's debugging serial driver accesses the ESCC through a differentregister layout, called "escc-legacy". This layout differs from the normalescc register layout purely by the location of the respective registers....
PPC: Ignore writes to L2CR
The L2CR register contains a number of bits that either impose configurationwhich we can't deal with or mean "something is in progress until the bit is0 again".
Since we don't model the former and we do want to accomodate guests using the...
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...
booke_ppc: limit booke timer to max when timeout overflow
Limit watchdog and fit timer to maximum timeout value whichqemu timer can support (INT64_MAX). This maximum timeout will behundreds of years, so limiting to max timeout is pretty safe.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>...
target-ppc: Introduce unrealizefn for PowerPCCPU
Use it to clean up the opcode table, resolving a former TODO from Jocelyn.Also switch from malloc() to g_malloc().
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
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
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
hmp: Make "info block" output more readable
HMP is meant for humans and you should notice it.
This changes the output format to use a bit more space to display theinformation more readable and leaves out irrelevant information (e.g.mention only that an image is encrypted, but not when it's not; display...
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 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...