summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* switch balloon initialization to -device.Gerd Hoffmann2009-08-271-7/+0
| | | | | | | | | | | | | | With that patch applied "-balloon virtio,args" becomes a shortcut for "-device virtio-balloon-pci,args". Side effects: - ballon device gains support for id=<tag>. - ballon device is off by default now. - initialization order changes, which may in different pci slot assignment depending on the VM configuration. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: move code to hw/ide/Gerd Hoffmann2009-08-277-25/+31
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: add save/restore support for mmioGerd Hoffmann2009-08-271-0/+20
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: add save/restore support for isaGerd Hoffmann2009-08-271-4/+29
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: split away ide-microdrive.cGerd Hoffmann2009-08-272-542/+574
| | | | | | | | create ide-microdrive.c and place microdrive support there. only build ide-microdrive support for platforms using it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: split away ide-mmio.cGerd Hoffmann2009-08-275-96/+129
| | | | | | | | create ide-mmio.c and place mmio support there. only build ide-mmio support for platforms using it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: split away ide-macio.cGerd Hoffmann2009-08-274-331/+359
| | | | | | | | create ide-macio.c and place macio support there. only build ide-macio support for platforms using it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: split away ide-pci.cGerd Hoffmann2009-08-278-494/+534
| | | | | | | | | | create ide-pci.c and place pci bus support there. only build ide-pci support for platforms using it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Fix build (merge with isa mmio split)
* ide: split away ide-isa.cGerd Hoffmann2009-08-278-16/+59
| | | | | | | | | create ide-isa.c and place isa bus support there. only build ide-isa support for platforms using it. also create ide.h header file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: split away ide-internal.hGerd Hoffmann2009-08-272-521/+566
| | | | | | | | | | move lots of IDE defines to the new file. also make a bunch of functions non-static and add declaration for them. Needed by the following patches of this series. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ide: add IDEBus struct, cleanupsGerd Hoffmann2009-08-271-226/+243
| | | | | | | | | | | | | | | | | The current IDE code uses an array of two IDEState structs to maintain the IDE bus. This patch adds a IDEBus to be used instead and does a bunch of cleanups: * move ide bus state from IDEState to IDEBus. * drop a bunch of ugly pointer arithmetics to figure the active interface, explicitly save the interface number instead. * add helper functions to save/restore idebus state. It also fixes a save/restore bug: loadvm allways stores the command in the master's IDEState, even when it was saved from the slave. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev error loggingGerd Hoffmann2009-08-271-17/+17
| | | | | | | Use the new qemu_error() function in qdev.c Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-pci error loggingGerd Hoffmann2009-08-271-1/+1
| | | | | | | Use the new qemu_error() function for virtio-blk-pci. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: add return value to init() callbacks.Gerd Hoffmann2009-08-27102-193/+334
| | | | | | | | | | | | | | | | | | Sorry folks, but it has to be. One more of these invasive qdev patches. We have a serious design bug in the qdev interface: device init callbacks can't signal failure because the init() callback has no return value. This patch fixes it. We have already one case in-tree where this is needed: Try -device virtio-blk-pci (without drive= specified) and watch qemu segfault. This patch fixes it. With usb+scsi being converted to qdev we'll get more devices where the init callback can fail for various reasons. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix stack buffer overflows in eepro100.c txReimar Döffinger2009-08-271-1/+5
| | | | | | | | | | | | | | | | | | Hello, the real world issue is that the hardware allows sends up to 2600 bytes, and for some reason FreeBSD sometimes sends frames larger than the ethernet frame size (102+1460 is the maximum I have seen so far), overflowing the on-stack tx buffer of the driver. Independent of that, the code should avoid allowing the guest to overwrite the stack. This is a minimal patch to fix the issue (you could leave out the size change of the buf array as well, networking still seems to work either way). Obviously there are better ways to handle it, but a proper fix IMO would involve first getting rid of the code duplication and given the number of patches pending for that code I see no point in working on that now. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Check block driver read error in pflash_cfi0xVijay Kumar2009-08-272-2/+14
| | | | | | | | | | | | | If a flash file of size smaller than the flash size is specified in the -pflash option, the block driver returns error. But the pflash_cfi0x ignores the error. This results in a flash content of all zeroes. And the simulation aborts while executing code. This patch adds the checks for errors from bdrv_read and escalates it to the calling code. Signed-off-by: Vijay Kumar B. <vijaykumar@bravegnu.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kvm: Simplify cpu_synchronize_state()Avi Kivity2009-08-271-3/+4
| | | | | | | | | | | cpu_synchronize_state() is a little unreadable since the 'modified' argument isn't self-explanatory. Simplify it by making it always synchronize the kernel state into qemu, and automatically flush the registers back to the kernel if they've been synchronized on this exit. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: convert watchdogsMarkus Armbruster2009-08-275-54/+32
| | | | | | | | | | | | | | | | | | | | | | | | -watchdog NAME is now equivalent to -device NAME, except it treats option argument '?' specially, and supports only one watchdog. A side effect is that a device created with -watchdog may now receive a different PCI address. i6300esb is now available on any machine with a PCI bus, not just PCs. ib700 is still PC only, but that could be changed easily. The only remaining use of struct WatchdogTimerModel and watchdog_add_model() is supporting '-watchdog ?'. Should be replaced by searching device_info_list for watchdog devices when we can identify them there. Also fixes ib700 not to use vm_clock before it is initialized: in wdt_ib700_init(), called from register_watchdogs(), which runs before init_timers(). The bug made ib700_write_enable_reg() crash in qemu_del_timer(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Clean up upcast from PCIDevice to I6300StateMarkus Armbruster2009-08-271-5/+4
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Move watchdog, watchdog_action, give them internal linkageMarkus Armbruster2009-08-272-11/+10
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-blk: handle NULL returns from bdrv_aio_{read, write}Christoph Hellwig2009-08-271-4/+14
| | | | | | | | | | | | The bdrv_aio_{read,write} routines can return a NULL pointer when the I/O submission fails. Currently we ignore this and will wait forever for an I/O completion and leading to a hang of the guest. I can easily reproduce this using the native Linux AIO patch, but it's also possible using normal pthreads-based AIO. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-console: rename dvq to ovqAmit Shah2009-08-271-2/+2
| | | | | | | | It isn't obvious what 'dvq' stands for. Since it's the output queue and the corresponding input queue is called 'ivq', call this 'ovq' Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci ids: remove redundant definesAmit Shah2009-08-271-3/+0
| | | | | | | | | | | Remove some redundant definitions for PCI classes: PCI_CLASS_SERIAL_OTHER already exists as PCI_CLASS_COMMUNICATION_OTHER and PCI_CLASS_PROCESSOR_CO is redefined. PCI_CLASS_SERIAL_OTHER is not used anywhere. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Port ACPI to VMStateJuan Quintela2009-08-271-34/+21
| | | | | | | | | This uses a run_after_load() function, and VMSTATE_PCI_DEVICE() It could be made smaller changing the type of pm_io_space_update() to return an int. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support to run a function after loadJuan Quintela2009-08-271-0/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Port PCIDevice state to VMStateJuan Quintela2009-08-272-22/+55
| | | | | | | | This uses a variant of buffer, with extra checks. Also uses the new support for cheking that a read value is less or equal than a field. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add version_id to PCIDevice.Juan Quintela2009-08-272-1/+4
| | | | | | | It is needed for VMState Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for int32_t check valueJuan Quintela2009-08-271-0/+4
| | | | | | | | We read the saved value and check that it is less or equal than the one stored in the structure. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Port PS2 devices to VMState designJuan Quintela2009-08-271-67/+52
| | | | | | | This uses STRUCT and BUFFER Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for static sized buffers (uint_8)Juan Quintela2009-08-271-0/+18
| | | | | | | This patch adds support for static sized buffer and typecheks that the buffer is right. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Port PCI Bus to VMState designJuan Quintela2009-08-271-30/+11
| | | | | | | This uses VARRAY and INT32_EQUAL values Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for variable sized arraysJuan Quintela2009-08-271-0/+22
| | | | | | | | This patch add supports for variable sized arrays whose size is another field of the state. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for int32_t check valueJuan Quintela2009-08-271-0/+5
| | | | | | | | We read the saved value and check that it is the same that the one is stored in the structure. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Port i8254 to new VMState designJuan Quintela2009-08-271-29/+37
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for arrays of structsJuan Quintela2009-08-271-0/+11
| | | | | | | This patch add supports for arrays of structs Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for structsJuan Quintela2009-08-271-0/+12
| | | | | | | | This patch adds support for saving one VMStateDescription from other VMStateDescription. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Port apic to new VMState designJuan Quintela2009-08-271-34/+33
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for arraysJuan Quintela2009-08-271-0/+28
| | | | | | | This patch adds support for saving arrays inside the struct Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add VMState support for pointersJuan Quintela2009-08-271-0/+19
| | | | | | | This patch adds support for saving pointers to values Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* New VMstate save/load infrastructureJuan Quintela2009-08-271-0/+102
| | | | | | | | | | | | | | | This patch introduces VMState infrastructure, to convert the save/load functions of devices to a table approach. This new approach has the following advantages: - it is type-safe - you can't have load/save functions out of sync - will allows us to have new interesting commands, like dump <device>, that shows all its internal state. - Just now, the only added type is arrays, but we can add structures. - Uses old load_state() function for loading old state. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* move useful type definitons to osdep.hJuan Quintela2009-08-271-3/+0
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Move isa_connect_irq calls into isa_create_simpleGerd Hoffmann2009-08-274-7/+10
| | | | | | | | Now with isa-bus maintaining the isa irqs we can move the isa_connect_irq() calls into isa_create_simple(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add isa_reserve_irq().Jes Sorensen2009-08-276-32/+58
| | | | | | | | | | | | | | | | | | | Introduce isa_reserve_irq() which marks an irq reserved and returns the appropriate qemu_irq entry from the i8259 table. isa_reserve_irq() is a temporary interface to be used to allocate ISA IRQs for devices which have not yet been converted to qdev, and for special cases which are not suited for qdev conversions, such as the 'ferr'. This patch goes on top of Gerd Hoffmann's which makes isa-bus.c own the ISA irq table. [ added isa-bus.o to some targets to fix build failures -- kraxel ] Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* isa bus irq changes and fixes.Gerd Hoffmann2009-08-279-37/+109
| | | | | | | | | | | | | | | Changes: (1) make isa-bus maintain isa irqs, complain when allocating already taken irqs. (2) note that (1) works only for isa devices converted to qdev already (floppy and ps2/kbd/mouse right now), so more work is needed to make this really useful. (3) split floppy init into isa and sysbus versions. (4) add sysbus->isa bridge & fix -M isapc breakage. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hw/eepro100.c: Use extended TBD only where applicableNaphtali Sprei2009-08-271-3/+3
| | | | | | | | | | | | | | | | Bug fix for segfault when run as i82551 HW: Use Extended TBD only when HW supports it (i82558 and up). Added assertions to guard from such buffer overflow Introduce the MAX_TCB_BYTE_COUNT macro Allocate buf big enough as HW needs (MAX_ETH_FRAME_SIZE -> MAX_TCB_BYTE_COUNT) I don't feel 100% OK with the "s->device >= i82558B" condition since it relies on the numeric (hex) value of those defines, which currently is correct, but changes (which I don't forsee now) might break it. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci-hotplug: initialize dinfo to NULL in pci_device_hot_addSebastian Herbszt2009-08-271-1/+1
| | | | | | | | | | | | Suppress the following compiler warning emitted by at least gcc version 4.2.1 (SUSE Linux) and gcc version 3.4.5 (mingw32 special): hw/pci-hotplug.c: In function 'pci_device_hot_add': hw/pci-hotplug.c:102: warning: 'dinfo' may be used uninitialized in this function hw/pci-hotplug.c:102: note: 'dinfo' was declared here Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add file descriptor migrationPaolo Bonzini2009-08-271-0/+1
| | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Chris Lalancette <clalance@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Sparc32: improve interrupt handlingBlue Swirl2009-08-252-32/+47
| | | | | | | | | | | | | | | | | Level 15 interrupts are broadcast to all CPUs, each CPU can clear the interrupt using the local Clear Pending register. Update intbit_to_level table. Don't try to raise level 0 interrupts. Calculate pending interrupts based on the separate inputs from master register. Setting or resetting the pending level isn't correct because of overlap of levels. Level 14 is always used for CPU timer interrupts, remove the property. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make CPURead/WriteFunc structure 'const'Blue Swirl2009-08-25141-538/+538
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make the e1000 the default network adapter for the pc target.Anthony Liguori2009-08-241-2/+2
| | | | | | | | | | | | | | The ne2k is an ancient card that performs pretty terribly under QEMU. In many modern OSes, there is no longer drivers available for the ne2k. Switch the default network adapter to e1000. This card is more widely suppported and performs rather well under QEMU. There may be very old OSes that had a ne2k driver but not an e1000 driver but I think this is likely the exception. I think the average user is better served with an e1000 vs ne2k. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud