spice: add qxl device
qxl is a paravirtual graphics card. The qxl device is the bridgebetween the guest and the spice server (aka libspice-server). Thespice server will send the rendering commands to the spice client, whichwill actually render them....
Fix mingw32 and OpenBSD warnings
ffsl() is not universally available, so there are these warningson both mingw32 and OpenBSD:/src/qemu/hw/pcie_aer.c: In function 'pcie_aer_update_log':/src/qemu/hw/pcie_aer.c:399: warning: implicit declaration of function 'ffsl'...
migration: allow rate > 4g
I'd like to disable bandwidth limit or make it very high,Use int64_t all over to make values >= 4g work.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Tested-by: Jason Wang <jasowang@redhat.com>
vhost: Fix address calculation in vhost_dev_sync_region()
We still need advance address even we find there's no dirty pages incurrent chunk.
Signed-off-by: Jason Wang <jasowang@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Merge remote branch 'origin/master' into pci
Conflicts: Makefile.objs hw/virtio.c
Merge remote branch 'kwolf/for-anthony' into staging
ide: Reset current_addr after stopping DMA
Whenever SSBM is reset in the command register all state information is lost.Restarting DMA means that current_addr must be reset to the base address of thePRD table. The OS is not required to change the base address register before...
ide: Ignore double DMA transfer starts/stops
You can only start a DMA transfer if it's not running yet, and you can onlycancel it if it's running.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
ide: Factor ide_dma_set_inactive out
Several places that stop a DMA transfer duplicate this code. Factor it out intoa common function.
ide: Set bus master inactive on error
BMIDEA in the status register must be cleared on error. This makes FreeBSDrespond (more) correctly to I/O errors.
Add pcnet-pci.c
Add file missing from last commit.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Split out common pcnet code
The core pcnet emulation code is used by both the PCI "pcnet" deviceand the SPARC "lance" device. Split the common code frm the PCI code sothat that can be configures independantly.
scsi-disk: Remove duplicate cdb parsing
We parse the CDB twice, which is completely unnecessary.
Signed-off-by: Hannes Reinecke <hare@suse.de>Acked-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi: Move sense handling into the driver
The current sense handling in scsi-bus is only used by thescsi-disk driver; the scsi-generic driver is using its own.So we should move the current sense handling into thescsi-disk driver.
Signed-off-by: Hannes Reinecke <hare@suse.de>...
scsi: INQUIRY VPD fixes
We should announce and support the block device characterics pageonly on block devices, not on CDROMs. And the VPD page 0x83 hasan off-by-one error.
Signed-off-by: Hannes Reinecke <hare@suse.de>Acked-by: Christoph Hellwig <hch@lst.de>...
scsi: Return SAM status codes
Traditionally, the linux stack is using SCSI status codeswhich are shifted by one as compared to those defined in SAM.A SCSI emulation should naturally return the SAM defined codes,not the linux ones.So to avoid any confusion this patch modifies the existing...
scsi: Increase the number of possible devices
The SCSI parallel interface has a limit of 8 devices, butnot the SCSI stack in general. So we should be removing thehard-coded limit and use MAX_SCSI_DEVS instead.And we only need to scan those devices which are allocated...
ide: convert bmdma address ioport to ioport_register()
cmd646, via compile tested, pci lightly boot tested.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu and qemu-xen: support empty write barriers in xen_disk
This patch can be applied to both qemu-xen and qemu and adds supportfor empty write barriers to xen_disk.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
scsi-disk: Move active request asserts
SCSI read/write requests should not be re-issued before the currentfragment of I/O completes. There are asserts in scsi-disk.c that guardthis constraint but they trigger on SPARC Linux 2.4. It turns out thatthe asserts are too early in the code path and don't allow for read...
virtio: fix up VQ checks
When migration triggers before a VQ is initialized,base pa is 0 and last_used_index must be 0 too:we don't have a ring to compare to.
Reported-by: Juan Quintela <quintela@redhat.com>Tested-by: Juan Quintela <quintela@redhat.com>...
virtio: Convert fprintf() to error_report()
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>(cherry picked from commit cd92f4cc22fbe12a7bf60c9430731f768dc1537c)
pci: fix bus walk under secondary bus reset
Take into account secondary bus reset bit forbus walk: devices behind a reset bus should notrespond to configuration cycles.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: Automatically patch PCI vendor id and device id in PCI ROM
PCI devices with different vendor or device ids sometimes sharethe same rom code. Only the ids and the checksumdiffers in a boot rom for such devices.
The i825xx ethernet controller family is a typical example...
eepro100: Use a single rom file for all i825xx devices
Patching the rom data during load (in qemu) nowalso supports i82801 (which had no rom file).
We only need a single rom file for the whole device family,so remove the second one which is no longer needed....
qbus: add functions to walk both devices and busses
There are some cases where you want to walk the busses, in particular, whensearching for a bus either by name or DeviceInfo.Paolo suggested that we model the return values on how GCC's walkers work which...
qdev: reset qdev along with qdev tree
This patch changes the reset handling so that qdev has no knowledge of theglobal system reset. Instead, a new bus/device level function is introducedthat allows all devices/buses on the bus/device to be reset using a depth...
qdev: introduce reset call back for qbus level
and make it called via qbus_reset_all().The qbus reset callback will be used by pci bus reset.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
qdev: trigger reset from a given device
Introduce a helper function which triggers reset from a given device.Will be used by pci bus emulation.
pci: use qdev reset framework for pci bus reset
pci bridge: implement secondary bus reset
Trigger secondary bus reset when secondary bus reset bitvalue changes from 0 to 1.
pci: add W1C bits to pci status register
This patch adds W1C bit support in the initialization/reset of pcistatus registers.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pcie_regs.h: more constants
Add constants for PCI AER log.
pcie/aer: helper functions for pcie aer capability
This patch implements helper functions for pcie aer capabilitywhich will be used later.
pcie_aer: get rid of recursion
Added some TODOs: they are trivial but omitted hereto make the patch logic as transparent as possible.
pcie_aer: complete unwinding recursion
Open-code functions created in the previous patch,to make code more compact and clear.Detcted and documented what looks like a bug in codethat becomes apparent from this refactoring.
ioh3420: support aer
Add aer support.
x3130/upstream: support aer
add aer support.
x3130/downstream: support aer.
pci: fix bridge control bit wmask
Bits 12 to 15 in bridge control register are reserver and must beread-only zero, curent mask is 0xffff which makes them writeable. Fixthis up by using symbolic bit names for writeable bits instead of ahardcoded constant....
pcie/port: fix bridge control register wmask
pci generic layer initialized wmask for bridge control registeraccording to pci spec. pcie deviates slightly from it,so initialize it properly.
pci: Replace unneeded type casts in calls of pci_register_bar
There is no need for these type casts (as other existingcode shows). So re-write the first argument withouttype cast (and remove a related TODO comment).
Cc: Michael S. Tsirkin <mst@redhat.com>...
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-net: Convert fprintf() to error_report()
virtio-pci: Convert fprintf() to error_report()
pc: disable the BOCHS BIOS panic port
We have an OS which writes to port 0x400 when probing for special hardware.This causes an exit of the VM. With SeaBIOS this port isn't used anyway.
Signed-off-by: Alexander Graf <agraf@suse.de>Reviewed-By: Paolo Bonzini <pbonzini@redhat.com>...
pc: add 0.13 pc machine type
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtfs: enable MSI-X
This patch enables MSI-X for virtfs-9p-pci. It also adds acompat property to pc-0.13 which turns it of there to staycompatible to 0.13-stable.
piix4 acpi: convert io BAR to type-safe ioport callbacks
Acked-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pcnet: Do not receive external frames in loopback mode
While not explicitly stated in the spec, it was observed on real systemsthat enabling loopback testing on the pcnet controller disablesreception of external frames. And some legacy software relies on it, so...
vgabios update: handle compatibility with older qemu versions
As pointed out by avi the vgabios update is guest-visible and thus hasmigration implications.
One change is that the vga has a valid pci rom bar now. We already havea pci bus property to enable/disable the rom bar and we'll load the bios...
virtio-blk: Convert fprintf() to error_report()
Errors should be logged using error_report() so they go to theappropriate monitor.
Out off array access in usb-net
Properly check array bounds before accessing array element.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add missing braces
This patch adds missing braces around if/else statements that callmacros which are likely to result in errors if the macro ischanged. It also makes the code comply better with CODING_STYLE.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
pc: e820 qemu_cfg tables need to be packed
We can't let the compiler define the alignment for qemu_cfg data.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: Fix e820 fw_cfg for big endian
apic: Don't iterate past last used apic
local_apics are allocated sequentially and never removed, sowe can stop any iterations that go to MAX_APICS as soon as wehit the first NULL. Looking at a small guest running a virtio-networkload with oprofile, this drops apic_get_delivery_bitmask()...
multiboot: Prevent loading of x86_64 images
A via -kernel supplied x86_64 ELF image is being started in 32bit mode.Detect and exit if a 64bit image has been supplied.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Acked-by: Alexander Graf <agraf@suse.de>...
e1000: Fix TCP checksum overflow with TSO
When adding the length to the pseudo header, we're not properlyaccounting for overflow.
From: Mark Wu <dwu@redhat.com>Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
PCI: Bus number from the bridge, not the device
pcibus_dev_print() was erroneously retrieving the device busnumber from the secondary bus number offset of the deviceinstead of the bridge above the device. This ends of landingin the 2nd byte of the 3rd BAR for devices, which thankfully...
pci: allow hotplug removal of cold-plugged devices
This patch fixes hot unplug of cold plugged devices(those present at system start), which got broken by5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 .
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
switch stdvga to pci vgabios
Make stdvga provide the new vgabios binary (with pcibios support)using the PCI option rom bar. Seabios will happily load it fromthere. The new vga bios will also lookup the framebuffer addressin pci config space, so the magic bochs lfb @ 0xe0000000 is not...
switch vmware_vga to pci vgabios
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
more stdvga cleanups.
video.x is gone now. It was the only user of thevga bios_offset + bios_size logic. Zap it.
intel-hda: fix codec addressing.
The HDA bus supports up to 15 codecs, with addresses 0 ... 14.We get that wrong in two places:
Revert "intel-hda: fix codec addressing."
Misses braces
This reverts commit acc086837e49b44f15eff6007bb1726844df7aec.
hda-audio: exit cleanup
Add exit callback to the driver. Unregister the sound card properlyon exit.
[ v2: codestyle: add braces ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: malc <av1474@comtv.ru>
intel-hda: Honor WAKEEN bits.
HDA: Honor WAKEEN bits when deciding to raise an interrupt on codecstatus change. This prevents an interrupt storm with the Haiku HDAdriver which does not handle codec status changes in the irq handler.
Signed-off-by: François Revol <revol@free.fr>...
intel-hda: update irq status on WAKEEN changes.
When the guest updates the WAKEEN register wemust re-calculate the IRQ status.
intel-hda: add msi support
This patch adds MSI support to the intel hda audio driver. It isenabled by default, use '-device intel-hda,msi=0' to disable it.
intel-hda: exit cleanup
Add pci exit callback for the intel-hda device and cleanup properly.Also add an exit callback to the HDA bus implementation and make sureit is called on qdev_free().
ide: Handle immediate bdrv_aio_flush failure
If bdrv_aio_flush returns NULL, this should be treated as an error.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: Handle immediate flush failure properly
Fix virtio-blk to use the usual completion path that involves werror handlinginstead of directly completing the request in cases where bdrv_aio_flushreturns NULL.
scsi-disk: Fix immediate failure of bdrv_aio_*
Fix scsi-disk to use the usual completion paths that involve rerror/werrorhandling instead of directly completing the requests in cases wherebdrv_aio_readv/writev returns NULL.
scsi-disk: Implement rerror option
This implements the rerror option for SCSI disks.
It also includes minor changes to the write path where the same code is usedthat was criticized in the review for the changes to the read path required forrerror support....
scsi-disk: Complete failed requests in scsi_disk_emulate_command
This pulls the request completion for error cases from the caller toscsi_disk_emulate_command. This should not change semantics, but allows toreuse scsi_handle_write_error() for flushes in the next patch....
scsi-disk: Implement werror for flushes
Merge remote branch 'mst/for_anthony' into staging
hda-audio: Zap tabs
Signed-off-by: malc <av1474@comtv.ru>
Add Intel HD Audio support to qemu.
This patch adds three devices to qemu:
intel-hda Intel HD Audio Controller, the PCI device. Provides a HDA bus. Emulates ICH6 at the moment. Adding a ICH9 PCIE variant shouldn't be hard.
hda-duplex HDA Codec. Attaches to the HDA bus. Supports 16bit stereo,...
add VMSTATE_BOOL
sparc32: convert debug printf statements to tracepoints
Replace debug printf statements with tracepoints.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Do not redefine reserved key-words TRUE/FALSE
TRUE/FALSE are generally reserved keywords and shouldn't be defined ina driver like this. Rename the macros to SDP_TRUE and SDP_FALSErespectively.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Mov muldiv64 to qemu-common.h (Thus unbreaking gus)
Merge branch 'pci' into for_anthony
Introduce range.h
Extract range functions from pci.h. These will be used by later patchesby non-PCI devices. Adjust current users.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>(cherry picked from commit bf1b00712375bea65f2254dea8281fa646eebbd5)
pcie: simplify range check
Simplify code slighly by reversing the polarityfor the range check
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
pcie: clean up hot plug notification
Simplify logic for hotplug notification, by tracking state of thelogical interrupt condition. We then simply use this variable to makethe interrupt decision, according to spec.
API is made cleaner as we no longer force users to pass in...
pci: improve w1c mask handling
- save/restore must not check w1c bits since they are in fact guest controlled- clear w1c bits on reset
Note: for express there are different kinds ofreset, some leave part of config space alone.We will likely need a sticky bit mask to implement this....
msi: simplify range checks
config write handlers should be idempotent.So no need for complex range checks: a simpleone checking that we are touching the relevant capabilitywill do.
msi: minor cleanups
Comment fixup (tell what it does not what it does not do),typo fix, whitespace fix.
pcie: update satus on reset
Reset never triggers a new event, so it's enough toupdate status.
virtio: sanity-check available index
Checking available index upon load instead ofonly when vm is running makes is easier todebug failures.
qemu-timer: move commonly used timer code to qemu-timer-common
Move timer init functions to a new file, qemu-timer-common.c. Make othercritical timer functions inlined to preserve performance inqemu-timer.c, also move muldiv64() (used by the inline functions)...
mips_fulong2e: fix ram allocation
RAM registration used incorrect offset.
Fix by using the offset obtained previously for this purpose.
Spotted by GCC 4.6.0 20100925 warning, which is also avoided.