vfio-pci: Add extra debugging
Often when debugging it's useful to be able to disable bypass pathsso no interactions with the device are missed. Add some extra debugoptions to do this. Also add device info on read/write BAR accesses,which is useful when debugging more than one assigned device. A...
qemu vfio-pci: Graphics device quirks
Graphics cards have a number of different backdoors. Some of theseare alternative ways to get PCI BAR addresses, some of them arecomplete mirrors of PCI config space available through MMIO andI/O port access. These quirks cover a number of ATI Radeon and...
qemu vfio-pci: Add support for VGA MMIO and I/O port access
Most VGA cards need some kind of quirk to fully operate since theyhide backdoors to get to other registers outside of PCI config spacewithin the registers, but this provides the base infrastructure. If...
vfio-pci: Generalize PCI config mangling
Kernel-side vfio virtualizes all of config space, but some parts areunique to Qemu. For instance we may or may not expose the ROM BAR,Qemu manages MSI/MSIX, and Qemu manages the multi-function bit so thatsingle function devices can appear as multi-function and vica versa....
vfio-pci: Add PCIe capability mangling based on bus type
Windows seems to pay particular interest to the PCIe header type ofdevices and will fail to load drivers if we attach Endpoint devices orLegacy Endpoint devices to the Root Complex. We can usepci_bus_is_express and pci_bus_is_root to determine the bus type and...
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
sysbus: make SysBusDeviceClass::init optional
Make the SysBusDeviceClass::init optional, for devices whichgenuinely don't need to do anything here. In particular, simpledevices which can do all their initialization in theirinstance_init method don't need either a DeviceClass::realize...
musicpal: qdevify musicpal-misc
Make musicpal-misc into its own (trivial) qdev device, so wecan get rid of the abuse of sysbus_add_memory().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
milkymist-minimac2: Just expose buffers as a sysbus mmio region
Just expose the register buffers memory as a standard sysbus mmioregion which the creator of the device can map, rather thanproviding a qdev property which the creator has to set to thebase address and then doing the mapping in the device's own...
milkymist-softusb: Don't map RAM memory regions in the device itself
Don't map the pmem and dmem RAM memory regions in the milkymist-softusbdevice itself. Instead just expose them as sysbus mmio regions whichthe device creator can map appropriately. This allows us to drop the...
hw/milkymist-softusb: set buffer in softusb_read_{dmem, pmem} error path
Make sure we set the buffer to something in the softusb_read_{dmem,pmem}error paths, since the caller will use the buffer unconditionally.(Newer gcc is smart enough to spot this and complain about 'may be...
sysbus: Remove sysbus_add_memory and sysbus_del_memory
Remove the sysbus_add_memory and sysbus_del_memory functions. Theseare trivial wrappers for mapping a memory region into the systemmemory space, and have no users now. Sysbus devices should never map...
piix_pci: Use DEVICE and ISA_BUS()
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Tested-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Message-id: 1361580039-4459-3-git-send-email-dwmw2@infradead.org...
piix_pci: Fix C99 comments
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Tested-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Message-id: 1361580039-4459-4-git-send-email-dwmw2@infradead.org...
piix_pci: Clean up i440FX object handling
Define and use I440FX_PCI_DEVICE() instead of using DO_UPCAST().
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Tested-by: Laszlo Ersek <lersek@redhat.com>...
virtio-balloon: add the virtio-balloon device.
Create virtio-balloon which extends virtio-device, so it can be connected onvirtio-bus.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
virtio-balloon-pci: switch to the new API.
Here the virtio-balloon-pci is modified for the new API. The devicevirtio-balloon-pci extends virtio-pci. It creates and connects avirtio-balloon during the init. The properties are not changed.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>...
virtio-balloon-ccw: switch to the new API.
Here the virtio-balloon-ccw is modified for the new API. The devicevirtio-balloon-ccw extends virtio-ccw-device as before. It creates andconnects a virtio-balloon during the init. The properties are not modified....
virtio-balloon: cleanup: init and exit function.
This remove old init and exit function as they are no longer needed.
virtio-balloon: cleanup: QOM casts.
As the virtio-balloon-pci is switched to the new API, we can use QOMcasts.
virtio-balloon: cleanup: remove qdev field.
The qdev field is no longer needed, just drop it.
hw/tcx: Remove unused 'addr' field and the property that sets it
Remove the 'addr' field from TCXState (since it is completely unused),also the qdev property which sets it. This seems to be a relic frommany years past; devices don't need to know where they are mapped....
hw/i386/pc: format load_linux function
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
virtio-serial: Consolidate guest_open/guest_close into set_guest_connected
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-10-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-serial: propagate guest_connected to the port on post_load
When migrating a host with with a spice agent running the mouse becomesnon operational after the migration due to the agent state beinginconsistent between the guest and the client.
After migration the spicevmc backend on the destination has never been notified...
qemu-char: Automatically do fe_open / fe_close on qemu_chr_add_handlers
Most frontends can't really determine if the guest actually has the frontendside open. So lets automatically generate fe_open / fe_close as soon as afrontend becomes ready (as signalled by calling qemu_chr_add_handlers) /...
qemu-char: Cleanup: consolidate fe_open/fe_close into fe_set_open
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-6-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Move incrementing of avail_connections to qdev-properties-system
The decrement of avail_connections is done in qdev-properties-system movethe increment there too for proper balancing of the calls.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
qemu-char: Rename opened to be_open
Rename the opened variable to be_open to reflect that it contains theopened state of the backend.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-2-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
virtio,pci,qom
Work by Alex to support VGA assignment,pci and virtio fixes by Stefan, Jason and myself, and anew qmp event for hotplug support by myself.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
pcie: Add endpoint capability initialization wrapper
Fix the awkward API of mangling the caller specified PCIe type andjust provide an interface to initialize an endpoint device. Thiswill pick either a regular endpoint or integrated endpoint based onthe bus and return pcie_cap_init to doing exactly what is asked....
pci: Create and register a new PCI Express TypeInfo
This will allow us to differentiate Express and Legacy buses.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: Move PCI and PCIE type defines
Move these so that we can reference them from a more common headerinstead of including pci_bus.h everywhere.
pci: Allow PCI bus creation interfaces to specify the type of bus
No change to any types.
pci: Q35, Root Ports, and Switches create PCI Express buses
Convert q35, ioh3420, xio3130_upstream, and xio3130_downstream touse the new TYPE_PCIE_BUS.
pci: Create pci_bus_is_express helper
For testing the bus type.
pci: Create and use API to determine root buses
pcie: Mangle types to match topology
Windows will fail to start drivers for devices with an Endpoint typePCIe capability attached to a Root Complex (code 10 - Device cannotstart). The proper type for such a device is Root Complex IntegratedEndpoint. Devices don't care which they are, so do this conversion...
pci: Teach PCI Bridges about VGA routing
Each PCI Bridge has a set of implied VGA regions that are enabled whenthe VGA bit is set in the bridge control register. This allows VGAdevices behind bridges. Unfortunately with VGA Enable, which weformerly allowed but didn't back, comes along some required VGA...
pci_bridge: factor out common code
Reuse common code in pcie_port, override the hardwired-to-0bits per PCI Express spec.No functional change but makes the code easier to follow.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci_bridge: drop formatting from source
We use the same formatting for all files, itdoesn't make sense to have formatting directives onlyin pci bridge header.
pci: Fix INTx routing notifier recursion
For some reason we recurse to fire the INTx routing notifier for eachchild of a bus, for each possible device of a bus. That means that ifwe add a root port, the notifier gets called for that bridge 256times. If we add an upstream switch behind that root port, 256^2. But...
pci_bridge: Use a default map_irq function
The PCI bridge spec defines a default swizzle for translating INTxIRQs from secondary bus to primary. Use this by default for anybridge that doesn't set a function.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
pci_bridge: Remove duplicate IRQ swizzle function
pci_bridge_dev_map_irq_fn() is identical to pci_swizzle_map_irq_fn(),which is now the default for all PCI bridges. We can therefore removethis function and the pci_bridge_map_irq() call that used it.
pci: refuse empty ROM files
A zero size ROM file is invalid and should produce a warning.Attempting to use a zero size file ends up hitting an assertionqemu_ram_set_idstr() because RAMBlocks with duplicate addresses areallocated - due to zero size the allocator doesn't increment the next...
qmp: add path to device_deleted event
Add QOM path to device deleted event. It now becomes useful to reportit for devices which don't have an ID assigned.
virtio-net: remove layout assumptions for mq ctrl
Following commit 921ac5d0f3a0df869db5ce4edf752f51d8b1596a (virtio-net:remove layout assumptions for ctrl vq), this patch makes multiqueue ctrlhandling not rely on the layout of descriptors.
Signed-off-by: Jason Wang <jasowang@redhat.com>...
virtio-pci: guest notifier mask without non-irqfd
non-irqfd setups are currently broken with vhost:we start up masked and nothing unmasks the interrupts.Fix by using mask notifiers, same as the irqfd path.
Sharing irqchip/non irqchip code is always a good thing,...
pci: Add PCI VGA helpers
Allow devices to register VGA memory regions for handling PCI specdefined VGA I/O port and MMIO areas. PCI will attach these to thebus address spaces and enable them according to the device commandregister value.
Merge remote-tracking branch 'quintela/migration.next' into staging
virtio-ccw: Queue sanity check for notify hypercall.
Verify that the virtio-ccw notify hypercall passed a reasonablevalue for queue.
Cc: qemu-stable@nongnu.orgReported-by: Alexander Graf <agraf@suse.de>Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/qdev: Abort rather than ignoring errors adding device properties
Instead of ignoring any errors that occur when adding propertiesto a new device in device_initfn(), check for them and abort if anyoccur. The most likely cause is accidentally adding a duplicate...
hw/qdev-properties.c: Improve diagnostic for setting property after realize
Now we have error_setg() we can improve the error message emitted ifyou attempt to set a property of a device after the device is realized(the previous message was "permission denied" which was not very...
virtio-scsi: add the virtio-scsi device.
Create virtio-scsi which extends virtio-device, so it can be connected onvirtio-bus.
virtio-scsi-pci: switch to new API.
Here the virtio-scsi-pci is modified for the new API. The device virtio-scsi-pciextends virtio-pci. It creates and connects a virtio-scsi during the init.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>...
virtio-scsi-s390: switch to the new API.
Here the virtio-scsi-s390 is modified for the new API. The devicevirtio-scsi-s390 extends virtio-s390-device as before. It creates andconnects a virtio-scsi during the init. The properties are not modified.
virtio-scsi-ccw: switch to new API
Here the virtio-scsi-ccw is modified for the new API. The devicevirtio-scsi-ccw extends virtio-ccw-device as before. It creates andconnects a virtio-scsi during the init. The properties are not modified.
virtio-scsi: cleanup: use QOM casts.
As the virtio-scsi-pci and virtio-scsi-s390 are switched to the new API,we can use QOM casts.
virtio-scsi: cleanup: init and exit functions.
virtio-scsi: cleanup: remove qdev field.
The qdev field is no longer needed. Just drop it.
virtio-scsi: moving host_features from properties to transport properties.
host_features field is part of the transport device. So move all thehost_features related properties into transport device.
virtio-scsi: don't use pointer for configuration.
The configuration field must not be a pointer as it will be used for virtio-scsiproperties. So *conf is replaced by conf.
virtio-scsi: allocate cmd_vqs array separately.
Allocate/Free the cmd_vqs array separately to have a fixed size device.
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
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.
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.
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.
console: stop using DisplayState in gfx hardware emulation
Use QemuConsole instead. Updates interfaces in console.[ch] and adaptsgfx hardware emulation code.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>