aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)Author
2009-12-19Multiboot support: Fix rom_copyKevin Wolf
ROMs need to be loaded if they are anywhere in the requested area, not only at the very beginning. This fixes Multiboot with ELF kernels that have more than one program header. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 935effc2bbd2c441b755a8d280811a9763fdb98c)
2009-12-19roms: allow roms to be loaded at address 0Aurelien Jarno
It was possible to load roms at address 0, but commit 632cf034b401cdd01dae253a8b577fe518e37654 started to forbid that, which broke at least ARM versatile. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit f9e69bd9cfe2247b1fb5dc56d3a28baf36ce8384)
2009-12-19e1000: Don't muck with PCI commmand registerAnthony Liguori
Otherwise, the driver does not work in Linux after the INT_DISABLE changes in PCI. Michael Tsirkin had a patch to do this, I'm not sure what happened to it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 17a7a5c59c4d72dd1d5666f348b010be6b10163c)
2009-12-19roms: remove option rom packing logicGerd Hoffmann
Now that we load the option roms via fw_cfg, we can stop copying them to the 0xc000 -> 0xe000. The patch does just that. Also the rom loader gets simplified as all remaining users of the rom loader load the bits at a fixed address so the packing and aligning logic can go away. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 632cf034b401cdd01dae253a8b577fe518e37654)
2009-12-19roms: use new fw_cfg file xfer support.Gerd Hoffmann
roms: use fw_cfg for vgabios and option rom loading, additionally to deploying them the traditional way (copy to 0xc0000 -> 0xe0000 range). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 379526a40e855b0da3c5718063a7d992aa5a79a1)
2009-12-19fw_cfg: add API for file transfer.Gerd Hoffmann
This patch adds a file transfer interface to fw_cfg. Intended to be used for passing non-pci option roms and vgabios to seabios. Namespace is modeled after the existing cbfs filesystem support in seabios. Reading the new FW_CFG_FILE_DIR entry returns a file list. Fields there are in network byte order (aka bigendian). aliguori: fix fw_cfg.h for multiboot.bin, add proper fw_cfg.h declarations, quiet fprintf() in fw_cfg.c Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit abe147e0ce41c07e789f6627bcb01c905d1f9bbf)
2009-12-19fw_cfg: make calls typesafeGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit c2b5bda43a1c87147fadc78d5590b1465b850816)
2009-12-19pci romfiles: add property, add default to PCIDeviceInfoGerd Hoffmann
This patch adds a romfile property to the pci bus. It allows to specify a romfile to load into the rom bar of the pci device. The default value comes from a new field in PCIDeviceInfo. The property allows to change the file and also to disable the rom loading using an empty string. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 8c52c8f320b27684ec3b1a649925b75af376b1f7)
2009-12-19Support PCI based option rom loadingAnthony Liguori
Currently, we preload option roms into the option rom space in memory. This prevents DDIM from functioning correctly which severely limits the number of roms we can support. This patch introduces a pci_add_option_rom() which registers the PCI_ROM_ADDRESS bar which points to our option rom. It also converts over the cirrus vga adapter, the rtl8139, virtio, and the e1000 to use this new mechanism. The result is that PXE boot functions even with three unique types of cards. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit c2039bd0ffce8807e0eaac55254fde790825fa92)
2009-12-19Fix backcompat for hotplug of SCSI controllersDaniel P. Berrange
SCSI controllers have no trouble existing without any attached disks. This could be achieved with the (legacy) monitor syntax pci_add pci_addr=auto storage if=scsi This is now denied with scsi requires a backing file/device. failed to add if=scsi There is no need for this denial and it breaks compatability with existing QEMU usage, so remove the check for presence of a drive. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit ec7efac4a967c650ae1cd8cebe28e7c69cbe3864)
2009-12-19fdc: fix migration from 0.11Juan Quintela
0.11 uses as instance ide io_base, get it back Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 47f5ba724871622c7db7a73fd05d6b3646478dd6)
2009-12-19Revert "fdc: fix vmstate variable passed"Juan Quintela
Floppy used the io_base address to register savevm region. This reverts commit 2966b390d0f7cd5e5b971290fcc20685de374228. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit aef30c3c6a3165178584eb125f64defd8173eebd)
2009-12-19vmware: increase cursor buffer size.Dave Airlie
The cursor pixmap size we calculate later ends up being 4096 dwords long by the looks of it. This boots an F12 LiveCD now. Signed-off-by: Dave Airlie <airlied@linux.ie> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 8095cb3ed22d74649fd247efb9518459eae4d92e)
2009-12-19VMware VGA: Only enable dirty log tracking when fifo is disabledAnthony Liguori
This patch enables dirty log tracking whenever it's needed and disables it when it is not. We unconditionally enable dirty log tracking on reset, restart dirty log tracking when PCI IO regions are remapped, and disable/enable it based on commands from the guest. Rebased-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit b5cc6e32baa9d98d50debe23229b303f89fe84f1)
2009-12-19Fix VMware VGA depth computationAnthony Liguori
VMware VGA requires that the depth presented to the guest is the same as the DisplaySurface that it renders to. This is because it performs a very simple memcpy() to blit from one surface to another. We currently hardcode a 24-bit depth. The surface allocator for SDL may, and usually will, allocate a surface with a different depth causing screen corruption. This changes the code to allocate the DisplaySurface before initializing the device which allows the depth of the DisplaySurface to be used instead of hardcoding something. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit a6109ff1b5d7184a9d490c4ff94f175940232ebd)
2009-12-19Make sure to enable dirty log tracking for VMware VGAAnthony Liguori
This is needed for VMware VGA to work properly under KVM. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit ee3e41a9a0194af21d0da75f5afd87bea3738cf3)
2009-12-19Make sure to enable dirty tracking of VBE vram mappingAnthony Liguori
Apparently, VBE maps the VGA vram to a fixed physical location. KVM requires that all mappings of the VGA vram have dirty tracking enabled on them. Any access to the VGA vram through the VBE mapping currently fails to result in dirty page tracking updates causing a black screen. This is the true root cause of VMware VGA not working correctly under KVM and likely also an issue with some of the std-vga black screen issues too. Cirrus does not enable VBE so it would not be a problem when using Cirrus. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Rebased-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit f0138a63a41fe26bcef61d031ae53d872d12a992)
2009-12-19vmware: setup PCI BAR 2 for FIFO as per vmware specDave Airlie
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit f351d050dccfc469fecd353d095526d52e4632c6)
2009-12-19qdev: improve property error reporting.Gerd Hoffmann
Add a error message in case we fail to parse a qdev property. Also make qemu not abort() in case setting a global property can't be set. This used to be a clear programming error. The introduction of the -global switch changed that though, so better exit instead (after printing the new error message). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 9ef5c4bf8132eb72db2dd83fce3fa0005a6dd13f)
2009-12-19usb-net: use qdev for -usbdeviceGerd Hoffmann
Rebased to master, adapted to device renaming by armbru, no other changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 42be86ce95db944910005aa981a8e9ae5e01b05a)
2009-12-19Check rom_load_all() return value.Gerd Hoffmann
Check rom_load_all() return value. Also don't make option rom loading failure fatal. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 15ff7705444ab9663189946d6d648431e0649df1)
2009-12-19defaults: split default_driveGerd Hoffmann
Split default_drive into default_{floppy,cdrom,sdcard}. Also add QEMUMachine flags to disable them per machine. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit ac33f8fad14e07fa12b74c3494339ae6882dc22f)
2009-12-19qdev: Improve uni-north device namesMarkus Armbruster
Switch to the names suggested by Blue Swirl. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 18dd19a7d9bb90734b5188fd6f53c76bde711e4b)
2009-12-19Fix loading of ELF multiboot kernelsKevin Wolf
The multiboot implementation assumed that there is only one program header (which contains the entry point) and that the entry point is at the start of the code. This doesn't hold true generally and caused too little data to be loaded. Fix the loading code to pass the whole loaded data to the Multiboot Option ROM. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 092493be3caab1ac77f4223b4c3fb0975d1ed490)
2009-12-19Revert "pci: interrupt disable bit support"Anthony Liguori
This reverts commit 0ea5709a32085f7d14901a09d12bd35f9b267607. Per discussion with Michael Tsirkin, this is too risky for 0.12 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit d587e0787153f0224a6140c5015609963ceaabfb)
2009-12-18S390: Bail out without KVMAlexander Graf
Currently only the S390 KVM target works. To keep users from accidently not using KVM, let's not even initialize the machine when KVM is not used. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit e249651ca94058547f7ae84694e82bb1ee03bc3c)
2009-12-18S390: Don't tell guest we're updating config spaceAlexander Graf
Currently we always set the "config space changed" bit to 1 when triggering any virtio interrupt. While that worked in 2.6.27, newer kernels interpret that value as "only the config space changed and nothing else happened". Since we usually trigger interrupts to tell the guest that something did happen, we just not tell it the config space changed for now until we implement the correct callback for that. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 86f3dba6518bd5fd106e1cf3f36dafda41ff377b)
2009-12-18S390: Loop through virtio console devicesAlexander Graf
We used to always create one single virtio console device. This breaks when either zero of multiple virtio console devices are requested, so let's use the same code as on x86. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit a1e4b07f04d8f31e8c0c1bf97385f426d3fcf5e6)
2009-12-16s390: Fix buggy assignmentStefan Weil
nd->model keeps dynamically allocated model names. So casting of a constant string is wrong here. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 5a2b3fc5aaae48859e09a8d96f4f92578b060892)
2009-12-13s390: typo fixMichael S. Tsirkin
s390 code has an obvious typo, which results in: hw/s390-virtio.c: At top level: hw/s390-virtio.c:249: error: request for member ‘no_vga’ in something not a structure or union Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13s390: fix build on 32 bit hostMichael S. Tsirkin
Building on 32 bit host we get: hw/s390-virtio.c: In function ‘s390_init’: hw/s390-virtio.c:184: error: integer constant is too large for ‘unsigned long’ type 64 bit values must be ULL. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-12PCI: Convert pci_device_hot_add() to QObjectLuiz Capitulino
Return a QDict with information about the just added device. This commit should not change user output. Please, note that this patch does not do error handling conversion. In error conditions the handler still calls monitor_printf(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 7a344f7ac7bb651d0556a933ed8060d3a9e5d949)
2009-12-12scsi: fix drive hotplug.Gerd Hoffmann
This patch fills the DriveInfo->unit after hotplugging a scsi disk. It makes a difference when auto-assigning a scsi id, where unit was left filled with '-1' instead of the actual scsi id. With this patch applied the the drive naming logic in drive_init() works as good as it did in previous releases. Which means it works fine with a single scsi bus. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 11f4d7f483d9ca3a8979abd605cf1468b3e96aa2)
2009-12-12pci: don't hw_error() when no slot is available.Gerd Hoffmann
Current PCI code will simply hw_error() and thus abort in case no free PCI slot is available or the requested PCI slot is already in use by another device. For the hotplug case this behavior is not acceptable. This patch makes qemu pass up the error properly, so the calling code can decide whenever it wants to exit with an error (on startup) or whenever it wants to continue (hotplug). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 09e3acc6cfabfd85a9dacc04471df5f05019c779)
2009-12-12pci: don't abort() when trying to hotplug with acpi off.Gerd Hoffmann
The PCI bus on x86 requires ACPI for hotplug support, thus disbling ACPI also disables hotplug for the PCI bus. This patch makes qemu check whenever the PCI bus in question can handle hotplug before trying to add devices. This is needed because qdev will abort() on any attempt to hotplug devices into a non-hotpluggable bus. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 53e0d8affe8514b070db2d265af13a534cb8eda4)
2009-12-12Set default console to virtio on S390xGerd Hoffmann
All "normal" system emulation targets in qemu I'm aware of display output on either VGA or serial output. Our S390x virtio machine doesn't have such kind of legacy hardware. So instead we need to default to a virtio console. Add flags to QEMUMachine to indicate which kind of default devices make sense for the machine in question. Use it for S390x: enable virtcon, disable serial, parallel and vga. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 986c5f78543bdbd696664447ecdd08cf6d935370)
2009-12-12qdev: also match bus name for global propertiesGerd Hoffmann
i.e. -global PCI.<property>=<value> will set a default property for all PCI devices. Also works for the compat properties used by machine types. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 07a8de3566bd576dc33e55af830d63dcc2287617)
2009-12-12qdev: make compat stuff more genericGerd Hoffmann
This patch renames the compat properties into global properties and makes them more generic. The compatibility stuff is only one of multiple possible users now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 458fb6792d834474c6b289738b6bf9601fad87ab)
2009-12-12qdev: Replace device names containing whitespaceMarkus Armbruster
Device names with whitespace require quoting in the shell and in the monitor. Some of the offenders are also overly long. Some have a more convenient alias, some don't. The place for verbose device names is DeviceInfo member desc. The name should be short & sweet. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 556cd09885bec3f69ba78228fe4e46dc1dad145b)
2009-12-12qdev: Separate USB product description from qdev nameMarkus Armbruster
Using the qdev name for the product description makes for inconvenient qdev names. Put the product description in new USBDeviceInfo member product_desc. Make usb_qdev_init() use it. No user or guest visible change, since the value is still the same. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 063846984ce7eb1c1ddce6dda39b662c64a80dc0)
2009-12-12qdev: Rename USBDevice member devname to product_descMarkus Armbruster
It's not a device name, it's the USB product description string. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 0fe6d12e0bc752c29a93ac83a274e3650d457069)
2009-12-12fix rtc-td-hack on host without high-res timersGleb Natapov
On hosts without high-res timers it is impossible to inject rtc interrupt faster then 1kHz. Windows sometimes configures RTC to generate 1kHz interrupts, so we can't inject missed interrupts when running on such hosts. Always injecting an interrupt on REG_C read is also not an option since Windows wait for REG_C to become zero with interrupt disabled during boot. This patch uses mixed approach: accelerate timer + inject up to 1000 interrupts on REG_C read. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit ba32edab7fdab0e74b54696942b4127d26861cf6)
2009-12-12virtio: verify features on loadMichael S. Tsirkin
migrating between hosts which have different features might break silently, if the migration destination does not support some features supported by source. Prevent this from happening by comparing acked feature bits with the mask supported by the device. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 6d74ca5aa83b83fb52332f7735c61ecb7a5328c1)
2009-12-12vmware_vga: add rom file so that it boots.Dave Airlie
This just adds the rom file to the vmware SVGA chipset so it boots. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit b3c3f123f785fb861d930080f083507b51f5ce79)
2009-12-07pci: interrupt disable bit supportMichael S. Tsirkin
Interrupt disable bit is mandatory in PCI spec. Implement it to make devices spec compliant. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Isaku Yamahata <yamahata@valinux.co.jp> (cherry picked from commit b6981cb57be5d66b1b7cf9009a122fb3cdd4b96b)
2009-12-07pci: interrupt status bit implementationMichael S. Tsirkin
interrupt status is a mandatory feature in PCI spec, so devices must implement it to be spec compliant. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Isaku Yamahata <yamahata@valinux.co.jp> (cherry picked from commit f9bf77dd1f838b0061172fe41709b221956da2f5)
2009-12-07pci: prepare irq code for interrupt stateMichael S. Tsirkin
This rearranges code in preparation for interrupt state implementation. Changes: - split up bus walk away from interrupt handling into a subroutine - change irq_state from an array to bitmask - verify that irq_state values are 0 or 1 on load There are no functional changes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Isaku Yamahata <yamahata@valinux.co.jp> (cherry picked from commit d036bb215e0ac1d1fd467239f1d3b7d904cac90a)
2009-12-07msix: function mask supportMichael S. Tsirkin
Function mask is a mandatory feature in MSIX spec so not implementing it is a spec violation. Implement. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 5b5cb08683b6715a2aca5314168e68ff0665912b)
2009-12-07msix: macro rename for function mask supportMichael S. Tsirkin
rename ENABLE_OFFSET -> CONTROL_OFFSET, since same byte includes function mask. This is in preparation for function mask support. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 2760952ba9610921586e7446d858e23308400391)
2009-12-05Add S390x virtio machine descriptionAlexander Graf
In order to use the new S390x virtio bus we just introduced, we also need a machine description that sets up the machine according to our PV specification. Let's add that machine description and be happy! Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>