aboutsummaryrefslogtreecommitdiffstats
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2010-11-27Split out common pcnet codePaul Brook2-307/+7
The core pcnet emulation code is used by both the PCI "pcnet" device and the SPARC "lance" device. Split the common code frm the PCI code so that that can be configures independantly. Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-11-21virtio-pci: Convert fprintf() to error_report()Stefan Hajnoczi1-2/+2
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21virtio-net: Convert fprintf() to error_report()Stefan Hajnoczi1-21/+20
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21virtio: Convert fprintf() to error_report()Stefan Hajnoczi1-17/+18
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21virtio-blk: Convert fprintf() to error_report()Stefan Hajnoczi1-2/+2
Errors should be logged using error_report() so they go to the appropriate monitor. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21vgabios update: handle compatibility with older qemu versionsGerd Hoffmann3-0/+26
As pointed out by avi the vgabios update is guest-visible and thus has migration implications. One change is that the vga has a valid pci rom bar now. We already have a pci bus property to enable/disable the rom bar and we'll load the bios via fw_cfg as fallback for the no-rom-bar case. So we just have to add compat properties to handle this case. A second change is that the magic bochs lfb @ 0xe0000000 is gone. When live-migrating a guest from a older qemu version it might be using the lfb though, so we have to keep it for the old machine types. The patch enables the bochs lfb in case we don't have the pci rom bar enabled (i.e. we are in 0.13+older compat mode). This patch depends on these patches which add (and use) the pc-0.13 machine type: http://patchwork.ozlabs.org/patch/70797/ http://patchwork.ozlabs.org/patch/70798/ Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Cc: avi@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21pcnet: Do not receive external frames in loopback modeJan Kiszka1-2/+3
While not explicitly stated in the spec, it was observed on real systems that enabling loopback testing on the pcnet controller disables reception of external frames. And some legacy software relies on it, so provide this behavior. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21piix4 acpi: convert io BAR to type-safe ioport callbacksAvi Kivity1-33/+22
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>
2010-11-21virtfs: enable MSI-XGerd Hoffmann2-1/+12
This patch enables MSI-X for virtfs-9p-pci. It also adds a compat property to pc-0.13 which turns it of there to stay compatible to 0.13-stable. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21pc: add 0.13 pc machine typeGerd Hoffmann1-1/+9
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-21pc: disable the BOCHS BIOS panic portBernhard Kohl1-2/+2
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> Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-16pc: Fix e820 fw_cfg for big endianAlex Williamson1-7/+7
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-16pc: e820 qemu_cfg tables need to be packedAlex Williamson1-2/+2
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>
2010-11-16Add missing bracesJes Sorensen1-5/+8
This patch adds missing braces around if/else statements that call macros which are likely to result in errors if the macro is changed. It also makes the code comply better with CODING_STYLE. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-16Out off array access in usb-netGleb Natapov1-1/+1
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>
2010-11-16multiboot: Prevent loading of x86_64 imagesAdam Lackorzynski1-0/+6
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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-16apic: Don't iterate past last used apicAlex Williamson1-0/+4
local_apics are allocated sequentially and never removed, so we can stop any iterations that go to MAX_APICS as soon as we hit the first NULL. Looking at a small guest running a virtio-net workload with oprofile, this drops apic_get_delivery_bitmask() from #3 in the profile to down in the noise. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-11-16pci: allow hotplug removal of cold-plugged devicesMichael S. Tsirkin4-12/+32
This patch fixes hot unplug of cold plugged devices (those present at system start), which got broken by 5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 . Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Cam Macdonell <cam@cs.ualberta.ca> Tested-by: Cam Macdonell <cam@cs.ualberta.ca> Reported-by: Cam Macdonell <cam@cs.ualberta.ca>.
2010-11-16PCI: Bus number from the bridge, not the deviceAlex Williamson1-2/+1
pcibus_dev_print() was erroneously retrieving the device bus number from the secondary bus number offset of the device instead of the bridge above the device. This ends of landing in the 2nd byte of the 3rd BAR for devices, which thankfully is usually zero. Note: pcibus_get_dev_path() copied this code, inheriting the same bug. pcibus_get_dev_path() is used for ramblock naming, so changing it can effect migration. However, I've only seen this byte be non-zero for an assigned device, which can't migrate anyway, so hopefully we won't run into any issues. This patch does not touch pcibus_get_dev_path, as bus number is guest assigned for nested buses, so using it for migration is broken anyway. Fix it properly later. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-16e1000: Fix TCP checksum overflow with TSOAlex Williamson1-1/+4
When adding the length to the pseudo header, we're not properly accounting 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>
2010-11-16more stdvga cleanups.Gerd Hoffmann10-46/+15
video.x is gone now. It was the only user of the vga bios_offset + bios_size logic. Zap it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-11-16switch vmware_vga to pci vgabiosGerd Hoffmann1-6/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-11-16switch stdvga to pci vgabiosGerd Hoffmann1-4/+3
Make stdvga provide the new vgabios binary (with pcibios support) using the PCI option rom bar. Seabios will happily load it from there. The new vga bios will also lookup the framebuffer address in pci config space, so the magic bochs lfb @ 0xe0000000 is not needed any more -> zap it. Without the patch: # dmesg | grep framebuffer vesafb: framebuffer at 0xe0000000, mapped to 0xf7e80000, using 1875k, total 8192k # lspci -vs2 00:02.0 VGA compatible controller: Technical Corp. Device 1111 (prog-if 00 [VGA controller]) Subsystem: Qumranet, Inc. Device 1100 Physical Slot: 2 Flags: fast devsel Memory at f0000000 (32-bit, prefetchable) [size=8M] Expansion ROM at <unassigned> [disabled] With patch applied: # dmesg | grep framebuffer vesafb: framebuffer at 0xf0000000, mapped to 0xf7e80000, using 1875k, total 8192k # lspci -vs2 00:02.0 VGA compatible controller: Technical Corp. Device 1111 (prog-if 00 [VGA controller]) Subsystem: Qumranet, Inc. Device 1100 Physical Slot: 2 Flags: fast devsel Memory at f0000000 (32-bit, prefetchable) [size=8M] Expansion ROM at f0800000 [disabled] [size=64K] cheers, Gerd Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-11-09intel-hda: fix codec addressing.Gerd Hoffmann1-4/+5
The HDA bus supports up to 15 codecs, with addresses 0 ... 14. We get that wrong in two places: * When handing out addresses we accept address 15 as valid. * The bitmasks for two registers (WAKEEN and STATESTS) don't have bit 14 set. This patch fixes it. [ v2: codestyle: add braces ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-09Revert "intel-hda: fix codec addressing."malc1-4/+4
Misses braces This reverts commit acc086837e49b44f15eff6007bb1726844df7aec.
2010-11-09intel-hda: fix codec addressing.Gerd Hoffmann1-4/+4
The HDA bus supports up to 15 codecs, with addresses 0 ... 14. We get that wrong in two places: * When handing out addresses we accept address 15 as valid. * The bitmasks for two registers (WAKEEN and STATESTS) don't have bit 14 set. This patch fixes it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-09intel-hda: add msi supportGerd Hoffmann1-2/+31
This patch adds MSI support to the intel hda audio driver. It is enabled by default, use '-device intel-hda,msi=0' to disable it. [ v2: codestyle: add braces ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-09intel-hda: update irq status on WAKEEN changes.Gerd Hoffmann1-0/+6
When the guest updates the WAKEEN register we must re-calculate the IRQ status. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-09intel-hda: Honor WAKEEN bits.François Revol1-1/+2
HDA: Honor WAKEEN bits when deciding to raise an interrupt on codec status change. This prevents an interrupt storm with the Haiku HDA driver which does not handle codec status changes in the irq handler. Signed-off-by: François Revol <revol@free.fr> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-09hda-audio: exit cleanupGerd Hoffmann1-0/+24
Add exit callback to the driver. Unregister the sound card properly on exit. [ v2: codestyle: add braces ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-09intel-hda: exit cleanupGerd Hoffmann2-0/+21
Add pci exit callback for the intel-hda device and cleanup properly. Also add an exit callback to the HDA bus implementation and make sure it is called on qdev_free(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-04scsi-disk: Fix immediate failure of bdrv_aio_*Kevin Wolf1-5/+6
Fix scsi-disk to use the usual completion paths that involve rerror/werror handling instead of directly completing the requests in cases where bdrv_aio_readv/writev returns NULL. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-11-04virtio-blk: Handle immediate flush failure properlyKevin Wolf1-1/+1
Fix virtio-blk to use the usual completion path that involves werror handling instead of directly completing the request in cases where bdrv_aio_flush returns NULL. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-11-04ide: Handle immediate bdrv_aio_flush failureKevin Wolf1-3/+9
If bdrv_aio_flush returns NULL, this should be treated as an error. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-11-04scsi-disk: Implement werror for flushesKevin Wolf1-1/+16
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2010-11-04scsi-disk: Complete failed requests in scsi_disk_emulate_commandKevin Wolf1-11/+10
This pulls the request completion for error cases from the caller to scsi_disk_emulate_command. This should not change semantics, but allows to reuse scsi_handle_write_error() for flushes in the next patch. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2010-11-04scsi-disk: Implement rerror optionKevin Wolf1-34/+66
This implements the rerror option for SCSI disks. It also includes minor changes to the write path where the same code is used that was criticized in the review for the changes to the read path required for rerror support. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2010-11-01Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori25-275/+2610
2010-11-01hda-audio: Zap tabsmalc1-2/+2
Signed-off-by: malc <av1474@comtv.ru>
2010-11-01Add Intel HD Audio support to qemu.Gerd Hoffmann5-0/+2933
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, rates 16k -> 96k, playback, recording and volume control (with CONFIG_MIXEMU=y). hda-output HDA Codec without recording support. Subset of the hda-duplex codec. Use this if you don't want your guests access your mic. Usage: add '-device intel-hda -device hda-duplex' to your command line. Tested guests: * Linux works. * Win7 works. * DOS (mpxplay) works. * WinXP doesn't work. [ v2 changes ] * Fixed endianess, big endian hosts work now. * Fixed some emulation bugs. * Added immediate command emulation. * Added vmstate support. * Make it behave like all other sound card drivers: - can be configured via '--audio-card-list=hda' - can be added to a VM using '-soundhw hda' * Code style fixups. * Zapped guest-triggerable asserts. * Handle partial reads/writes of audio data correctly. Cc: malc <av1474@comtv.ru> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-11-01add VMSTATE_BOOLGerd Hoffmann1-0/+14
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2010-10-31sparc32: convert debug printf statements to tracepointsBlue Swirl9-206/+105
Replace debug printf statements with tracepoints. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Do not redefine reserved key-words TRUE/FALSEJes Sorensen1-10/+10
TRUE/FALSE are generally reserved keywords and shouldn't be defined in a driver like this. Rename the macros to SDP_TRUE and SDP_FALSE respectively. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30Mov muldiv64 to qemu-common.h (Thus unbreaking gus)malc1-1/+0
Signed-off-by: malc <av1474@comtv.ru>
2010-10-27Merge branch 'pci' into for_anthonyMichael S. Tsirkin24-275/+2599
2010-10-27pcie: update satus on resetMichael S. Tsirkin1-1/+1
Reset never triggers a new event, so it's enough to update status. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27msi: minor cleanupsMichael S. Tsirkin1-4/+3
Comment fixup (tell what it does not what it does not do), typo fix, whitespace fix. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27msi: simplify range checksMichael S. Tsirkin1-25/+20
config write handlers should be idempotent. So no need for complex range checks: a simple one checking that we are touching the relevant capability will do. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27pci: improve w1c mask handlingMichael S. Tsirkin1-2/+4
- 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 of reset, some leave part of config space alone. We will likely need a sticky bit mask to implement this. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27pcie: clean up hot plug notificationMichael S. Tsirkin4-71/+62
Simplify logic for hotplug notification, by tracking state of the logical interrupt condition. We then simply use this variable to make the interrupt decision, according to spec. API is made cleaner as we no longer force users to pass in old slot control value. Includes fixes by Isaku Yamahata. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>