summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* MSI: Robust resource releaseJan Kiszka2011-05-053-9/+12
| | | | | | | | msi_init may fail, so we need to check on uninit if the cap was actually installed. This also avoids that the users need to check. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Support 32 bit read/write access to flash registerStefan Weil2011-05-051-0/+9
| | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Support byte read access to general control registerStefan Weil2011-05-051-0/+3
| | | | | | | | The general control register is a byte register. Add support for byte reads. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Support byte/word read/write access to MDI control registerStefan Weil2011-05-051-2/+32
| | | | | | | | | | MDI control is a 32 bit register, but may be read or written using 8 or 16 bit access. Data is latched when the MSB is written. Add support for byte/word read/write access. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Support byte/word writes to pointer registerStefan Weil2011-05-051-17/+16
| | | | | | | | pointer is a 32 bit register, but may be written using 8 or 16 bit writes. Add support for byte/word writes. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Support byte/word writes to port addressStefan Weil2011-05-051-2/+18
| | | | | | | | port is a 32 bit register, but may be written using 8 or 16 bit writes. Add support for byte/word writes. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Fix endianness issuesStefan Weil2011-05-051-44/+97
| | | | | | | | | | | | | | | | | | | | Like other Intel devices, e100 (eepro100) uses little endian byte order. This patch was tested with these combinations: i386 host, i386 + mipsel guests (le-le) mipsel host, i386 guest (le-le) i386 host, mips + ppc guests (le-be) mips host, i386 guest (be-le) mips and mipsel hosts were emulated machines. v2: Use prefix for new functions. Add the same prefix to stl_le_phys. Fix alignment of mem (needed for word/dword reads/writes). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Pad received short framesStefan Weil2011-05-051-1/+25
| | | | | | | | | | | | | | QEMU sends frames smaller than 60 bytes to ethernet nics. Such frames are rejected by real NICs and their emulations. To avoid this behaviour, other NIC emulations pad received frames. This patch enables this workaround for eepro100, too. All related code is marked with CONFIG_PAD_RECEIVED_FRAMES, so we can drop this in case QEMU's networking code is ever changed. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Remove unused structure elementStefan Weil2011-05-051-3/+3
| | | | | | | | | | cppcheck reports that 'packet' is unused. It was only used to calculate the size of the preceding data. Removing it saves a lot of stack space (local variable rx). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Remove type casts which are no longer neededStefan Weil2011-05-051-7/+6
| | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: Avoid duplicate debug messagesStefan Weil2011-05-051-5/+9
| | | | | | | | | When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice. Now logging in eepro100_write1 and eepro100_write2 is similar to the logging in eepro100_write4 (which already was correct). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* wdt_i6300esb: convert to pci_register_bar_simple()Avi Kivity2011-04-071-27/+15
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* usb-ohci: convert to pci_register_bar_simple()Avi Kivity2011-04-071-9/+1
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pcnet-pci: convert to pci_register_bar_simple()Avi Kivity2011-04-071-15/+1
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* ich/ahci: convert to pci_register_bar_simple()Avi Kivity2011-04-073-14/+1
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hda-intel: convert to pci_register_bar_simple() (partial)Avi Kivity2011-04-071-11/+1
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hda-intel: convert to pci_register_bar_simple()Avi Kivity2011-04-071-10/+1
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: convert to pci_register_bar_simple()Avi Kivity2011-04-071-30/+13
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* cirrus-vga: convert to pci_register_bar_simple()Avi Kivity2011-04-071-11/+2
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* rtl8139: convert to pci_register_bar_simple()Avi Kivity2011-04-071-10/+1
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: add pci_register_bar_simple() APIAvi Kivity2011-04-072-0/+20
| | | | | | | | This is similar to pci_register_bar(), but automatically registers a single memory region spanning the entire BAR. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* cirrus_vga: flag on-device ram for dirty loggingMichael S. Tsirkin2011-04-071-5/+11
| | | | Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vhost: optimize out no-change assignmentMichael S. Tsirkin2011-04-071-0/+54
| | | | | | | | | Cirrus VGA (at least) calls register memory region with the same values again and again. The registration in vhost-net slows this a lot, optimize by checking that the same data is already registered. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vhost: skip memory which needs dirty loggingMichael S. Tsirkin2011-04-061-0/+4
| | | | | | | vhost doesn't support write logging (except for migration), anyway. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* kvm: halve number of set memory calls for vgaMichael S. Tsirkin2011-04-061-23/+36
| | | | | | | | | | | | use the new api to reduce the number of these (expensive) system calls. Note: using this API, we should be able to get rid of vga_dirty_log_xxx APIs. Using them doesn't affect the performance though because we detects the log_dirty flag set and ignores the call. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* cpu: add set_memory flag to request dirty loggingMichael S. Tsirkin2011-04-064-13/+29
| | | | | | | | Pass the flag to all cpu notifiers, doing nothing at this point. Will be used by follow-up patches. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* piix_pci: load path clean upIsaku Yamahata2011-04-011-8/+4
| | | | | | | | | | | | | | | | | | | | | | The previous patch didn't change the behavior when load, it resulted in ugly code. This patch cleans it up. With this patch, pic irq lines are manipulated when loaded. It is expected that it won't change the behaviour because the interrupts are level: at the moment e.g. pci devices already reassert interrupts on load. Test: - rung linux as guest and use flooding ping (ping -f) to host in order to trigger interrupts for e1000 emulated. - savevm/loadvm and see guest kept running after loadvm. To be honest, I'm not sure that ping -f caused enough interrupts because Linux e1000 driver supports NAPI. TODO: test more OSes, stress test with save/load, live-migration Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* piix_pci: optimize set irq pathIsaku Yamahata2011-04-011-17/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimize irq routing in piix_pic.c which has been a TODO. So far piix3 tracks each pirq level and checks whether a given pic pins is asserted by seeing if each pirq is mapped into the pic pin. This is independent on irq routing, but data path is on slow path. Given that irq routing is rarely changed and asserting pic pins is on data path, the path that asserts pic pins should be optimized and chainging irq routing should be on slow path. The new behavior with this patch series is to use bitmap which is addressed by pirq and pic pins with a given irq routing. When pirq is asserted, the bitmap is set and see if the pic pins is asserted by checking the bitmaps. When irq routing is changed, rebuild the bitmap and re-assert pic pins. test: - create VM with 4 e1000 nics in different pci slots (i.e. fn=0 for each e1000) Thus those e1000's INTA are connected to each PIRQ[A-D]. - run linux as guest and saw each devices triggers interrupt by seeing /proc/interrupts. And then confirmed that each PIRQ[A-D] surely asserted interrupts. Because irq 10 and 11 are shared by 4 e1000's, it only one NIC is activated with ifconfig ethN up/down when counting interrupts. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* piix_pci: eliminate PIIX3State::pci_irq_levelsIsaku Yamahata2011-04-011-11/+27
| | | | | | | | | | PIIX3State::pci_irq_levels are redundant which is already tracked by PCIBus layer. So eliminate them. Cc: Juan Quintela <quintela@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: add accessor function to get irq levelsIsaku Yamahata2011-04-012-0/+8
| | | | | | | | | | | Introduce accessor function to know INTx levels. It will be used later by q35. Although piix_pci tracks the intx line levels, it can be eliminated by this helper function. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* cirrus_vga: remove unneeded resetStefan Weil2011-03-281-1/+0
| | | | | | | | | cirrus_reset is already called by the reset framework, so there is no need to call it in cirrus_init_common. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vhost: fix dirty page handlingMichael S. Tsirkin2011-03-281-1/+3
| | | | | | | | | | vhost was passing a physical address to cpu_physical_memory_set_dirty, which is wrong: we need to translate to ram address first. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Note: this lead to crashes during migration, so the patch is needed on the stable branch too.
* virtio-serial: don't crash on invalid inputMichael S. Tsirkin2011-03-281-0/+3
| | | | | | | Fix crash on invalid input in virtio-serial. Discovered by code review, untested. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* e1000: check buffer availabilityMichael S. Tsirkin2011-03-281-8/+8
| | | | | | | | Reduce spurious packet drops on RX ring empty by verifying that we have at least 1 buffer ahead of the time. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio-pci: fix bus master work around on loadMichael S. Tsirkin2011-03-282-7/+7
| | | | | | | | | | | | | | | | | Commit c81131db15dd1844d0db1d51f3cd7a105cfd2cf3 detects old guests by comparing virtio and PCI status. It attempts to do this on load, as well, but load_config callback in a binding is invoked too early and so the virtio status isn't set yet. We could add yet another callback to the binding, to invoke after load, but it seems easier to reuse the existing vmstate callback. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: Alexander Graf <agraf@suse.de>
* pci: use uint8_t for devfn_minIsaku Yamahata2011-03-283-7/+7
| | | | | | | use uint8_t for devfn_min instead of int. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: use PCI_DEVFN in pci_get_bus_devfn()Isaku Yamahata2011-03-281-1/+1
| | | | | | | Replace hardcoded logic by a common macro. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: use devfn for pci_find_device() instead of (slot, fn) pairIsaku Yamahata2011-03-285-8/+8
| | | | | | | | (slot, fn) pair is somewhat confusing because of ARI. So use devfn for pci_find_device() instead of (slot, fn). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: replace the magic, 256, for the maximum of devfnIsaku Yamahata2011-03-282-1/+2
| | | | | | | | Introduce symbol PCI_SLOT_MAX for the # of slots, and replace the magic, 256. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* report that QEMU process was killed by a signalGleb Natapov2011-03-263-4/+25
| | | | | | | | | Currently when rogue script kills QEMU process (using TERM/INT/HUP signal) it looks indistinguishable from system shutdown. Lets report that QEMU was killed and leave some clues about the killer identity. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rtl8139: add vlan tag insertionBenjamin Poirier2011-03-261-15/+60
| | | | | | | | | | | | Add support to the emulated hardware to insert vlan tags in packets going from the guest to the network. Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com> Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rtl8139: add vlan tag extractionBenjamin Poirier2011-03-261-14/+52
| | | | | | | | | | | | | | | | | | | Add support to the emulated hardware to extract vlan tags in packets going from the network to the guest. Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com> Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> -- AFAIK, extraction is optional to get vlans working. The driver requests rx detagging but should not assume that it was done. Under Linux, the mac layer will catch the vlan ethertype. I only added this part for completeness (to emulate the hardware more truthfully...) Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rtl8139: cleanup FCS calculationBenjamin Poirier2011-03-261-17/+3
| | | | | | | | | | | clean out ifdef's around ethernet checksum calculation Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com> Acked-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* severe memory leak caused by broken palette_destroy() functionUlrich Obergfell2011-03-251-3/+1
| | | | | | | | | | | | | | | | | | | | | The following commit breaks the code of the function palette_destroy(). http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=e31e3694afef58ba191cbcc6875ec243e5971268 The broken code causes a severe memory leak of 'VncPalette' structures because it never frees anything: 70 void palette_destroy(VncPalette *palette) 71 { 72 if (palette == NULL) { 73 qemu_free(palette); 74 } 75 } Version 2 of the patch calls qemu_free() unconditionally. Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vl.c: Fix compilation failure if CONFIG_SDL isn't definedPeter Maydell2011-03-251-6/+7
| | | | | | | | Fix a compilation failure if CONFIG_SDL isn't defined (gcc complained that the label 'invalid_display' wasn't used). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'amit/for-anthony' into stagingAnthony Liguori2011-03-248-27/+52
|\
| * char: Prevent multiple devices opening same chardevAmit Shah2011-03-213-1/+11
| | | | | | | | | | | | | | | | | | | | | | Prevent: -chardev socket,path=/tmp/foo,server,nowait,id=c0 \ -device virtserialport,chardev=c0,id=vs0 \ -device virtserialport,chardev=c0,id=vs1 Reported-by: Mike Cao <bcao@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * virtio-console: Keep chardev open for other users after hot-unplugAmit Shah2011-03-211-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | After a hot-unplug operation, the previous behaviour was to close the chardev. That meant the chardev couldn't be re-used. Also, since chardev hot-plug isn't possible so far, this means virtio-console hot-plug isn't feasible as well. With this change, the chardev is kept around. A new virtio-console channel can then be hot-plugged with the same chardev and things will continue to work. Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * virtio-serial: Don't clear ->have_data() pointer after unplugAmit Shah2011-03-211-1/+0
| | | | | | | | | | | | | | | | | | After a port unplug operation, the port->info->have_data() pointer was set to NULL. The problem is, the ->info struct is shared by all ports, effectively disabling writes to other ports. Reported-by: juzhang <juzhang@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * virtio-serial-bus: Simplify handle_output() functionAmit Shah2011-03-211-9/+3
| | | | | | | | | | | | | | | | There's no code change, just re-arrangement to simplify the function after recent modifications. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
OpenPOWER on IntegriCloud