summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* net: Provide VLAN client lookup helperJan Kiszka2009-06-291-1/+1
| | | | | | | | Introduce qemu_find_vlan_client_by_name for VLANClientState lookup based on VLAN ID and client name. This is useful for monitor commands. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add serial number support for virtio_blkjohn cooper2009-06-242-0/+62
| | | | | | | | | | | | | | | | [brought forward to current qemu-kvm.git] This patch implements the missing qemu logic to interpret a '-drive .. serial=XYZ ..' flag for a virtio_blk device. The serial number string is contained in a skeletal IDENTIFY DEVICE data structure and this structure is made available to the guest virtio_blk driver via pci i/o region 0. Signed-off-by: john cooper <john.cooper@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/net: flag to control the number of vectors a nic hasMichael S. Tsirkin2009-06-241-1/+4
| | | | | | | | | Add an option to specify the number of MSI-X vectors for PCI NIC cards. This can also be used to disable MSI-X, for compatibility with old qemu. This option currently only affects virtio cards. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/net: request 3 vectors in virtio-netMichael S. Tsirkin2009-06-241-0/+1
| | | | | | | | Request up to 3 vectors in virtio-net. Actual bindings might supply less. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/pci: add pci_get/set_byteMichael S. Tsirkin2009-06-241-0/+12
| | | | | | | | Add pci_get/set_byte to keep *_word and *_long access functions company. They are unused for now. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/virtio: virtio save/load bindingsMichael S. Tsirkin2009-06-243-18/+65
| | | | | | | Implement bindings for virtio save/load. Use them in virtio pci. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/virtio: MSI-X support in virtio PCIMichael S. Tsirkin2009-06-241-40/+112
| | | | | | | | This enables actual support for MSI-X in virtio PCI. First user will be virtio-net. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/virtio: virtio support for many interrupt vectorsMichael S. Tsirkin2009-06-244-25/+81
| | | | | | | | | | | | Extend virtio to support many interrupt vectors, and rearrange code in preparation for multi-vector support (mostly move reset out to bindings, because we will have to reset the vectors in transport-specific code). Actual bindings in pci, and use in net, to follow. Load and save are not connected to bindings yet, so they are left stubbed out for now. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/apic: minimal MSI/MSI-X implementation for PCMichael S. Tsirkin2009-06-241-4/+39
| | | | | | | | | | | Implement MSI support in APIC. Note that MSI and MMIO APIC registers are at the same memory location, but actually not on the global bus: MSI is on PCI bus, APIC is connected directly to the CPU. We map them on the global bus at the same address which happens to work because MSI registers are reserved in APIC MMIO and vice versa. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/pci: MSI-X support functionsMichael S. Tsirkin2009-06-243-0/+435
| | | | | | | | | | | Add functions implementing MSI-X support. First user will be virtio-pci. Note that platform must set a flag to declare MSI supported: this is a safety measure to avoid breaking platforms which should support MSI-X but currently lack this in the interrupt controller emulation. For PC this will be set by APIC. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/pci: check constant registers on loadMichael S. Tsirkin2009-06-242-1/+30
| | | | | | | | | | | | | | Add "cmask" table of constant register masks: if a bit is not writeable and is set in cmask table, this bit is checked on load. An attempt to load an image that would change such a register causes load to fail. Use this table to make sure that load does not modify registers that guest can not change (directly or indirectly). Note: we can't just assume that read-only registers never change, because the guest could change a register indirectly. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/pci: add routines to manage PCI capabilitiesMichael S. Tsirkin2009-06-242-2/+90
| | | | | | | Add routines to manage PCI capability list. First user will be MSI-X. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/pci: helper routines for pci accessMichael S. Tsirkin2009-06-241-3/+27
| | | | | | | | Add inline routines for convenient access to pci devices with correct (little) endianness. Will be used by MSI-X support. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu/pci: make default_write_config use mask tableMichael S. Tsirkin2009-06-242-117/+46
| | | | | | | | | | | | | | | | Change much of hw/pci to use symbolic constants and a table-driven design: add a mask table with writable bits set and readonly bits unset. Detect change by comparing original and new registers. This makes it easy to support capabilities where read-only/writeable bit layout differs between devices, depending on capabilities present. As a result, writing a single byte in BAR registers now works as it should. Writing to upper limit registers in the bridge also works as it should. Code is also shorter. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sparc64 follow pci_nic_init changeIgor V. Kovalenko2009-06-231-1/+1
| | | | | | | sun4u.c: correct pci_nic_init arguments following commit 5607c38820366954c38dd702e979499486057481 Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
* virtio-net: implement async packet sendingMark McLoughlin2009-06-221-2/+37
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Don't register cpu reset handler for cpu with APIC.Gleb Natapov2009-06-221-7/+3
| | | | | | | | | APIC reset handler already resets cpu, no need to reset it twice. Also register cpu_reset handler directly to make it impossible to add additional code to main_cpu_reset() by mistake. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Support addr=... in option argument of -drive if=virtioMarkus Armbruster2009-06-224-3/+18
| | | | | | | | | | | | | Make drive_init() accept addr=, put the value into struct DriveInfo. Use it in all the places that create virtio-blk-pci devices: pc_init1(), bamboo_init(), mpc8544ds_init(). Don't support addr= in third argument of monitor command pci_add and second argument of drive_add, because that clashes with their first arguments. Admittedly unelegant. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make first argument of monitor command pci_add workMarkus Armbruster2009-06-223-44/+28
| | | | | | | | | | | Simply pass the PCI address through qemu_pci_hot_add_nic() to pci_nic_init() and through qemu_pci_hot_add_storage() to pci_create(). Before, pci_device_hot_add() passed along the PCI bus to use, and ignored any user-specified slot. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Support addr=... in option argument of -net nicMarkus Armbruster2009-06-2213-25/+66
| | | | | | | | | | | | | | | | | Make net_client_init() accept addr=, put the value into struct NICinfo. Use it in pci_nic_init(), and remove arguments bus and devfn. Don't support addr= in third argument of monitor command pci_add, because that clashes with its first argument. Admittedly unelegant. Machines "malta" and "r2d" have a default NIC with a well-known PCI address. Deal with that the same way as the NIC model: make pci_nic_init() take an optional default to be used when the user doesn't specify one. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix do_pci_register_device() to reject devfn already in useMarkus Armbruster2009-06-221-0/+2
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmware_vga: clean upIsaku Yamahata2009-06-221-1/+1
| | | | | | | | use NULL instead of 0 for pci_register_device() argument for consistency. Any other caller uses NULL. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-net: enable mergeable receive buffersMark McLoughlin2009-06-221-0/+1
| | | | | | | | | | | | When virtio-net was merged in from qemu-kvm.git, the VNET_HDR related features were dropped from the code. However, VIRTIO_NET_F_MRG_RXBUF appears to have accidentally been dropped too. Re-instate that now. Reported-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* acpi.c: make qemu_system_device_hot_add piix independent.Isaku Yamahata2009-06-223-5/+24
| | | | | | | | introruce piix4_device_hot_add() for piix4 specific code and make qemu_system_device_hot_add() generic. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Handle init/sipi in a main cpu exec loop. (v2)Gleb Natapov2009-06-221-11/+26
| | | | | | | | | | | | | This should fix compilation problem in case of CONFIG_USER_ONLY. Currently INIT/SIPI is handled in the context of CPU that sends IPI. This patch changes this to handle them like all other events in a main cpu exec loop. When KVM will gain thread per vcpu capability it will be much more clear to handle those event by cpu thread itself and not modify one cpu's state from the context of the other. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add pci_bus_reset() function.Gleb Natapov2009-06-221-0/+16
| | | | | | | | To reset internal irq handling data structures. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Yaniv Kamay <ykamay@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio: add support for indirect ring entriesMark McLoughlin2009-06-223-6/+53
| | | | | | | | | | | | | | | | | | Support a new feature flag for indirect ring entries. These are ring entries which point to a table of buffer descriptors. The idea here is to increase the ring capacity by allowing a larger effective ring size whereby the ring size dictates the number of requests that may be outstanding, rather than the size of those requests. This should be most effective in the case of block I/O where we can potentially benefit by concurrently dispatching a large number of large requests. Even in the simple case of single segment block requests, this results in a threefold increase in ring capacity. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio: make vring_desc_*() take phys addrsMark McLoughlin2009-06-221-26/+33
| | | | | | | | | | | Change the vring descriptor helpers to take the physical address of the descriptor table rather than a virtqueue. This is needed in order to allow these helpers to be used with an indirect descriptor table. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make nic option rom loading less painful.Glauber Costa2009-06-221-2/+17
| | | | | | | | | | | | | | | | | | The code how it is today, is totally painful to read and keep. To begin with, the code is duplicated with the option rom loading code that linux_boot and vga are already using. This patch introduces a "bootable" state in NICInfo structure, that we can use to keep track of whether or not a given nic should be bootable, avoiding the introduction of yet another global state. With that in hands, we move the code in vl.c to hw/pc.c, and use the already existing infra structure to load those option roms. Error checking code suggested by Mark McLoughlin Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Restore consistent formatting of audio devicesmalc2009-06-205-31/+31
|
* xilinx-eth: Remove debug print.Edgar E. Iglesias2009-06-181-1/+0
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* Don't set IRQs on device reset and loadvm/savevmBlue Swirl2009-06-175-12/+0
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Call piix4_reset() on system reset.Blue Swirl2009-06-171-1/+5
| | | | | | | | Also zero pci_irq_levels on reset to avoid stuck irq after reset. Based on 15a1956af94e36105494f782a752698103addf63 by Gleb Natapov. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Don't set IRQs on device reset and loadvm/savevmBlue Swirl2009-06-171-18/+22
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Call piix3_reset() on system reset.Gleb Natapov2009-06-171-1/+5
| | | | | | | Also zero pci_irq_levels on reset to avoid stuck irq after reset. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Yaniv Kamay <ykamay@redhat.com>
* Register usb-uhci reset function.Gleb Natapov2009-06-171-1/+4
| | | | | | | | The device is not reset on system reset currently. Without this patch RHEL4.8 hangs after reboot if -usbdevice table is in use. Signed-off-by: Gleb Natapov <gleb@redhat.com>
* Revert "Update irqs on reset and device load"Blue Swirl2009-06-172-11/+1
| | | | | | | | | This reverts commit 3dcd219f09d6c1817bf9a132899e6b925f7a0914. It is incorrect to call qemu_irq functions (or any other functions that access other device state) during savevm/loadvm. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Allow user to specify CPU modelBlue Swirl2009-06-173-10/+8
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix vga_screen_dump_blank() PPM generationEduardo Habkost2009-06-161-2/+3
| | | | | | | | | vga_screen_dump_blank() was not generating a valid PPM file: the width of the image made no sense (why it was multiplied by sizeof(uint32_t)?), and there was only one sample per pixel, instead of three. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Prevent CD-ROM media eject while device is lockedMark McLoughlin2009-06-161-8/+18
| | | | | | | | | | | | | | | | | Section 10.8.25 ("START/STOP UNIT Command") of SFF-8020i states that if the device is locked we should refuse to eject if the device is locked. ASC_MEDIA_REMOVAL_PREVENTED is the appropriate return in this case. In order to stop itself from ejecting the media it is running from, Fedora's installer (anaconda) requires the CDROMEJECT ioctl() to fail if the drive has been previously locked. See also https://bugzilla.redhat.com/501412 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: add define for communication class devicesAmit Shah2009-06-161-0/+2
| | | | | Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio blk: fix warning.Gerd Hoffmann2009-06-161-0/+1
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* lsi53c895a: Implement write access to DMA Byte CounterSebastian Herbszt2009-06-161-0/+7
| | | | | | | | | | Adds CASE_SET_REG24 and fixes the following errors: lsi_scsi: error: Unhandled writeb 0x24 = 0x0 lsi_scsi: error: Unhandled writeb 0x25 = 0x0 Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* lsi53c895a: Implement read and write access to DMA Next AddressSebastian Herbszt2009-06-161-0/+2
| | | | | | | | | | | | Fixes the following errors: lsi_scsi: error: Unhandled writeb 0x28 = 0x0 lsi_scsi: error: Unhandled writeb 0x29 = 0x0 lsi_scsi: error: Unhandled writeb 0x2a = 0x0 lsi_scsi: error: Unhandled writeb 0x2b = 0x0 Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* lsi53c895a: Implement Scratch Byte RegisterSebastian Herbszt2009-06-161-0/+7
| | | | | | | | | | Fixes the following errors: lsi_scsi: error: Unhandled writeb 0x3a = 0x0 lsi_scsi: error: readb 0x3a Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Rename pci_register_io_region() to pci_register_bar()Avi Kivity2009-06-1621-40/+40
| | | | | | | | This function is used to manage a PCI BAR, so make the more generic pci_register_io_region() available to other uses. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Remove io_index argument from cpu_register_io_memory()Avi Kivity2009-06-16137-271/+267
| | | | | | | | | The parameter is always zero except when registering the three internal io regions (ROM, unassigned, notdirty). Remove the parameter to reduce the API's power, thus facilitating future change. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Fix regression in "pci_add ... storage if=virtio, ..."Markus Armbruster2009-06-161-1/+0
| | | | | | | | qemu_pci_hot_add_storage() runs qdev_init() twice. Broken in commit 07e3af9a "Virtio-blk qdev conversion". Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Incorporate changes from v2 of Gleb's RTC reset patchAnthony Liguori2009-06-151-4/+8
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* etrax: Don't pass CPUState to peripherals.Edgar E. Iglesias2009-06-156-20/+10
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
OpenPOWER on IntegriCloud