summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2013-10-25spapr-pci: enable irqfd for INTxAlexey Kardashevskiy1-0/+13
This enables IRQFD for LSI (level triggered INTx interrupts) by adding a spapr_route_intx_pin_to_irq() callback to the sPAPR PCI host bus. This callback is called to know the global interrupt number to link resampling fd with IRQFD's fd in KVM. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics-kvm: enable irqfd for MSIAlexey Kardashevskiy1-0/+6
This enables IRQFD support for sPAPR. The feature decreases the latency of interrupt handling. To enable IRQFD for MSI, this sets kvm_gsi_direct_mapping to true which enables direct MSI mapping. To enable IRQFD for LSI (level triggered INTx interrupts), a PCI host bus callback is required. The patch for that is coming next. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics: Implement H_XIRR_XBenjamin Herrenschmidt1-0/+14
This implements H_XIRR_X hypercall in addition to H_XIRR as it is mandatory for PAPR+ and there is no way for the guest to detect whether it is supported or not so just add it. As the Partition Adjunct Option is not supported at the moment, the CPPR parameter of the hypercall is ignored. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics: Implement H_IPOLLBenjamin Herrenschmidt1-0/+13
This adds support for the H_IPOLL hypercall which the guest uses to poll for a pending interrupt. This hypercall is mandatory for PAPR+ and there is no way for the guest to detect whether it is supported or not so just add it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics-kvm: Support for in-kernel XICS interrupt controllerDavid Gibson3-1/+509
Recent (host) kernels support emulating the PAPR defined "XICS" interrupt controller system within KVM. This patch allows qemu to initialize and configure the in-kernel XICS, and keep its state in sync with qemu's XICS state as necessary. This should give considerable performance improvements. e.g. on a simple IPI ping-pong test between hardware threads, using qemu XICS gives us around 5,000 irqs/second, whereas the in-kernel XICS gives us around 70,000 irqs/s on the same hardware configuration. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [Mike Qiu <qiudayu@linux.vnet.ibm.com>: fixed mistype which caused ics_set_kvm_state() to fail] Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics: add cpu_setup callbackAlexey Kardashevskiy1-0/+5
This adds a cpu_setup callback to the XICS device class (as XICS-KVM will do it different), xics_cpu_setup() will call it if it is set. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics: split to xics and xics-commonAlexey Kardashevskiy2-21/+137
The upcoming XICS-KVM support will use bits of emulated XICS code. So this introduces new level of hierarchy - "xics-common" class. Both emulated XICS and XICS-KVM will inherit from it and override class callbacks when required. The new "xics-common" class implements: 1. replaces static "nr_irqs" and "nr_servers" properties with the dynamic ones and adds callbacks to be executed when properties are set. 2. xics_cpu_setup() callback renamed to xics_common_cpu_setup() as it is a common part for both XICS'es 3. xics_reset() renamed to xics_common_reset() for the same reason. The emulated XICS changes: 1. the part of xics_realize() which creates ICPs is moved to the "nr_servers" property callback as realize() is too late to create/initialize devices and instance_init() is too early to create devices as the number of child devices comes via the "nr_servers" property. 2. added ics_initfn() which does a little part of what xics_realize() did. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics: add missing const specifiers to TypeInfoAlexey Kardashevskiy1-2/+2
This adds missing const specifiers to ICS and ICP TypeInfo's. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics: convert init() to realize()Alexey Kardashevskiy1-6/+22
This fixes XICS according new QOM rules. This converts ICS's init() callbacks to realize(). This converts legacy qdev_init_nofail() to property_set(realized). Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics: add pre_save/post_load dispatchersAlexey Kardashevskiy1-3/+53
The upcoming support of in-kernel XICS will redefine migration callbacks for both ICS and ICP so classes and callback pointers are added. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics: replace fprintf with error_reportAlexey Kardashevskiy1-2/+3
This replaces old-style fprintf with new style error_report. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Andreas Färber <afaerber@suse.de> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25spapr: move cpu_setup after kvmppc_set_paprAlexey Kardashevskiy1-2/+2
This moves the xics_cpu_setup() call after kvmppc_set_papr() in order to get VCPUs initialized as this is required by upcoming XICS-KVM. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25xics: move reset and cpu_setupAlexey Kardashevskiy1-36/+36
This simple change makes following patches nicer. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25spapr-rtas: fix h_rtas parameters readingAlexey Kardashevskiy1-3/+3
On the real hardware, RTAS is called in real mode and therefore top 4 bits of the address passed in the call are ignored. So does the patch. This converts h_rtas() to use existing rtas_ld() handlers. This fixed rtas_ld()/rtas_st() to ignore top 4 bits. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25spapr: Add ibm, purr property on power7 and newerAlexey Kardashevskiy1-0/+4
PAPR+ says that no "ibm,purr" tells the guest that H_PURR is not supported. However some guests still try calling H_PURR on POWER7 unless the property is present and equal to 0. This adds the property for CPUs supporting the PURR special register. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25spapr: increase temporary fdt buffer sizeAlexey Kardashevskiy1-1/+1
At the moment the size of the buffer is set to 64K which is enough for approximately 150 VCPUs which is not the limit. This increases the buffer up to 256K which allows having a tree for approximately 600 VCPUs which is way beyond the real number we need. As only the real size of the tree is copied to the guest, there will be no impact on existing configurations. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-25pseries: Fix loading of little endian kernelsBenjamin Herrenschmidt1-1/+12
Try loading the kernel as little endian if it fails big endian. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Anton Blanchard <anton@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-10-18Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori1-0/+3
# By Paolo Bonzini (2) and Jan Kiszka (1) # Via Gleb Natapov * qemu-kvm/uq/master: kvmvapic: Prevent reading beyond the end of guest RAM x86: cpuid: reconstruct leaf 0Dh data x86: fix migration from pre-version 12 Message-id: 1382108641-4862-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-10-18Merge remote-tracking branch 'stefanha/net' into stagingAnthony Liguori2-1/+15
# By Amos Kong # Via Stefan Hajnoczi * stefanha/net: net/rtl8139: update network information when macaddr is changed in guest net/e1000: update network information when macaddr is changed in guest net: update nic info during device reset Message-id: 1382103314-21608-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-10-18Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori2-2/+1
# By Fam Zheng (3) and others # Via Stefan Hajnoczi * stefanha/block: vmdk: fix VMFS extent parsing vmdk: Only read cid from image file when opening virtio: Remove unneeded memcpy block/raw-win32: Always use -errno in hdev_open blockdev: fix cdrom read_only flag sd: Avoid access to NULL BlockDriverState hmp: drop bogus "[not inserted]" Message-id: 1382105915-27735-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-10-18Merge remote-tracking branch 'bonzini/iommu-for-anthony' into stagingAnthony Liguori3-6/+3
# By Paolo Bonzini (10) and others # Via Paolo Bonzini * bonzini/iommu-for-anthony: exec: remove qemu_safe_ram_ptr icount: make it thread-safe icount: document (future) locking rules for icount icount: prepare the code for future races in calling qemu_clock_warp icount: reorganize icount_warp_rt icount: use cpu_get_icount() directly timer: add timer_mod_anticipate and timer_mod_anticipate_ns timer: extract timer_mod_ns_locked and timerlist_rearm timer: make qemu_clock_enable sync between disable and timer's cb qemu-thread: add QemuEvent timer: protect timers_state's clock with seqlock seqlock: introduce read-write seqlock vga: Mark relevant portio lists regions as coalesced MMIO flushing cirrus: Mark vga io region as coalesced MMIO flushing portio: Allow to mark portio lists as coalesced MMIO flushing compatfd: switch to QemuThread memory: fix 128 arithmetic in info mtree Message-id: 1382024935-28297-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-10-18Merge remote-tracking branch 'bonzini/configure' into stagingAnthony Liguori1-1/+1
# By Peter Maydell (3) and Ákos Kovács (2) # Via Paolo Bonzini * bonzini/configure: ui/Makefile.objs: delete unnecessary cocoa.o dependency default-configs/: CONFIG_GDBSTUB_XML removed Makefile.target: CONFIG_NO_* variables removed rules.mak: New string testing functions rules.mak: New logical functions for handling y/n values
2013-10-18net/rtl8139: update network information when macaddr is changed in guestAmos Kong1-1/+5
rtl8139 has same problem as e1000, nic info isn't updated when macaddr is changed in guest. This patch updates the nic info when the last bit of macaddr is written. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-10-18net/e1000: update network information when macaddr is changed in guestAmos Kong1-0/+8
If we change macaddr in guest by 'ifconfig eth0 hw ether 12:12:12:34:35:36', the mac register of e1000 is already updated, but we don't update network information in qemu. Therefor, the information in monitor is wrong. This patch updates nic info when the second part of macaddr is written. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-10-18net: update nic info during device resetAmos Kong2-0/+2
macaddr is reset during device reset, but nic info isn't updated, this problem exists in e1000 & rtl8139 Signed-off-by: Amos Kong <akong@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-10-18virtio: Remove unneeded memcpyStefan Weil1-1/+0
Report from valgrind: ==19521== Source and destination overlap in memcpy(0x31d38938, 0x31d38938, 64) ==19521== at 0x4A0A343: memcpy@@GLIBC_2.14 (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==19521== by 0x42774E: virtio_blk_device_init (virtio-blk.c:686) ==19521== by 0x46EE9E: virtio_device_init (virtio.c:1158) ==19521== by 0x25405E: device_realize (qdev.c:178) ==19521== by 0x2559B5: device_set_realized (qdev.c:699) ==19521== by 0x3A819B: property_set_bool (object.c:1315) ==19521== by 0x3A6CE0: object_property_set (object.c:803) Valgrind is right: blk == &s->blks, so it is a memcpy of 64 byte with source == destination which can be removed. Reported-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-10-17vga: Mark relevant portio lists regions as coalesced MMIO flushingJan Kiszka2-4/+2
This allows to remove the explicit qemu_flush_coalesced_mmio_buffer calls. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-10-17cirrus: Mark vga io region as coalesced MMIO flushingJan Kiszka1-2/+1
This allows to remove the explicit qemu_flush_coalesced_mmio_buffer calls - the memory core will invoke them now. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-10-17spice: fix multihead supportGerd Hoffmann1-2/+1
This patch fixes spice display initialization to handle multihead properly. spice-core now keeps track of which QemuConsole has a spice display channel attached to it and which has not. It also manages display channel ids. spice-display looks at all QemuConsoles and will pick up any graphic console not yet bound to a spice channel (which in practice are all non-qxl graphic devices). Result is that (a) you'll get a spice client window for each graphical device now (first only without this patch), and (b) mixing qxl and non-qxl vga cards works properly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-10-17spice: replace use of deprecated APIMarc-André Lureau1-8/+8
hose API are deprecated since 0.11, and qemu depends on 0.12 already. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-10-17sd: Avoid access to NULL BlockDriverStateAndreas Färber1-1/+1
Commit 4f8a066b5fc254eeaabbbde56ba4f5b29cc68fdf (blockdev: Remove IF_* check for read-only blockdev_init) added a usage of bdrv_is_read_only() to sd_init(), which is called for versatilepb, versatileab and xilinx-zynq-a9 machines among others with NULL argument by default, causing the new qom-test to fail. Add a check to prevent this. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-10-16Makefile.target: CONFIG_NO_* variables removedÁkos Kovács1-1/+1
CONFIG_NO_* variables replaced with the lnot logical function Signed-off-by: Ákos Kovács <akoskovacs@gmx.com> [PMM: fixed a few CONFIG_NO_* uses that were missed] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-10-14Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-20131010.0' ↵Anthony Liguori1-109/+518
into staging vfio-pci updates include: - Forgotten MSI affinity patch posted several months ago - Lazy option ROM loading to delay load until after device/bus resets - Error reporting cleanups - PCI hot reset support introduced with Linux v3.12 development kernels - Debug build fix for int128 The lazy ROM loading and hot reset should help VGA assignment as we can now do a bus reset when there are multiple devices on the bus, ex. multi-function graphics and audio cards. # gpg: Signature made Thu 10 Oct 2013 11:26:39 AM PDT using RSA key ID 3BB08B22 # gpg: Can't check signature: public key not found # By Alex Williamson (7) and Alexey Kardashevskiy (1) # Via Alex Williamson * awilliam/tags/vfio-pci-for-qemu-20131010.0: vfio-pci: Fix endian issues in vfio_pci_size_rom() vfio-pci: Add dummy PCI ROM write accessor vfio: Fix debug output for int128 values vfio-pci: Implement PCI hot reset vfio-pci: Cleanup error_reports vfio-pci: Lazy PCI option ROM loading vfio-pci: Test device reset capabilities vfio-pci: Add support for MSI affinity Message-id: 20131010184122.31667.28382.stgit@bling.home Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-10-11blockdev: Remove IF_* check for read-only blockdev_initKevin Wolf9-0/+38
IF_NONE allows read-only, which makes forbidding it in this place for other types pretty much pointless. Instead, make sure that all devices for which the check would have errored out check in their init function that they don't get a read-only BlockDriverState. This catches even cases where IF_NONE and -device is used. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-10-11ahci: set ahci mode on resetMichael S. Tsirkin1-1/+9
ATM we set AHCI mode on 1st GHC write. Spec says we should set it on reset. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-10-10Merge remote-tracking branch 'sstabellini/xen-2013-10-10' into stagingAnthony Liguori2-13/+7
# By Matthew Daley (1) and Roger Pau Monné (1) # Via Stefano Stabellini * sstabellini/xen-2013-10-10: qemu/xen: make use of xenstore relative paths xen_disk: mark ioreq as mapped before unmapping in error case
2013-10-10Merge remote-tracking branch 'bonzini/scsi-next' into stagingAnthony Liguori1-11/+34
# By Asias He (1) and Peter Lieven (1) # Via Paolo Bonzini * bonzini/scsi-next: scsi: Allocate SCSITargetReq r->buf dynamically [CVE-2013-4344] block/iscsi: reenable iscsi_co_get_block_status Message-id: 1381332391-8781-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-10-10qemu/xen: make use of xenstore relative pathsRoger Pau Monné1-13/+6
Qemu has several hardcoded xenstore paths that are only valid on Dom0. Attempts to launch a Qemu instance (to act as a userspace backend for PV disks) will fail because Qemu is not able to access those paths when running on a domain different than Dom0. Instead make the xenstore paths relative to the domain where Qemu is actually running. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> Cc: xen-devel@lists.xenproject.org Cc: Anthony PERARD <anthony.perard@citrix.com>
2013-10-10xen_disk: mark ioreq as mapped before unmapping in error caseMatthew Daley1-0/+1
Commit 4472beae modified the semantics of ioreq_{un,}map so that they are idempotent if called when they're not needed (ie., twice in a row). However, it neglected to handle the case where batch mapping is not being used (the default), and one of the grants fails to map. In this case, ioreq_unmap will be called to unwind and unmap any mappings already performed, but ioreq_unmap simply returns due to the aforementioned change (the ioreq has not already been marked as mapped). The frontend user can therefore force xen_disk to leak grant mappings, a per-domain limited resource. Fix by marking the ioreq as mapped before calling ioreq_unmap in this situation. Signed-off-by: Matthew Daley <mattjd@gmail.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2013-10-09scsi: Allocate SCSITargetReq r->buf dynamically [CVE-2013-4344]Asias He1-11/+34
r->buf is hardcoded to 2056 which is (256 + 1) * 8, allowing 256 luns at most. If more than 256 luns are specified by user, we have buffer overflow in scsi_target_emulate_report_luns. To fix, we allocate the buffer dynamically. Signed-off-by: Asias He <asias@redhat.com> Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-10-05hw/9pfs: Fix errno value for xattr functionsDaniel P. Berrange1-3/+3
If there is no operation driver for the xattr type the functions return '-1' and set errno to '-EOPNOTSUPP'. When the calling code sets 'ret = -errno' this turns into a large positive number. In Linux 3.11, the kernel has switched to using 9p version 9p2000.L, instead of 9p2000.u, which enables support for xattr operations. This on its own is harmless, but for another change which makes it request the xattr with a name 'security.capability'. The result is that the guest sees a succesful return of 95 bytes of data, instead of a failure with errno set to 95. Since the kernel expects a maximum of 20 bytes for an xattr return this gets translated to the unexpected errno ERANGE. This all means that when running a binary off a 9p fs in 3.11 kernels you get a fun result of: # ./date sh: ./date: Numerical result out of range The only workaround is to pass 'version=9p2000.u' when mounting the 9p fs in the guest, to disable all use of xattrs. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-10-04vfio-pci: Fix endian issues in vfio_pci_size_rom()Alex Williamson1-2/+2
VFIO is always little endian so do byte swapping of our mask on the way in and byte swapping of the size on the way out. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2013-10-04vfio-pci: Add dummy PCI ROM write accessorAlex Williamson1-0/+6
Just to be sure we don't jump off any NULL pointer cliffs. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
2013-10-04kvmvapic: Prevent reading beyond the end of guest RAMJan Kiszka1-0/+3
rom_state_paddr is guest provided (caller address of outw(VAPIC_PORT) + writen 16-bit value) and can be influenced to point beyond the end of the host memory backing the guest's RAM. Make sure we do not use this pointer to actually read beyond the limits. Reading arbitrary guest bytes is harmless, the guest kernel has to manage access to this I/O port anyway. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-10-03vfio: Fix debug output for int128 valuesAlexey Kardashevskiy1-2/+4
Memory regions can easily be 2^64 byte long and therefore overflow for just a bit but that is enough for int128_get64() to assert. This takes care of debug printing of huge section sizes. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2013-10-02vfio-pci: Implement PCI hot resetAlex Williamson1-38/+300
Now that VFIO has a PCI hot reset interface, take advantage of it. There are two modes that we need to consider. The first is when only one device within the set of devices affected is actually assigned to the guest. In this case the other devices are are just held by VFIO for isolation and we can pretend they're not there, doing an entire bus reset whenever the device reset callback is triggered. Supporting this case separately allows us to do the best reset we can do of the device even if the device is hotplugged. The second mode is when multiple affected devices are all exposed to the guest. In this case we can only do a hot reset when the entire system is being reset. However, this also allows us to track which individual devices are affected by a reset and only do them once. We split our reset function into pre- and post-reset helper functions prioritize the types of device resets available to us, and create separate _one vs _multi reset interfaces to handle the distinct cases above. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2013-10-02pci-ohci: Add missing 'break' in ohci_service_tdJán Veselý1-0/+2
Device communication errors need to be reported to driver. Add a debug message while at it. Signed-off-by: Jan Vesely <jano.vesely@gmail.com> Acked-by: Gerd Hoffmann <kraxel@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-10-02sh4: Fix serial line access for Linux kernels later than 3.2Guenter Roeck1-2/+0
With Linux kernel version 3.3 or later, qemu fails with the following message: sh_serial: unsupported read from 0x18 Aborted Reported-and-analyzed-by: Rob Landley <rob@landley.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-10-02hw/alpha: Fix compiler warning (integer constant is too large)Stefan Weil1-1/+1
From buildbot default_i386_rhel61: CC alpha-softmmu/hw/alpha/typhoon.o hw/alpha/typhoon.c: In function 'typhoon_translate_iommu': hw/alpha/typhoon.c:703: warning: integer constant is too large for 'long' type hw/alpha/typhoon.c:703: warning: integer constant is too large for 'long' type Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-10-02vfio-pci: Cleanup error_reportsAlex Williamson1-12/+12
Remove carriage returns and tweak formatting for error_reports. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>