summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2011-02-14Improve vm_stop reason declarationsJan Kiszka4-4/+4
Define and use dedicated constants for vm_stop reasons, they actually have nothing to do with the EXCP_* defines used so far. At this chance, specify more detailed reasons so that VM state change handlers can evaluate them. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-02-12vmmouse: fix queue_size field initializationBlue Swirl1-0/+1
Initialize the field queue_size, dropped by 91c9e09147ba1f3604a3d5d29b4de7702082a33f. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12hpet: make optionalBlue Swirl2-6/+7
Ignore failure with hpet device creation. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12sysbus: add creation function that may failBlue Swirl2-0/+40
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12x86: make vmmouse optionalBlue Swirl4-26/+25
Compile vmmouse in hwlib. Ignore failure if vmmouse device can't be created. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12isa: add creation function that may failBlue Swirl2-0/+13
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12vmmouse: convert to qdevBlue Swirl3-13/+32
Convert to qdev, also add a proper reset function. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12vmport: convert to qdevBlue Swirl4-6/+26
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12x86,MIPS: make vmware_vga optionalBlue Swirl3-6/+22
Allow failure with vmware_vga device creation and use standard VGA instead. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12pci: add creation functions that may failBlue Swirl2-0/+24
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12qdev: add creation function that may failBlue Swirl2-1/+14
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-12vmware_vga: refactor device creationBlue Swirl2-6/+4
Turn vmsvga_init into an inline function. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-11mst_fpga: Drop one more pxa.h inclusion.Andrzej Zaborowski1-1/+0
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-11pxa2xx: convert i2c master to use qdev/vmsdDmitry Eremin-Solenikov1-11/+42
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-11max7310: finish qdev'icationDmitry Eremin-Solenikov2-26/+5
1) Move GPIO-related functionality to qdev. Now one can use directly qdev_get_gpio_in()/qdev_connect_gpio_out() on max7310 devices. 2) Make reset to be called through qdev.reset callback. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-11tosa: we aren't connected to VBus, pass this info to Linux kernelDmitry Eremin-Solenikov1-0/+4
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-11mainstone: pass one irq to the mst_fpga instead of the whole PICDmitry Eremin-Solenikov3-8/+8
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-11Drop unnecessary inclusions of pxa.h headerDmitry Eremin-Solenikov2-2/+0
Seceral files contained onnecessary dependencies on hw/pxa.h header. Drop unused references. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-11Add scoop post_load callback that sets IRQs to loaded levelsDmitry Eremin-Solenikov1-1/+18
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-11tc6393xb: correct NAND isr assertionDmitry Eremin-Solenikov1-1/+1
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-11sysbus: print number of irqs in dev_printDmitry Eremin-Solenikov1-0/+1
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-07blockdev: add refcount to DriveInfoMarcelo Tosatti1-1/+1
The host part of a block device can be deleted with in progress block migration. To fix this, add a reference count to DriveInfo, freeing resources on last reference. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> CC: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-07ahci: make number of ports runtime determinedAlexander Graf3-16/+26
Different AHCI controllers have a different number of ports, so the core shouldn't care about the amount of ports available. This patch makes the number of ports available to the AHCI core runtime configurable, allowing us to have multiple different AHCI implementations with different amounts of ports. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-07ahci: Implement HBA resetAlexander Graf1-1/+4
The ahci code was missing its soft reset functionality. This wasn't really an issue for Linux guests, but Windows gets confused when the controller doesn't reset when it tells it so. Using this patch I can now successfully boot Windows 7 from AHCI using AHCI enabled SeaBIOS. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-07ahci: send init d2h fis on fis enableAlexander Graf2-7/+32
The drive sends a d2h init fis on initialization. Usually, the guest doesn't receive fises yet at that point though, so the delivery is deferred. Let's reflect that by sending the init fis on fis receive enablement. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-07ahci: split ICH and AHCI even moreAlexander Graf2-112/+88
Sebastian's patch already did a pretty good job at splitting up ICH-9 AHCI code and the AHCI core. We need some more though. Copyright was missing, the lspci dump belongs to ICH-9, we don't need the AHCI core to have its own qdev device duplicate. So let's split them a bit more in this patch, making things easier to read an understand. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-07ahci: add license header in ahci.hAlexander Graf1-0/+23
Due to popular request, this patch adds a license header to ahci.h Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-07ahci: split ICH9 from coreSebastian Herbszt3-301/+374
There are multiple ahci devices out there. The currently implemented ich-9 is only one of the many. So let's split that one out into a separate file to stress the difference. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-04ioapic: Style & magics cleanupJan Kiszka1-70/+107
Fix a few style issues and convert magic numbers into prober symbolic constants, also fixing the wrong but unused IOAPIC_DM_SIPI value. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-04ioapic: Add support for qemu-kvm's vmstate v2Jan Kiszka1-1/+2
qemu-kvm carries the IOAPIC base address in its v2 vmstate. We only support the default base address so far, and saving even that in the device state was rejected. Add a padding field to be able to read qemu-kvm's old state, but increase our version to 3, indicating that we are not saving a valid address. This also gives downstream the chance to change to stop evaluating the base_address and move to v3 as well. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-04ioapic: Save/restore irrJan Kiszka1-1/+14
This is a guest modifiable state that must be saved/restored properly. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-04ioapic: Implement EOI handling for level-triggered IRQsJan Kiszka3-5/+67
Add the missing EOI broadcast from local APIC to the IOAPICs on completion of level-triggered IRQs. This ensures that a still asserted IRQ source properly re-triggers an APIC IRQ. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-04virtio-serial: Make sure virtqueue is ready before discarding dataAmit Shah1-0/+3
This can happen if a port gets unplugged before guest has chance to initialise vqs. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-01vhost: force vhost off for non-MSI guestsmst@redhat.com7-10/+45
When MSI is off, each interrupt needs to be bounced through the io thread when it's set/cleared, so vhost-net causes more context switches and higher CPU utilization than userspace virtio which handles networking in the same thread. We'll need to fix this by adding level irq support in kvm irqfd, for now disable vhost-net in these configurations. Added a vhostforce flag to force vhost-net back on. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-01Add bootindex handling into usb storage device.Gleb Natapov1-0/+2
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-01Merge remote branch 'spice/spice.v29.pull' into stagingAnthony Liguori2-73/+12
Conflicts: trace-events
2011-02-01Merge remote branch 'spice/usb.5' into stagingAnthony Liguori5-109/+280
2011-02-01Merge remote branch 'amit/for-anthony' into stagingAnthony Liguori3-46/+139
2011-02-01hw/slavio_intctl.c: fix gcc warning about array bounds overrunPeter Maydell1-1/+6
The Ubuntu 10.10 gcc for ARM complains that we might be overrunning the cpu_irqs[][] array: silence this by correcting the bounds on the loop. (In fact we would not have overrun the array because bit MAX_PILS in pil_pending and irl_out will always be 0.) Also add a comment about why the loop's lower bound is OK. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-02-01SPARC: Fix Leon3 cache controlFabien Chouteau1-3/+2
The "leon3_cache_control_int" (op_helper.c) function is called within leon3.c which leads to segfault error with the global "env". Now cache control is a CPU feature and everything is handled in op_helper.c. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-31Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori1-2/+2
2011-01-31blockdev: Fix drive_add for drives without mediaMarkus Armbruster2-4/+2
Watch this: (qemu) drive_add 0 if=none (qemu) info block none0: type=hd removable=0 [not inserted] (qemu) drive_del none0 Segmentation fault (core dumped) add_init_drive() is confused about drive_init()'s failure modes, and cleans up when it shouldn't. This leaves the DriveInfo with member opts dangling. drive_del attempts to free it, and dies. drive_init() behaves as follows: * If it created a drive with media, it returns its DriveInfo. * If it created a drive without media, it clears *fatal_error and returns NULL. * If it couldn't create a drive, it sets *fatal_error and returns NULL. Of its three callers: * drive_init_func() is correct. * usb_msd_init() assumes drive_init() failed when it returns NULL. This is correct only because it always passes option "file", and "drive without media" can't happen then. * add_init_drive() assumes drive_init() failed when it returns NULL. This is incorrect. Clean up drive_init() to return NULL on failure and only on failure. Drop its parameter fatal_error. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-31blockdev: Make drive_add() take explicit type, index parametersMarkus Armbruster1-1/+1
Before, type & index were hidden in printf-like fmt, ... parameters, which get expanded into an option string. Rather inconvenient for uses later in this series. New IF_DEFAULT to ask for the machine's default interface. Before, that was done by having no option "if" in the option string. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-31blockdev: Fix regression in -drive if=scsi,index=NMarkus Armbruster4-3/+4
Before commit 622b520f, index=12 meant bus=1,unit=5. Since the commit, it means bus=0,unit=12. The drive is created, but not the guest device. That's because the controllers we use with if=scsi drives (lsi53c895a and esp) support only 7 units, and scsi_bus_legacy_handle_cmdline() ignores drives with unit numbers exceeding that limit. Changing the mapping of index to bus, unit is a regression. Breaking -drive invocations that used to work just makes it worse. Revert the part of commit 622b520f that causes this, and clean up some. Note that the fix only affects if=scsi. You can still put more than 7 units on a SCSI bus with -device & friends. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-31blockdev: New drive_get_next(), replacing qdev_init_bdrv()Markus Armbruster4-22/+8
qdev_init_bdrv() doesn't belong into qdev.c; it's about drives, not qdevs. Rename to drive_get_next, move to blockdev.c, drop the bogus DeviceState argument, and return DriveInfo instead of BlockDriverState. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-31scsi hotplug: Set DriveInfo member bus correctlyMarkus Armbruster1-0/+1
drive_init() picks the first free bus and unit number, unless the user specifies them. This isn't a good fit for the drive_add monitor command, because there we specify the controller by PCI address instead of using bus number set by drive_init(). scsi_hot_add() takes care to replace the unit number set by drive_init() by the real one, but it neglects to replace the bus number. Thus, bus/unit in DriveInfo may be bogus. Affects drive_get() and drive_get_max_bus(). I'm not aware of anything bad happening because of that; looks like by the time we're hot-plugging, the two functions aren't used anymore. Fix it anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-31ahci: Fix cpu_physical_memory_unmap() argument orderingStefan Hajnoczi1-5/+5
The len and is_write arguments to cpu_physical_memory_unmap() were swapped. This patch changes calls to use the correct argument ordering. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-31virtio-blk: tell the guest about size changesChristoph Hellwig1-0/+10
Raise a config change interrupt when the size changed. This allows virtio-blk guest drivers to read-read the information from the config space once it got the config chaged interrupt. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-31block: tell drivers about an image resizeChristoph Hellwig2-2/+11
Extend the change_cb callback with a reason argument, and use it to tell drivers about size changes. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-29prep: Disable second IDE channel, as long as ISA IDE emulation doesn't ↵Hervé Poussineau1-1/+1
support same irq for both channels Cc: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>