summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2009-08-27Fix Sparse warnings: "Using plain integer as NULL pointer"Blue Swirl5-6/+6
Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27esp: fix interrupt register readBlue Swirl1-4/+9
Read of interrupt register should clear it and also sequence step and status. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Fix SDL zooming with pl110 (cf. d3ffcafe25b5966b351ea6100160c2156688f22f)Blue Swirl1-0/+3
Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27e1000.c doesn't properly emulate EERD and ICS registersBill Paul1-4/+9
Once again, the emulation of the EERD and ICS registers in e1000.c is incorrect. Nobody has noticed this before because none of the Intel-written e1000 drivers use these registers, and all of the independently written open source drivers copy Intel's example, so they don't use them either. Regardless, these registers are documented in the programmer's manuals, and their emulated behavior doesn't match the verified behavior of real hardware, so any software that does use them doesn't function correctly. -Bill Signed-off-by: Bill Paul <wpaul@windriver.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Fix VM state change handlers running out of orderMarkus Armbruster3-9/+54
When a VM state change handler changes VM state, other VM state change handlers can see the state transitions out of order. bmdma_map(), scsi_disk_init() and virtio_blk_init() install VM state change handlers to restart DMA. These handlers can vm_stop() by running into a write error on a drive with werror=stop. This throws the VM state change handler callback into disarray. Here's an example case I observed: 0. The virtual IDE drive goes south. All future writes return errors. 1. Something encounters a write error, and duly stops the VM with vm_stop(). 2. vm_stop() calls vm_state_notify(0). 3. vm_state_notify() runs the callbacks in list vm_change_state_head. It contains ide_dma_restart_cb() installed by bmdma_map(). It also contains audio_vm_change_state_handler() installed by audio_init(). 4. audio_vm_change_state_handler() stops audio stuff. 5. User continues VM with monitor command "c". This runs vm_start(). 6. vm_start() calls vm_state_notify(1). 7. vm_state_notify() runs the callbacks in vm_change_state_head. 8. ide_dma_restart_cb() happens to come first. It does its work, runs into a write error, and duly stops the VM with vm_stop(). 9. vm_stop() runs vm_state_notify(0). 10. vm_state_notify() runs the callbacks in vm_change_state_head. 11. audio_vm_change_state_handler() stops audio stuff. Which isn't running. 12. vm_stop() finishes, ide_dma_restart_cb() finishes, step 7's vm_state_notify() resumes running handlers. 13. audio_vm_change_state_handler() starts audio stuff. Oopsie. Fix this by moving the actual write from each VM state change handler into a new bottom half (suggested by Gleb Natapov). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Remove the virtio-{blk, console}-pci-0-10 device typesMark McLoughlin1-46/+11
These are now unused. However, perhaps the idea is that when we add -device, they will be useful? In that case, we should add virtio-net-pci-0-10 too. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27Remove the pc-0-10 machine typeMark McLoughlin1-50/+5
We have the pc-0.10 machine type now which does exactly the same thing. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-29Add a pc-0.11 machine type and make the pc type an aliasMark McLoughlin1-1/+2
The pc-0.11 type allows users of qemu-0.11 to use a machine type which they know will remain compatible when the upgrade to qemu-0.12. Management tools may choose to canonicalize the 'pc' machine type to 'pc-0.11' so that if the 'pc' alias changes target in future versions of qemu, the machine type used will remain compatible. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-29Add machine type aliasesMark McLoughlin1-0/+1
Add an 'alias' field to QEMUMachine and display it in the output of 'qemu -M ?' with an '(aliased to foo)' suffix. Aliases can change targets in newer versions of qemu, so management tools may choose canonicalize machine types to ensure that if a user chooses an alias, that the actual machine type used will remain compatible in future. This is intended to mimic a symlink to a machine description file. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-29qemu: msix nit: clear msix_entries_nr on errorMichael S. Tsirkin1-0/+1
I don't think it's critical to do this, but it's best to keep uninit and error recovery consistent. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-29HPET fixes for reg writesBeth Kon2-13/+8
This patch addresses the problems found by Andriy Gapon: - The code was incorrectly overwriting the high order 32 bits of the timer and hpet config registers. This didn't show up in testing because linux and windows use hpet in legacy mode, where the high order 32 bits (advertising available interrupts) of the timer config register are ignored, and the high order 32 bits of the hpet config register are reserved and unused. - The mask for level-triggered interrupts was off by a bit. (hpet doesn't currently support level-triggered interrupts). In addition, I removed some unused #defines, and corrected the ioapic interrupt values advertised. I'd set this up early in hpet development and never went back to correct it, and no bugs resulted since linux and windows use hpet in legacy mode where available interrupts are ignored. Signed-off-by: Beth Kon <eak@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Add save/restore support to the LSI logic SCSI device model.Nolan1-0/+172
This patch requires "Handle BH's queued by AIO completions in qemu_aio_flush()" to work reliably. The combination of those two patches survived 300+ migrations with heavy IO load running in the guest. Signed-off-by: Nolan Leake <nolan <at> sigbus.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Fix most warnings (errors with -Werror) when debugging is enabledBlue Swirl10-42/+43
I used the following command to enable debugging: perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * */* */*/* Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-22Fix build with DEBUG_PCI in pci_host.h enabledBlue Swirl1-5/+8
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-22isxdigit -> qemu_isxdigitChristoph Egger1-2/+2
Hi! Attached patch uses qemu_isxdigit() instead of isxdigit(). Fixes build warning on NetBSD. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632
2009-07-22Suppress a Sparse warningBlue Swirl2-1/+3
Move the export to a file used by both qdev.c and sysbus.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-22Sparc32: use hex for version numbersBlue Swirl2-2/+2
0x10000000 looks better than 268435456. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-22Sparc32: fix escc devices broken by ee6847d19be16c789b8bd4e553b7cd6701ba1245Blue Swirl1-4/+4
The logic of Zilog makes channel B the first device and channel A the second one. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-22Sparc32: fix fdc io_baseBlue Swirl1-1/+2
On some Sparc32 machines, fdc is located above 4G limit, so uint32_t is not appropriate type for io_base. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-22Fix sparc-softmmu breakage by ee6847d19be16c789b8bd4e553b7cd6701ba1245Blue Swirl1-1/+1
Move the qdev_init(dev); call after the setting of d->size. Thanks to Filip Navara. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16fix for bad macaddr of e1000 in Windows 2003 server with original MS driverNaphtali Sprei1-0/+5
The sequence of reading from eeprom is "offset by one" moved because of a false detection of a clock cycle after an eeprom reset. Keeping the last clock value after a reset keeps it in sync. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev: es1370+ac97 descriptionGerd Hoffmann2-0/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev/compat: virtio-net-pci 0.10 compatibility.Gerd Hoffmann2-3/+28
Add vectors property, allowing to turn off msi by setting vectors=0. Add compat property to pc-0.10 disabling msi. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev: print device id in "info pci".Gerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev/compat: virtio-console-pci 0.10 compatibility.Gerd Hoffmann2-1/+20
Add class property to virtio-console-pci allowing to specify the PCI class. Add compat property to pc-0.10 to set the old PCI class. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev: add id= support for pci nics.Gerd Hoffmann1-0/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev/compat: virtio-blk-pci 0.10 compatibility.Gerd Hoffmann2-1/+21
Add class property to virtio-blk-pci allowing to specify the PCI class. Add compat property to pc-0.10 to set the old PCI class. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev: add user-specified identifier to devices.Gerd Hoffmann2-2/+5
Add id field to DeviceState. Make "info qtree" print it. This helps users and management apps identifying devices in monitor output, which is especially useful with otherwise identical devices such as two virtio disks. This patch doesn't add a way to set the id, followup patches will do. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev/compat: add pc-0.10 machine type.Gerd Hoffmann1-0/+11
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev: add no_user, alias and descGerd Hoffmann2-0/+15
no_user: prevent users from adding certain devices. desc: description of the device. alias: to allow user friendly shortcuts on the command line, i.e. -device usbmouse instead of -device "QEMU USB Mouse" or -device lsi instead of -device lsi53c895a Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev/compat: compat property infrastructure.Gerd Hoffmann4-0/+38
This add support for switching devices into a compatibility mode using device properties. Machine types can have a list of properties for specific devices attached to allow the easy creation of machine types compatible to older qemu versions. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev: factor out driver search to qdev_find_info()Gerd Hoffmann1-7/+15
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16cleanup: drop unused struct elements from VirtIOPCIProxy.Gerd Hoffmann1-6/+0
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16qdev: rework device properties.Gerd Hoffmann45-390/+920
This patch is a major overhaul of the device properties. The properties are saved directly in the device state struct now, the linked list of property values is gone. Advantages: * We don't have to maintain the list with the property values. * The value in the property list and the value actually used by the device can't go out of sync any more (used to happen for the pci.devfn == -1 case) because there is only one place where the value is stored. * A record describing the property is required now, you can't set random properties any more. There are bus-specific and device-specific properties. The former should be used for properties common to all bus drivers. Typical use case is bus addressing, i.e. pci.devfn and i2c.address. Properties have a PropertyInfo struct attached with name, size and function pointers to parse and print properties. A few common property types have PropertyInfos defined in qdev-properties.c. Drivers are free to implement their own very special property parsers if needed. Properties can have default values. If unset they are zero-filled. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Initialize PS2 keyboard / mouse state on resetDinesh Subhraveti1-6/+32
Currently only common PS2 state is initialized, leaving keyboard and mouse specific state to contain stale values. Signed-off-by: Dinesh Subhraveti <dineshs@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Reset HPET config register on hpet_resetBeth Kon1-0/+1
Without this, after system reset, hpet does not detect transition from non-legacy to legacy mode. Signed-off-by: Beth Kon <eak@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Handle vga= in -appendPascal Terjan1-0/+19
Here is a patch I had sent twice to the list 2 years ago. Hopefuly this time someone will be interested It adds support for passing vga mode to linux kernel through vga= option in -append Signed-off-by: Pascal Terjan <pterjan@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Update to a hopefully more future proof FSF addressBlue Swirl63-133/+63
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16Sparc32: convert slavio interrupt controller to qdevBlue Swirl4-63/+115
Also increase QDEV_MAX_IRQ. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16Sparc32: refactor CPU initBlue Swirl1-45/+30
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16Sparc32: convert memory to qdevBlue Swirl1-36/+56
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16Sparc32: convert boot prom to qdevBlue Swirl1-87/+67
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16Sparc32: convert iommu to qdevBlue Swirl1-11/+45
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16Sparc32: convert cs4231 to qdevBlue Swirl3-14/+31
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16Sparc32: fix SDL zooming with TCXBlue Swirl1-20/+34
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16pci.c: remove unnecessary #ifdef DEBUG_PCI.Isaku Yamahata1-14/+15
remove unnecessary #ifdef DEBUG_PCI. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Add boot menu control via command line switchJan Kiszka2-0/+2
Disable the lengthy BIOS prompt for selecting a boot device by default, but let the user reenable it via '-boot menu=on'. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Add qemu_unregister_resetJan Kiszka1-0/+1
Will be used by '-boot once=...', and should also help in other use cases. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Move boot_set callback backendJan Kiszka1-2/+3
Move registration function for the boot_set callback handler and provide qemu_boot_set so that it can also be used outside the monitor code. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Add a pc-0-10 machine type for compatibility with 0.10.xMark McLoughlin1-6/+53
Add a pc-0-10 machine type to allow a pc machine to be created with virtio block and console devices compatibility with qemu-0.10.x. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>