summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2013-12-03scsi-disk: reject ANCHOR=1 for UNMAP and WRITE SAME commandsPaolo Bonzini1-1/+11
Since we report ANC_SUP==0 in VPD page B2h, we need to return an error (ILLEGAL REQUEST/INVALID FIELD IN CDB) for all WRITE SAME requests with ANCHOR==1. Inspired by a similar patch to the LIO in-kernel target. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-03scsi-disk: catch write protection errors in UNMAPPaolo Bonzini1-0/+6
This is the same that is already done for WRITE SAME. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-25PPC: BookE: Make FIT/WDT timers at best millisecond grainedAlexander Graf1-0/+6
The default granularity for the FIT timer on 440 is on every 0x1000th transition of TB from 0 to 1. Translated that means 48828 times a second. Since interrupts are quite expensive for 440 and we don't really care about the accuracy of the FIT to that significance, let's force FIT and WDT to at best millisecond granularity. This basically restores behavior as it was in QEMU 1.6, where timers could only deal with millisecond granularities at all. This patch greatly improves performance with the 440 target and restores roughly the same performance level that QEMU 1.6 had for me. Signed-off-by: Alexander Graf <agraf@suse.de> Message-id: 1385416015-22775-3-git-send-email-agraf@suse.de Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25PPC: Make BookE FIT/WDT timers more lazyAlexander Graf1-5/+38
Today we fire FIT and WDT timer events every time the respective bit position in TB flips from 0 -> 1. However, there is no need to do this if the end result would be that we're changing a TSR bit that is set to 1 to 1 again. No guest visible change would have occured. So whenever we see that the TSR bit to our timer is already set, don't even bother to update the timer that would potentially fire it off. However, we do need to make sure that we update our timer that notifies us of the TB flip when the respective TSR bit gets unset. In that case we do care about the flip and need to notify the guest again. So add a callback into our timer handlers when TSR bits get unset. This improves performance for me when the guest is busy processing things. Signed-off-by: Alexander Graf <agraf@suse.de> Message-id: 1385416015-22775-2-git-send-email-agraf@suse.de Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25acpi-build: fix support for glib < 2.22Michael S. Tsirkin1-4/+2
glib < 2.22 does not have g_array_get_element_size, limit it's use (to check all elements are 1 byte in size) to newer glib. This fixes build on RHEL 5.3. Reported-by: Richard Henderson <rth@redhat.com> Reported-by: Erik Rull <erik.rull@rdsoftware.de> Tested-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 20131125220039.GA16386@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori3-2/+13
pc very last minute fixes for 1.7 This has a fix for a crasher bug with pci bridges, boot failure fix for s390 on 32 bit hosts, and fixes build for hosts with old glib. There's also a fix for --iasl configure flag - it can be used to work around broken iasl on some systems either by using a non-standard iasl or by disabling it. I've also reverted a e1000/rtl mac programming change that seems slightly wrong and too risky for 1.8. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 25 Nov 2013 03:40:07 AM PST using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin (5) and Bandan Das (1) # Via Michael S. Tsirkin * mst/tags/for_anthony: configure: make --iasl option actually work Revert "e1000/rtl8139: update HMP NIC when every bit is written" acpi-build: fix build on glib < 2.14 acpi-build: fix build on glib < 2.22 pci: unregister vmstate_pcibus on unplug s390x: fix flat file load on 32 bit systems Message-id: 1385379990-32093-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-25Merge remote-tracking branch 'bonzini/tags/for-anthony' into stagingAnthony Liguori5-27/+35
Here are a bunch of 1.7-tagged patches that I was afraid were getting forgotten or that did not have a clear maintainer responsible for making a pull request. # gpg: Signature made Thu 21 Nov 2013 08:40:59 AM PST using RSA key ID 9B4D86F2 # gpg: Can't check signature: public key not found # By Peter Maydell (3) and others # Via Paolo Bonzini * bonzini/tags/for-anthony: qga: Fix compiler warnings (missing format attribute, wrong format strings) mips jazz: do not raise data bus exception when accessing invalid addresses target-i386: yield to another VCPU on PAUSE rng-egd: offset the point when repeatedly read from the buffer rng-egd: remove redundant free target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid() vfio-pci: Fix multifunction=on atomic.h: Fix build with clang pc: get rid of builtin pvpanic for "-M pc-1.5" configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0 sun4m: Add FCode ROM for TCX framebuffer Message-id: 1385052578-32352-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-22qdev-properties-system.c: Allow vlan or netdev for -device, not bothVlad Yasevich1-0/+9
It is currently possible to specify things like: -device e1000,netdev=foo,vlan=1 With this usage, whichever argument was specified last (vlan or netdev) overwrites what was previousely set and results in a non-working configuration. Even worse, when used with multiqueue devices, it causes a segmentation fault on exit in qemu_free_net_client. That patch treates the above command line options as invalid and generates an error at start-up. Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-21mips jazz: do not raise data bus exception when accessing invalid addressesHervé Poussineau1-0/+24
MIPS Jazz chipset doesn't seem to raise data bus exceptions on invalid accesses. However, there is no easy way to prevent them. Creating a big memory region for the whole address space doesn't prevent memory core to directly call unassigned_mem_read/write which in turn call cpu->do_unassigned_access, which (for MIPS CPU) raise an data bus exception. This fixes a MIPS Jazz regression introduced in c658b94f6e8c206c59d02aa6fbac285b86b53d2c. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21vfio-pci: Fix multifunction=onAlex Williamson1-0/+7
When an assigned device is initialized it copies the device config space into the emulated config space. Unfortunately multifunction is setup prior to the device initfn and gets clobbered. We need to restore it just like pci-assign does. Cc: qemu-stable@nongnu.org Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21pc: get rid of builtin pvpanic for "-M pc-1.5"Paolo Bonzini3-19/+0
This causes two slight backwards-incompatibilities between "-M pc-1.5" and 1.5's "-M pc": (1) a fw_cfg file is removed with this patch. This is only a problem if migration stops the virtual machine exactly during fw_cfg enumeration. (2) after migration, a VM created without an explicit "-device pvpanic" will stop reporting panics to management. The first problem only occurs if migration is done at a very, very early point (and I'm not sure it can happen in practice for reasonable-size VMs, since it will likely take more time to send the RAM to destination, than it will take for BIOS to scan fw_cfg). The second problem only occurs if the guest panics _and_ has a guest driver _and_ management knows to look at the crash event, so it is mostly theoretical at this point in time. Thus keep the code simple, and pretend it was never broken. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21sun4m: Add FCode ROM for TCX framebufferMark Cave-Ayland2-8/+35
Upstream OpenBIOS now implements SBus probing in order to determine the contents of a physical bus slot, which is required to allow OpenBIOS to identify the framebuffer without help from the fw_cfg interface. SBus probing works by detecting the presence of an FCode program (effectively tokenised Forth) at the base address of each slot, and if present executes it so that it creates its own device node in the OpenBIOS device tree. The FCode ROM is generated as part of the OpenBIOS build and should generally be updated at the same time. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> CC: Blue Swirl <blauwirbel@gmail.com> CC: Bob Breuer <breuerr@mc.net> CC: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-21vfio-pci: Fix multifunction=onAlex Williamson1-0/+7
When an assigned device is initialized it copies the device config space into the emulated config space. Unfortunately multifunction is setup prior to the device initfn and gets clobbered. We need to restore it just like pci-assign does. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Reviewed-by: Bandan Das <bsd@redhat.com> Message-id: 20131112185059.7262.33780.stgit@bling.home Cc: qemu-stable@nongnu.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21mips jazz: do not raise data bus exception when accessing invalid addressesHervé Poussineau1-0/+24
MIPS Jazz chipset doesn't seem to raise data bus exceptions on invalid accesses. However, there is no easy way to prevent them. Creating a big memory region for the whole address space doesn't prevent memory core to directly call unassigned_mem_read/write which in turn call cpu->do_unassigned_access, which (for MIPS CPU) raise an data bus exception. This fixes a MIPS Jazz regression introduced in c658b94f6e8c206c59d02aa6fbac285b86b53d2c. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Message-id: 1383603977-7003-1-git-send-email-hpoussin@reactos.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21virtio-rng: add check of periodAmos Kong1-0/+6
If period is assigned to 0, limit timer will expire immediately. It causes a qemu warning: "main-loop: WARNING: I/O thread spun for 1000 iterations" This limit is meaningless. This patch forbids to assign 0 to period. Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Message-id: 1385031203-23790-1-git-send-email-akong@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21s390x: fix flat file load on 32 bit systemsMichael S. Tsirkin1-8/+9
pc-bios/s390-zipl.rom is a flat image so it's expected that loading it as elf will fail. It should fall back on loading a flat file, but doesn't on 32 bit systems, instead it fails printing: qemu: hardware error: could not load bootloader 's390-zipl.rom' The result is boot failure. The reason is that a 64 bit unsigned interger which is set to -1 on error is compared to -1UL which on a 32 bit system with gcc is a 32 bit unsigned interger. Since both are unsigned, no sign extension takes place and comparison evaluates to non-equal. There's no reason to do clever tricks: all functions we call actually return int so just use int. And then we can use == -1 everywhere, consistently. Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 20131121133426.GA30827@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21acpi-build: fix build on glib < 2.14Michael S. Tsirkin2-5/+8
g_array_get_element_size was only added in glib 2.14. Fortunately we don't use it for any arrays where element size is > 1, so just add an assert. Reported-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1385036128-8753-2-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21acpi-build: fix build on glib < 2.22Michael S. Tsirkin1-5/+6
g_string_vprintf was only introduced in 2.24 so switch to vsnprintf instead. A bit uglier but name size is fixed at 4 bytes here so it's easy. Reported-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1385036128-8753-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori1-46/+10
# By Jan Kiszka (1) and others # Via Gleb Natapov * qemu-kvm/uq/master: kvm: Fix uninitialized cpuid_data pci-assign: Remove dead code for direct I/O region access from userspace KVM: x86: fix typo in KVM_GET_XCRS Message-id: cover.1385040432.git.gleb@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-21Revert "e1000/rtl8139: update HMP NIC when every bit is written"Michael S. Tsirkin2-2/+5
This reverts commit cd5be5829c1ce87aa6b3a7806524fac07ac9a757. Digging into hardware specs shows this does not actually make QEMU behave more like hardware: There are valid arguments backed by the spec to indicate why the version of e1000 prior to cd5be582 was more correct: the high byte actually includes a valid bit, this is why all guests write it last. For rtl8139 there's actually a separate undocumented valid bit, but we don't implement it yet. To summarize all the drivers we know about behave in one way that allows us to make an assumption about write order and avoid spurious, incorrect mac address updates to the monitor. Let's stick to the tried heuristic for 1.7 and possibly revisit for 1.8. Reported-by: Vlad Yasevich <vyasevic@redhat.com> Reviewed-by: Vlad Yasevich <vyasevic@redhat.com> Cc: Amos Kong <akong@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-21acpi-build: fix build on glib < 2.14Michael S. Tsirkin2-5/+8
g_array_get_element_size was only added in glib 2.14, there's no way to find element size in with an older glib. Fortunately we only use a single table (linker) where element size > 1. Switch element size to 1 everywhere, then we can just look at len field to get table size in bytes. Add an assert to make sure we catch any violations of this rule. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reported-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-21acpi-build: fix build on glib < 2.22Michael S. Tsirkin1-5/+6
g_string_vprintf was only introduced in 2.24 so switch to vsnprintf instead. A bit uglier but name size is fixed at 4 bytes here so it's easy. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reported-by: Richard Henderson <rth@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-21pci: unregister vmstate_pcibus on unplugBandan Das1-0/+8
PCIBus registers a vmstate during init. Unregister it upon removal/unplug. Signed-off-by: Bandan Das <bsd@redhat.com> Cc: qemu-stable@nongnu.org Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-21s390x: fix flat file load on 32 bit systemsMichael S. Tsirkin1-8/+9
pc-bios/s390-zipl.rom is a flat image so it's expected that loading it as elf will fail. It should fall back on loading a flat file, but doesn't on 32 bit systems, instead it fails printing: qemu: hardware error: could not load bootloader 's390-zipl.rom' The result is boot failure. The reason is that a 64 bit unsigned interger which is set to -1 on error is compared to -1UL which on a 32 bit system with gcc is a 32 bit unsigned interger. Since both are unsigned, no sign extension takes place and comparison evaluates to non-equal. There's no reason to do clever tricks: all functions we call actually return int so just use int. And then we can use == -1 everywhere, consistently. Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-20openrisc-timer: Reduce overhead, Separate clock update functionsSebastian Macke1-10/+19
The clock value is only evaluated when really necessary reducing the overhead of the timer handling. This also solves a problem in the way the Linux kernel handles the timer and the expected accuracy. The old version could lead to inaccurate timings. Signed-off-by: Sebastian Macke <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com> Signed-off-by: Jia Liu <proljc@gmail.com>
2013-11-19Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori2-2/+2
pc last minute fixes for 1.8 This has a patch that drops an unused FW CFG entry. I think it's best to include it before 1.7 to avoid the need to maintain it in compat machine types. There's also a doc bugfix by Amos: I'm guessing doc fixes are still fair game even at this late stage. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 18 Nov 2013 03:48:14 AM PST using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Amos Kong (1) and Igor Mammedov (1) # Via Michael S. Tsirkin * mst/tags/for_anthony: doc: fix hardcoded helper path pc: disable pci-info Message-id: 1384775449-6693-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19Merge remote-tracking branch 'mjt/trivial-patches' into stagingAnthony Liguori3-22/+17
# By Jan Krupa (4) and others # Via Michael Tokarev * mjt/trivial-patches: hw/i386/Makefile.obj: use $(PYTHON) to run .py scripts consistently configure: Use -B switch only for Python versions which support it qga: Fix shutdown command of guest agent to work with SysV console: Remove unused debug code qga: Fix compilation for old versions of MinGW .travis.yml: basic compile and check recipes pci-assign: Fix error_report of pci-stub message qapi: Fix comment for create-type to match code. vl: fix build when configured with no graphic support usb: drop unused USBNetState.inpkt field qemu-char: add missing characters used in keymaps qemu-char: add support for U-prefixed symbols qemu-char: add Czech keymap file qemu-char: add Czech characters to VNC keysyms Message-id: 1384684850-6777-1-git-send-email-mjt@msgid.tls.msk.ru Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19Merge remote-tracking branch 'stefanha/net' into stagingAnthony Liguori2-4/+5
# By Amos Kong (1) and Sebastian Huber (1) # Via Stefan Hajnoczi * stefanha/net: virtio-net: fix the memory leak in rxfilter_notify() smc91c111: Fix receive starvation Message-id: 1384532032-19057-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19Merge remote-tracking branch 'agraf/tags/signed-ppc-for-upstream-1.7' into ↵Anthony Liguori4-0/+4
staging Patch queue for ppc - 2013-11-08 These are two patches that will hopefully make it into 1.7. The SLOF update fixes -append kernel command line argument passing into the guest kernel. The other patch makes VIO devices appear when using -device '?'. # gpg: Signature made Thu 07 Nov 2013 07:34:54 PM PST using RSA key ID 03FEDC60 # gpg: Can't check signature: public key not found # By Alexey Kardashevskiy # Via Alexander Graf * agraf/tags/signed-ppc-for-upstream-1.7: pseries: Update SLOF firmware image spapr: add vio-bus devices to categories Message-id: 1383881766-13958-1-git-send-email-agraf@suse.de Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-19virtio-net: fix the memory leak in rxfilter_notify()Amos Kong1-4/+4
object_get_canonical_path() returns a gchar*, it should be freed by the caller. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Vlad Yasevich <vyasevic@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-17hw/i386/Makefile.obj: use $(PYTHON) to run .py scripts consistentlyMichael Tokarev1-1/+1
$(PYTHON) is a Make variable which is set by configure. In all other places over the tree, .py files are run from Makefiles using this variable, except of a single leftover in hw/i386/Makefile.obj (and a nearby place in there uses $(PYTHON) correctly). Fix this leftover too. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Cc: Luigi Rizzo <rizzo@iet.unipi.it> Reviewed-by:: Stefan Weil <sw@weilnetz.de>
2013-11-15smc91c111: Fix receive starvationSebastian Huber1-0/+1
In case the smc91c111 interface signals that it cannot receive more packets the packets are queued and further reception will be disabled. In case the interface is again ready to receive packets notify the upper layer. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-14pc: disable pci-infoIgor Mammedov2-2/+2
The BIOS that we ship in 1.7 does not use pci info from host and so far isn't going to use it. Taking in account problems it caused see 9604f70fdf and to avoid future incompatibility issues, it's safest to disable that interface by default for all machine types including 1.7 as it was never exposed/used by guest. And properly remove/cleanup it during 1.8 development cycle. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-13Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori5-30/+23
pci, pc, virtio bug fixes This reverts PCI master abort support - we'll want it eventually but it exposes too many core bugs to be safe for 1.7. This also reverts a recent exec.c change that was an attempt to work-around some of these core bugs. Also included are small fixes in pc and virtio, and a core loader fix for PPC bamboo. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sun 10 Nov 2013 05:13:22 AM PST using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin (3) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: Revert "exec: limit system memory size" Revert "hw/pci: partially handle pci master abort" loader: drop return value for rom_add_blob_fixed acpi-build: disable with -no-acpi virtio-net: only delete bh that existed Fix pc migration from qemu <= 1.5 Message-id: 1384159176-31662-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13pci-assign: Fix error_report of pci-stub messageCole Robinson1-20/+16
Using multiple calls to error_report here means every line is prefaced with the (potentially long) pci-assign command line arguments. Use a single error_printf to preserve the intended formatting. Since this code path is always preceded by an error_report call, we don't lose the command line reporting. Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13usb: drop unused USBNetState.inpkt fieldStefan Hajnoczi1-1/+0
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-10Revert "hw/pci: partially handle pci master abort"Marcel Apfelbaum1-26/+0
This reverts commit a53ae8e934cd54686875b5bcfc2f434244ee55d6. The patch being reverted introduced a low-priority memory region covering all 64 bit pci address space. This exposed the following bugs elsewhere in the code: 1. Some memory regions have INT64_MAX size, where the intent was all 64 bit address space. This results in a sub-page region, should be UINT64_MAX. 2. page table rendering in exec.c ignores physical address bits above TARGET_PHYS_ADDR_SPACE_BITS. Access outside this range (e.g. from device DMA, or gdb stub) ends up with a wrong region. Registering a region outside this range leads to page table corruption. 3. Some regions overlap PCI hole and have same priority. This only works as long as no device uses the overlapping address. It doesn't look like we can resolve all issues in time for 1.7. Let's fix the bugs first and apply afterwards for 1.8. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10loader: drop return value for rom_add_blob_fixedMichael S. Tsirkin1-1/+2
rom_add_blob never fails, and neither does rom_add_blob_fixed, so there's no need to return value from it. In fact, rom_add_blob_fixed was erroneously returning -1 unconditionally which made the only system that checked the return value -M bamboo fail to start. Drop the return value and drop checks from ppc440_bamboo to fix this failure. Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10acpi-build: disable with -no-acpiMichael S. Tsirkin1-0/+5
QEMU will currently crash if started with -no-acpi flag since acpi build code probes the PM device which isn't present in this configuration. To fix, don't expose ACPI tables to guest when acpi has been disabled from command line. Fixes LP# 1248854 https://bugs.launchpad.net/qemu/+bug/1248854 Reported-by: chao zhou <chao.zhou@intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2013-11-10virtio-net: only delete bh that existedJason Wang1-1/+1
We delete without check whether it existed during exit. This will lead NULL pointer deference since it was created conditionally depends on guest driver status and features. So add a check of existence before trying to delete it. Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10Fix pc migration from qemu <= 1.5Cole Robinson2-3/+16
The following commit introduced a migration incompatibility: commit 568f0690fd9aa4d39d84b04c1a5dbb53a915c3fe Author: David Gibson <david@gibson.dropbear.id.au> Date: Thu Jun 6 18:48:49 2013 +1000 pci: Replace pci_find_domain() with more general pci_root_bus_path() The issue is that i440fx savevm idstr went from 0000:00:00.0/I440FX to 0000:00.0/I440FX. Unfortunately we are stuck with the breakage for 1.6 machine types. Add a compat property to maintain the busted idstr for the 1.6 machine types, but revert to the old style format for 1.7+, and <= 1.5. Tested with migration from qemu 1.5, qemu 1.6, and qemu.git. Cc: qemu-stable@nongnu.org Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-08virtio-net: broken RX filtering logic fixedDmitry Fleytman1-1/+2
Upon processing of VIRTIO_NET_CTRL_MAC_TABLE_SET command multicast list overwrites unicast list in mac_table. This leads to broken logic for both unicast and multicast RX filtering. Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-08spapr: add vio-bus devices to categoriesAlexey Kardashevskiy4-0/+4
In order to get devices appear in output of "./qemu-system-ppc64 -device ?", they must be assigned to one of DEVICE_CATEGORY_XXXX. This puts VIO devices classes to corresponding categories. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-11-07pci-assign: Remove dead code for direct I/O region access from userspaceJan Kiszka1-46/+10
This feature was already deprecated back then in qemu-kvm, ie. before pci-assign went upstream. assigned_dev_ioport_rw will never be invoked with resource_fd < 0. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-11-06e1000/rtl8139: update HMP NIC when every bit is writtenAmos Kong2-5/+2
We currently just update the HMP NIC info when the last bit of macaddr is written. This assumes that guest driver will write all the macaddr from bit 0 to bit 5 when it changes the macaddr, this is the current behavior of linux driver (e1000/rtl8139cp), but we can't do this assumption. The macaddr that is used for rx-filter will be updated when every bit is changed. This patch updates the e1000/rtl8139 nic to update HMP NIC info when every bit is changed. It will be same as virtio-net. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com> Message-id: 1383650238-16015-1-git-send-email-akong@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-06virtio-net: only delete bh that existedJason Wang1-1/+1
We delete without check whether it existed during exit. This will lead NULL pointer deference since it was created conditionally depends on guest driver status and features. So add a check of existence before trying to delete it. Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383728288-28469-1-git-send-email-jasowang@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05rtc: remove dead SQW IRQ codeJan Kiszka1-8/+1
This was once introduced by commit 100d9891d6 but was never used in-tree and then got broken by commit 32e0c8260d. Time to clean up. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Message-id: 520B6A27.4040207@siemens.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05vga: fix invalid read after freeMarc-André Lureau1-1/+0
After calling dpy_gfx_replace_surface(s->con, surface), the outer surface is invalid. ==5370== Invalid read of size 4 ==5370== at 0x460229: surface_bits_per_pixel (console.h:250) ==5370== by 0x466A81: get_depth_index (vga.c:1173) ==5370== by 0x467EC2: vga_draw_graphic (vga.c:1718) ==5370== by 0x4687A5: vga_update_display (vga.c:1914) ==5370== by 0x2A782E: qxl_hw_update (qxl.c:1766) ==5370== by 0x3EB83B: graphic_hw_update (console.c:254) ==5370== by 0x3FBE31: qemu_spice_display_refresh (spice-display.c:418) ==5370== by 0x2A7D01: display_refresh (qxl.c:1886) ==5370== by 0x3EEE1C: dpy_refresh (console.c:1436) ==5370== by 0x3EB543: gui_update (console.c:192) ==5370== by 0x3C43B3: timerlist_run_timers (qemu-timer.c:488) ==5370== by 0x3C4416: qemu_clock_run_timers (qemu-timer.c:499) ==5370== Address 0x22ffb1e0 is 0 bytes inside a block of size 56 free'd ==5370== at 0x4A074C4: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==5370== by 0x4245FC: free_and_trace (vl.c:2771) ==5370== by 0x50899AE: g_free (gmem.c:252) ==5370== by 0x3EE8D3: qemu_free_displaysurface (console.c:1332) ==5370== by 0x3EEDB7: dpy_gfx_replace_surface (console.c:1427) ==5370== by 0x467EB6: vga_draw_graphic (vga.c:1714) ==5370== by 0x4687A5: vga_update_display (vga.c:1914) ==5370== by 0x2A782E: qxl_hw_update (qxl.c:1766) ==5370== by 0x3EB83B: graphic_hw_update (console.c:254) ==5370== by 0x3FBE31: qemu_spice_display_refresh (spice-display.c:418) ==5370== by 0x2A7D01: display_refresh (qxl.c:1886) ==5370== by 0x3EEE1C: dpy_refresh (console.c:1436) Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1383664554-15248-1-git-send-email-marcandre.lureau@gmail.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove cpu_to_32wu()Peter Maydell1-6/+8
Replace the legacy cpu_to_32wu() with stl_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-10-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-05bswap.h: Remove cpu_to_be32wu()Peter Maydell3-7/+6
Replace the legacy cpu_to_be32wu() with stl_be_p(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1383669517-25598-8-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@amazon.com>