savevm: Add VMSTATE_UINTTL_EQUAL helper
This adds an _EQUAL VMSTATE helper for target_ulongs, defined in terms ofVMSTATE_UINT32_EQUAL or VMSTATE_UINT64_EQUAL as appropriate.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Juan Quintela <quintela@redhat.com>
Common definitions for VMWARE devices
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>Signed-off-by: Yan Vugenfirer <yan@daynix.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Packet abstraction for VMWARE network devices
VMXNET3 device implementation
Remove device_tree.o from hw/moxie/Makefile.objs.
Here's a fix for the build problem identified by Aurelien Jarno here:http://lists.gnu.org/archive/html/qemu-devel/2013-03/msg04177.html
Signed-off-by: Anthony Green <green@moxielogic.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Add sample moxie system
Signed-off-by: Anthony Green <green@moxielogic.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge branch 'for-upstream' of git://github.com/mwalle/qemu
Merge branch 'ppc-for-upstream' of git://github.com/agraf/qemu
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
qdev: remove redundant abort()
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
mmu-hash*: Add header file for definitions
Currently cpu.h contains a number of definitions relating to the 64-bithash MMU. Some are used in the MMU emulation code, but some are only usedin the spapr MMU management hcall implementations.
This patch moves these definitions (except for a few that are needed...
mmu-hash*: Add hash pte load/store helpers
On real hardware the ppc hash page table is stored in memory; accordinglyour mmu emulation code can read a hash page table in guest memory. But,when paravirtualized under PAPR, the real hash page table is in host...
pseries: Fix breakage in CPU QOM conversion
Commit 259186a7d2f7184efc96ae99bc5658e6159f53ad "cpu: Move halted andinterrupt_request fields to CPUState" broke the pseries machine. That'sbecause it uses CPU instead of ENV_GET_CPU() to convert from the global...
pseries: Remove "busname" property for PCI host bridge
Currently the "spapr-pci-host-bridge" device has a "busname" property whichcan be used to override the default assignment of qbus names for the bussubordinate to the PHB. We use that for the default primary PCI bus, to...
pseries: Move XICS initialization before cpu initialization
Currently, the pseries machine initializes the cpus, then the XICSinterrupt controller. However, to support the upcoming in-kernel XICSimplementation we will need to initialize the irq controller before the...
serial: Fix debug format strings
This fixes the build of hw/serial.c with DEBUG_SERIAL enabled.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Fix typos and misspellings
Fix various typos and misspellings. The bulk of these were found withcodespell.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
virtio-ccw, s390-virtio: Use generic virtio-blk macro.
Now that virtio-ccw and s390-virtio define all common propertiesfor virtio-blk, we can switch to using the genericDEFINE_VIRTIO_BLK_PROPERTIES macro.
CC: Alexander Graf <agraf@suse.de>Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
s390-virtio, virtio-ccw: Add config_wce for virtio-blk.
There's no reason why we wouldn't want to make the cache modeconfigurable.
Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
virtio-ccw: Add missing blk chs properties.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Merge remote-tracking branch 'kraxel/ipxe.2' into staging
virtio-blk: Do not segfault fault if failed to initialize dataplane
$ ~/usr/bin/qemu-system-x86_64 -enable-kvm -m 1024 -drive if=none,id=drive0,cache=none,aio=native,format=raw,file=/root/Image/centos-6.4.raw -device virtio-blk-pci,drive=drive0,scsi=off,x-data-plane=on,config-wce=on # make dataplane fail to initialize...
milkymist-uart: fix receive buffering
Inform qemu-char when more input data can be received.
Signed-off-by: Michael Walle <michael@walle.cc>
lm32_uart: fix receive buffering
configure: rename OpenGL feature to GLX
As the probe now actually checks for the availability of GLX, rename itaccordingly. The only user of this feature is the milkymist-tmu2 model.
virtio-blk: cleanup: QOM cast
Use QOM casts inside virtio-blk.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1363624648-16906-11-git-send-email-fred.konrad@greensocs.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-blk: cleanup: remove qdev field.
The qdev field is no longer needed, just drop it.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1363624648-16906-12-git-send-email-fred.konrad@greensocs.com...
virtio-blk: add the virtio-blk device.
Create virtio-blk which extends virtio-device, so it can be connected onvirtio-bus.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1363624648-16906-6-git-send-email-fred.konrad@greensocs.com...
virtio-blk-pci: switch to new API.
Here the virtio-blk-pci is modified for the new API. The devicevirtio-blk-pci extends virtio-pci. It creates and connects a virtio-blkduring the init. The properties are not changed.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>...
virtio-blk-s390: switch to the new API.
Here the virtio-blk-s390 is modified for the new API. The devicevirtio-blk-s390 extends virtio-s390-device as before. It creates andconnects a virtio-blk during the init. The properties are not modified.
virtio-blk-ccw switch to new API.
Here the virtio-ccw-s390 is modified for the new API. The devicevirtio-ccw-s390 extends virtio-ccw-device as before. It creates andconnects a virtio-ccw during the init. The properties are not modified.
virtio-blk: cleanup: init and exit functions.
As all virtio-blk-* are switched to the new API, we can remove the separateinit/exit for the old API.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
virtio: make virtio device's structures public.
These structures must be made public to avoid two memory allocations forrefactored virtio devices.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Andreas Färber <afaerber@suse.de>...
virtio-x-bus: fix allow_hotplug assertion.
This set allow_hotplug for each existing virtio-x-bus, allowing therefactored devices to be hot pluggable.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1363624648-16906-3-git-send-email-fred.konrad@greensocs.com...
virtio-pci: fix hot unplug.
Hot unplug failed because it tried to free the virtio device two times.
This fix the issue by removing the call to virtio_bus_destroy_device.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1363624648-16906-4-git-send-email-fred.konrad@greensocs.com...
virtio-blk: don't use pointer for configuration.
The configuration field must not be a pointer as it will be used for virtio-blkproperties. So *blk is replaced by blk in VirtIOBlock structure.
spice: stop using DisplayState
Rework DisplayStateListener callbacks to not use the DisplayStateany more.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
console: zap displaystate from dcl callbacks
Now that nobody depends on DisplayState in DisplayChangeListenercallbacks any more we can remove the parameter from all callbacks.
console: stop using DisplayState in gfx hardware emulation
Use QemuConsole instead. Updates interfaces in console.[ch] and adaptsgfx hardware emulation code.
console: fix displaychangelisteners interface
Split callbacks into separate Ops struct. Pass DisplayChangeListenerpointer as first argument to all callbacks. Uninline a bunch ofdisplay functions and move them from console.h to console.c
qxl: zap qxl0 global
DisplayChangeListener is passed now to all DisplayChangeListenerOpscallbacks, so we can use that to access the qxl state and kill theqxl0 global variable.
qxl: better vga init in enter_vga_mode
Ask the vga core to update the display. Will trigger dpy_gfx_resizeif needed. More complete than just calling dpy_gfx_resize.
console: rework DisplaySurface handling [vga emu side]
Decouple DisplaySurface allocation & deallocation from DisplayState.Replace dpy_gfx_resize + dpy_gfx_setdata with a dpy_gfx_replace_surfacefunction.
This handles the graphic hardware emulation.
console: rework DisplaySurface handling [dcl/ui side]
Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListenercallbacks with a dpy_gfx_switch callback which notifies the ui codewhen the framebuffer backing storage changes.
Switch to efi-enabled nic roms by default
All PCI nics are switched to EFI-enabled roms by default. They arecomposed from three images (legacy, efi ia32 & efi x86), so classicpxe booting will continue to work.
Exception: eepro100 is not switched, it uses a single rom for all...
xilinx_spips: Fix bus setup conditional check
The R_LQPSI_CFG register has the LQSPI_CFG_SEP_BUS and LQSPI_CFG_TWO_MEM bits.
Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: d76c8e364c80a42352ae4f0661aff2cd17ad32a4.1362373359.git.peter.crosthwaite@xilinx.com...
xilinx_spips: Add missing dual-bus snoop commands
Added additional commands to the switch to check for when snooping commands indual bus mode setups. Cleaned up code to use an enum.
Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
xilinx_spips: QOM styling fixes
Few fixes for the latest QOM styling guides.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: de9daeee6c142e8b57ad042fd680cedcdc94d2fc.1362373359.git.peter.crosthwaite@xilinx.comSigned-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/vexpress: Set reset values for daughterboard oscillators
Set the reset values for the VExpress daughterboard oscillatorsvia the new sysctl properties.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
pl330: Initial version
Device model for Primecell PL330 DMA controller.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru>Tested-by: Igor Mitsyanko <i.mitsyanko@samsung.com>Reviewed-by: Igor Mitsyanko <i.mitsyanko@samsung.com>...
xilinx_zynq: added pl330 to machine model
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 5bc295bd2aa50dfe573f428574dbd7d8add7b3f8.1361853677.git.peter.crosthwaite@xilinx.com...
xilinx_spips: Set unused IRQs to NULL
Unused CS lines should init to 0 to avoid segfaulting when accessing anunattached QSPI controller.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: c1e45198032106e69e8fe9339fc2e6348d524fcd.1362373359.git.peter.crosthwaite@xilinx.com...
qdev: Implement (variable length) array properties
Add support for declaring array properties for qdev devices.These work by defining an initial static property 'len-arrayname'which the user of the device should set to the desired sizeof the array. When this property is set, memory is allocated...
hw/arm_sysctl: Implement SYS_CFG_VOLT
Implement the SYS_CFG_VOLT registers which return the voltageof various supplies on motherboard and daughterboard. SinceQEMU implements a perfectly stable power supply these registersalways return a constant value. The number and value of the...
hw/vexpress: Pass voltage sensor properties to sysctl device
Pass voltage sensor properties to the sysctl device. Sincethese are daughterboard specific, we specify them via theVEDBoardInfo structure.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
hw/arm_sysctl: Implement SYS_CFG_OSC function
Implement the SYS_CFG_OSC function. Since the idea ofprogrammable clock rates doesn't make much sense for QEMU,we simply allow the clock rate to be read back as written.The number and value of the daughterboard oscillators varies...
hw/vexpress: Pass proc_id via VEDBoardInfo
Pass the daughterboard-specific proc_id property to the code thatcreates the sysctl device via the VEDBoardInfo struct, rather thanby having the daughterboard init function write to a uint32_t*argument. This is a cleaner way to pass the info around, and...
hw/arm_sysctl: Handle SYS_CFGCTRL in a more structured way
The SYS_CFGCTRL register consists of separate fieldsfor DCC, function, site, position and device, as wellas a read/write bit. Refactor the code handling SYS_CFGCTRLwrites to make it easier to add support for functions...
hw/arm_sysctl: Implement SYS_CFG_MUXFPGA writes as a no-op
SYS_CFG_MUXFPGA allows the guest to select whether thevideo output should come from the motherboard's LCDcontroller or the daughterboard's one. Since QEMU doesn'tcurrently support selecting the video output like this,...
hw/arm_sysctl: Implement SYS_CFG_DVIMODE as a no-op
SYS_CFG_DVIMODE allows the guest to select whether theoutput DVI signal is VGA, SVGA, XGA, SGA or UXGA. Sincethis makes no difference to QEMU, implement writes as ano-op so Linux doesn't complain.
hw/arm_sysctl: Convert from qdev init to instance_init
Convert this device from old-style qdev init to an instance_initfunction. We don't need a realize function yet, though.
Merge remote-tracking branch 'stefanha/block' into staging
Merge remote-tracking branch 'cohuck/virtio-ccw-upstr' into staging
dataplane: fix hang introduced by AioContext transition
The bug is that the EventNotifiers do have a NULL io_flush callback.Because none of the callbacks on the dataplane AioContext have such acallback, aio_poll will simply do nothing. Fixed by adding the callbacks:...
block: Add options QDict to bdrv_open() prototype
It doesn't do anything yet except storing the options QDict in theBlockDriverState.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>...
virtio-ccw: remove qdev_unparent in unplug routing
This patch fixes unplugging a virtio-ccw device. We nolonger need to do that in virtio-ccw since common code does nowproper handling.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>...
virtio-ccw: Wire up virtio-rng.
Make virtio-rng devices available for s390-ccw-virtio machines.
cpu: Move halted and interrupt_request fields to CPUState
Both fields are used in VMState, thus need to be moved together.Explicitly zero them on reset since they were located beforebreakpoints.
Pass PowerPCCPU to kvmppc_handle_halt().
Signed-off-by: Andreas Färber <afaerber@suse.de>
exec: Pass CPUState to cpu_reset_interrupt()
Move it to qom/cpu.c to avoid build failures depending on include orderof cpu-qom.h and exec/cpu-all.h.
Change opaques of various ..._irq_handler() functions to theappropriate CPU type to facilitate using cpu_reset_interrupt()....
cpu: Pass CPUState to cpu_interrupt()
Move it to qom/cpu.h to avoid issues with include order.
Change pc_acpi_smi_interrupt() opaque to X86CPU.
target-sh4: Move PVR/PRR/CVR into SuperHCPUClass
They are never changed once initialized, and moving them to the classwill allow to inspect them before instantiating.
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...
Merge remote-tracking branch 'origin/master' into staging
Merge remote-tracking branch 'bonzini/hw-dirs' 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...
Merge branch 's390-for-upstream' of git://github.com/agraf/qemu
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.
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 )...
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...
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)....
pseries: Add cleanup hook for PAPR virtual LAN device
Currently the spapr-vlan device does not supply a cleanup call for itsNetClientInfo structure. With current qemu versions, that leads to a SEGVon exit, when net_cleanup() attempts to call the cleanup handlers on all...
serial: add flow control to transmit
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 2976f10d4e66ed4a34011f6f0d6937026d22be5f.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio: console: add flow control
The virtio-serial-bus already has the logic to make flow control workproperly. Hook into the char layer's new ability to signal a backend iswritable again.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: abffa02235d55ca6e2489068c58971c8897e976c.1362505276.git.amit.shah@redhat.com...
virtio-serial: make flow control explicit in virtio-console
virtio-console.c used to return a value less than the number of bytesasked to be written out to a chardev backend in case the backend is notwritable. virtio-serial-bus.c then implicitly enabled flow control for...
qemu-char: move baum registration to baum.c
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 1b24baa1ec3a174d5cad31e079d829904b53077b.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: move msmouse registeration to msmouse.c
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: b47d1153b0d7669743c9a6bb98ce30f4cf7f876b.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci_host: Drop write-only address_space field
The address_space field of PCIHostState was only ever written, never used.Drop it completely.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
lm32: remove unused function
The milkymist-minimac device in fact does not exist at all.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Acked-by: Michael Walle <michael@walle.cc>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/nand.c: correct the sense of the BUSY/READY status bit
The BIT6 of Status Register(SR):
SR6 behaves the same as R/B# pin SR6 = 0 indicates the device is busy; SR6 = 1 means the device is ready
Some NAND flash controller (i.e. ftnandc021) relies on the SR6...
scsi: do not call scsi_read_data/scsi_write_data for a canceled request
Cc: qemu-stable@nongnu.orgSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi-disk: do not complete canceled UNMAP requests
Canceled requests should never be completed, and doing that could causeaccesses to a NULL hba_private field.
Cc: qemu-stable@nongnu.orgReported-by: Stefan Priebe <s.priebe@profihost.ag>Tested-by: Stefan Priebe <s.priebe@profihost.ag>...
scsi-disk: handle io_canceled uniformly and correctly
Always check it immediately after calling bdrv_acct_done, andalways do a "goto done" in case the "done" label has to freesome memory---as is the case for scsi_unmap_complete in theprevious patch.
This patch could fix problems that happen when a request is...
hw/kvm/arm_gic: Implement support for KVM in-kernel ARM GIC
Implement support for using the KVM in-kernel GIC for ARM.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Andreas Färber <afaerber@suse.de>