msi: Invoke msi/msix_reset from PCI core
There is no point in pushing this burden to the devices, they tend toforget to call them (like intel-hda, ahci, xhci did). Instead, resetfunctions are now called from pci_device_reset. They do nothing ifMSI/MSI-X is not in use....
msi: Guard msi/msix_write_config with msi_present
Terminate msi/msix_write_config early if support is not enabled. Thisallows to remove checks at the caller site if MSI is optional.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
ahci: Fix reset of MSI function
Call msi_reset on device reset as still required by the core.
CC: Alexander Graf <agraf@suse.de>CC: qemu-stable@nongnu.orgSigned-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
intel-hda: Fix reset of MSI function
CC: Gerd Hoffmann <kraxel@redhat.com>CC: qemu-stable@nongnu.orgSigned-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
ahci: Clean up reset functions
Properly register reset functions via the device class.
CC: Alexander Graf <agraf@suse.de>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
msi: Guard msi_reset with msi_present
shpc: unparent device before free
Recent core change removed unparentso we need to do this in all callers now.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
rtl8139: honor RxOverflow flag in can_receive method
Some drivers (Linux' 8139too among them) rely on the NICinjecting an interrupt in the event of a receive buffer overflowand, accordingly, set the RxOverflow bit in the interruptmask. Unfortunately rtl8139's can_receive method ignores the...
target-microblaze: lwx/swx: first implementation
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Revert "rtl8139: do the network/host communication only in normal operating mode"
This reverts commit ff71f2e8cacefae99179993204172bc65e4303df. This is becausethe linux 8139cp driver would leave the card in "Config Register Write Enable" mode after the eeprom were read or write ( which is unexpected in the spec...
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Update version to open the 1.2 development branch
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Update version for 1.1.0 release
Update version for 1.1.0-rc4 release
Merge remote-tracking branch 'origin/master' into staging
pc-bios: Update OpenBIOS images
Update OpenBIOS images to r1060 built from submodule.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ahci: SATA FIS is 20 bytes, not 0x20
As in the SATA and AHCI specifications, a FIS is 5 Dwords of 4 byteseach, which comes to 20 bytes (decimal), not 0x20.
Signed-off-by: Daniel Verkamp <daniel@drv.nu>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: Fix geometry sector calculation
Currently the sector value for the geometry is masked, even if theuser usesa command line parameter that explicitely gives a number.This breaks dasd devices on s390. A dasd device can havea physical block size of 4096 (== same for logical block size)...
block: prevent snapshot mode $TMPDIR symlink attack
In snapshot mode, bdrv_open creates an empty temporary file withoutchecking for mkstemp or close failure, and ignoring the possibilityof a buffer overrun given a surprisingly long $TMPDIR.Change the get_tmp_filename function to return int (not void),...
sheepdog: fix return value of do_load_save_vm_state
bdrv_save_vmstate and bdrv_load_vmstate should return the vmstate sizeon success, and -errno on error.
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio: Fix compiler warning for non Linux hosts
The local variables ret, i are only used if linux is defined.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Merge remote-tracking branch 'mdroth/qga-pull-5-29-12-v2' into staging
Expose CPUID leaf 7 only for -cpu host
Changes v2 -> v3; - Check for kvm_enabled() before setting cpuid_7_0_ebx_features
Changes v1 -> v2: - Use kvm_arch_get_supported_cpuid() instead of host_cpuid() on cpu_x86_fill_host().
We should use GET_SUPPORTED_CPUID for all bits on "-cpu host"...
vnc: fix segfault in vnc_display_pw_expire()
NULL pointer dereference in case no vnc server is configured.Catch this and return -EINVAL like vnc_display_password() does.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
xhci: add usage info to docs
qemu-ga: avoid blocking on atime update when reading /etc/mtab
Currently we re-read/re-process /etc/mtab to get an updated list ofmounts when guest-fsfreeze-thaw is called. This can cause an atimeupdate on /etc/mtab, which will block if we're in a frozen state....
qemu-ga: Fix use of environ on Darwin
Use _NSGetEnviron() helper to access the environment.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>Cc: Charlie Somerville <charlie@charliesomerville.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
vga: fix vram double-mapping with -vga std and -M pc-0.12
With pc-0.12, we map the video RAM both through the PCI BAR (the guest doesthis) and through a fixed mapping at 0xe0000000. The memory API doesn't allowthis double map, and aborts.
Fix by using an alias....
fix multiboot loading if load_end_addr == 0
The previous multiboot load code did not treat the case whereload_end_addr was 0 specially. The multiboot specification says thefollowing: * load_end_addr Contains the physical address of the end of the data segment....
pci: call object_unparent() before free_qdev()
Start VM with 8 multiple-function block devs, hot-removingthose block devs by 'device_del ...' would cause qemu abort.
| (qemu) device_del virti0-0-0 | (qemu) ** |ERROR:qom/object.c:389:object_delete: assertion failed: (obj->ref == 0)...
Merge remote-tracking branch 'afaerber-or/cocoa-for-upstream' into staging
cocoa: Suppress Cocoa frontend for -qtest
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
arch_init: Fix AltiVec build on Darwin/ppc
Commit f29a56147b66845914d0a645bf9b4c5bb9a6af57 (implement-no-user-config command-line option (v3)) introduced uses of boolin arch_init.c. Shortly before that usage is support code forAltiVec (conditional to ALTIVEC)....
Merge remote-tracking branch 'sstabellini/for_1.1_rc3' into staging
Merge remote-tracking branch 'mdroth/qga-pull-5-24-12' into staging
Merge remote-tracking branch 'kiszka/queues/slirp' into staging
Merge remote-tracking branch 'bonzini/scsi-next' into staging
slirp: Avoid redefining MAX_TCPOPTLEN
MAX_TCPOPTLEN is being defined as 32. Darwin already has it as 40,causing a warning. The value is only used to declare an array,into which currently 4 bytes are written at most.
Therefore always override MAX_TCPOPTLEN for now....
slirp: Avoid statements without effect on Big Endian host
Darwin has HTON*/NTOH* macros that on BE simply return the argument.This is incompatible with SLIRP's use of these macros as a statement.
Undefine the macros in the HOST_WORDS_BIGENDIAN code path to redefine...
ISCSI: Switch to using READ16/WRITE16 for I/O to the LUN
This allows using LUNs bigger than 2TB. Keep using READ10 for otherdevice types such as MMC.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
ISCSI: Only call READCAPACITY16 for SBC devices, use READCAPACITY10 for MMC
ISCSI: change num_blocks to 64-bit
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ISCSI: get device type at connection time
This is needed to avoid READ CAPACITY for MMC devices.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ISCSI: redo how we set up the events
Call qemu_notify_event() after updating events. Otherwise, If we addan event for -is-writeable but the socket is already writeable theremay be a delay before the event callback is actually triggered.
Those delays would in particular hurt performance during BIOS boot and...
slirp: Untangle TCPOLEN_* from TCPOPT_*
Commit b72210568ef0c0fb141a01cffb71a09c4efa0364 (slirp: clean upconflicts with system headers) enclosed TCPOLEN_MAXSEG with an #ifdefTCPOPT_EOL. This broke the build on illumos, which has TCPOPT_*but not TCPOLEN_*....
tcg/ppc: Handle _CALL_DARWIN being undefined on Darwin
powerpc-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5577)does not define _CALL_DARWIN, leading to unexpected behavior w.r.t.register clobbering and stack frame layout.
Since _CALL_DARWIN is a reserved identifier, define a custom...
fdc-test: introduced qtest no_media_on_start and cmos qtest for floppy
As default a guest has always one floppy drive so 0x10 byte in CMOShas to have 0x40 value. Higher 4 bits means that the first floppy driveis 1.44 Mb 3"5 drive and lower 4 bits means the second drive is not present....
fdc: fix media detection
We have to set up 'media_changed' after guest start so floppy drivercould detect that there is no media in drive. For this purpose we call'fdctrl_change_cb' instead of 'fd_revalidate' in 'fdctrl_connect_drives'.'fd_revalidate' is called inside 'fdctrl_change_cb'....
fdc: floppy drive should be visible after start without media
If you start guest with floppy drive but without media inserted, gueststill should see floppy drive pressent.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-iotests: mark 035 qcow2-only
The 035 parallel aio write test relies on knowledge of qcow2 metadatalayout to stress parallel L2 table accesses. This only works for qcow2unless we add additional calculations for qed or other formats.
Mark this test as qcow2-only....
qcow2: don't leak buffer for unexpected qcow_version in header
Signed-off-by: Jim Meyering <meyering@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img: Explain how rebase operation can be used to perform a 'diff' operation.
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
sheepdog: mark image as snapshot when tag is specified
When a snapshot tag is specified in the filename, the opened image isa snapshot.
sheepdog: return -errno on error
On error, BlockDriver APIs should return -errno instead of -1.
sheepdog: use heap instead of stack for BDRVSheepdogState
bdrv_create() is called in coroutine context now, so we cannot usemore stack than 1 MB in the function if we use ucontext coroutine.This patch allocates BDRVSheepdogState, whose size is 4 MB, on the...
qcow2: Check qcow2_alloc_clusters_at() return value
When using qcow2_alloc_clusters_at(), the cluster allocation codechecked the wrong variable for an error code.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi: declare vmstate_info_scsi_requests to be static
Signed-off-by: Jim Meyering <meyering@redhat.com>
qemu-ga: Fix missing environ declaration
Commit 3674838cd05268954bb6473239cd7f700a79bf0f uses the environ globalvariable, but is relying on environ to be declared somewhere else.
This worked for me because on F16 environ is declared in <unistd.h>, butthat doesn't happen in OpenBSD for example, causing a build failure....
configure: check if environ is declared
Some systems may declare environ automatically, others don't. Check for it.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
audio: Always call fini on exit
Not only clean up enabled voices but any registered one. Backends likepulsaudio rely on unconditional fini handler invocations.
This fixes "Memory pool destroyed but not all memory blocks freed!" warnings on VM shutdowns when pa is used and lockups of QEMU on shutdown...
es1370: Fix debug code
When DEBUG_ES1370 is defined, the compiler shows these warnings:
hw/es1370.c: In function ?es1370_update_voices?:hw/es1370.c:414: warning: format ?%d? expects type ?int?, but argument 3 has type ?size_t?hw/es1370.c: In function ?es1370_writel?:...
Update version for 1.1.0-rc3
qdev: Fix memory leak
The str allocated in visit_type_str was not freed.
The visit_type_str function is an input visitor(<QMP/String/etc>-to-native)here, it will allocate memory for caller, so the caller is responsible forfreeing the memory.
Reviewed-by: Stefan Weil <sw@weilnetz.de>...
xen: Fix PV-on-HVM
In the context of PV-on-HVM under Xen, the emulated nics are supposed to beunplug before the guest drivers are initialized, when the guest write to aspecific IO port.
Without this patch, the guest end up with two nics with the same MAC, the...
use an uint64_t for the max_sz parameter in load_image_targphys
Allow load_image_targphys to load files on systems with more than 2G ofemulated memory by changing the max_sz parameter from an int to anuint64_t.
Reviewed-by: Andreas F=E4rber <afaerber@suse.de>...
virtio-blk: report non-zero status when failing SG_IO requests
Linux really looks only at scsi->errors for SG_IO requests; it doesnot look at the virtio request status at all. Because of this, whena SG_IO request is failed early with virtio_blk_req_complete(req,...
virtio-blk: blockdev_mark_auto_del is transport-independent
Move it from virtio_blk_exit_pci to virtio_blk_exit.
This is included here because the next patch removes proxy->block.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-blk: define VirtIOBlkConf
We will have to add another field to the virtio-blk configuration inthe next patch. Avoid a proliferation of arguments to virtio_blk_init.
virtio-blk: always enable VIRTIO_BLK_F_SCSI
VIRTIO_BLK_F_SCSI is supposed to mean whether the host can parseSCSI requests, not execute them. You could run QEMU with scsi=onand a file-backed disk, and QEMU would fail all SCSI requests eventhough it advertises VIRTIO_BLK_F_SCSI....
virtio: check virtio_load return code
Otherwise we crash on error.
Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>Signed-off-by: Orit Wassermann <owasserm@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'mdroth/qga-pull-5-15-12' into staging
tests: Add rtc-test (fix test regression)
Commit 93e9eb6808c886f5f1c903b7ced1eed65de2ba39 added fdc-test,but accidentally removed rtc-test because check-qtest-i386-y wasnot enhanced but set twice.
This patch adds rtc-test again (and sorts both tests alphabetically)....
kvm: Introduce kvm_irqchip_add/remove_irqfd
Add services to associate an eventfd file descriptor as input with anIRQ line as output. Such a line can be an input pin of an in-kernelirqchip or a virtual line returned by kvm_irqchip_add_route.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
kvm: Enable use of kvm_irqchip_in_kernel in hwlib code
Provide a dummy kvm_kernel_irqchip so that kvm_irqchip_in_kernel can beused by code that is not under CONFIG_KVM protection.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Avi Kivity <avi@redhat.com>
msix: Add msix_nr_vectors_allocated
Analogously to msi_nr_vectors_allocated, add a service for MSI-X. Willbe used by the virtio-pci layer.
virtio/vhost: Add support for KVM in-kernel MSI injection
Make use of the new vector notifier to track changes of the MSI-Xconfiguration of virtio PCI devices. On enabling events, we establishthe required virtual IRQ to MSI-X message route and link the signaling...
msix: Factor out msix_get_message
This helper will also be used by the upcoming config notifier.
msix: Invoke msix_handle_mask_update on msix_mask_all
In preparation of firing vector notifiers on mask changes, callmsix_handle_mask_update also from msix_mask_all. So far, this will haveno real effect.
msix: Introduce vector notifiers
Vector notifiers shall be triggered by the MSI/MSI-X core whenever arelevant configuration change is programmed by the guest. In case ofMSI-X, changes are reported when the effective mask (global &&per-vector) alters its state. On unmask, the current vector...
kvm: Rename kvm_irqchip_add_route to kvm_irqchip_add_irq_route
We will add kvm_irqchip_add_msi_route, so let's make the differenceclearer.
kvm: Introduce kvm_irqchip_add_msi_route
Add a service that establishes a static route from a virtual IRQ line toan MSI message. Will be used for IRQFD and device assignment. As we willuse this service outside of CONFIG_KVM protected code, stub it properly....
kvm: Publicize kvm_irqchip_release_virq
This allows to drop routes created by kvm_irqchip_add_irq/msi_routeagain.
kvm: Make kvm_irqchip_commit_routes an internal service
Automatically commit route changes after kvm_add_routing_entry andkvm_irqchip_release_virq. There is no performance relevant use case forwhich collecting multiple route changes is beneficial. This makes...
tests: Fix linker failure for fdc-test
When QEMU was built with the simple trace backend, linking failed:
LINK tests/fdc-testoslib-posix.o: In function `trace_qemu_memalign':qemu/bin/debug/x86/./trace.h:31: undefined reference to `trace3'oslib-posix.o: In function `trace_qemu_vmalloc':...
mips: Fix BC1ANY24F instructions
There's some dodgy application of De Morgan's law in the emulationof the MIPS BC1ANY24F instructions: they end up branching onlyif all CCs are false, rather than if one CC is.
Tested on mips64-linux-gnu, where it fixes the GCC MIPS3D tests....
linux-user: Fix stale tbs after mmap
If we execute linux-user code that does the following:
we end up executing a stale cached tb that contains translated code...
virtio-pci: add missing 'static'
There are no outside references to virtio_portio.Add missing 'static' specifier.
Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sparc64: fix initrd loading
Initrd load address is too low, it conflicts with kernel loadaddress:rom: requested regions overlap (rom phdr #0: /tmp/vmlinux-debian-6.0.4-sparc64. free=0x0000000000742519, addr=0x0000000000400000)rom loading failed
Fix by making the initrd address variable, load initrd after kernel...
audio: split IN_T into two separate constants
Split IN_T into BSIZE and ITYPE, to avoid expansion if the OS hasdefined macros for the intX_t and uintX_t types. The IN_T constant isthen defined in mixeng_template.h so it can be used by thefunctions/macros on this header file....
target-microblaze: impelemented swapx instructions
Implemented the swapb and swaph byte/halfword reversal instructions addedto microblaze v8.30
kvm: update vmxcap for EPT A/D, INVPCID, RDRAND, VMFUNC
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Call xc_domain_shutdown with the reboot flag when the guest requests a reboot.
Signed-off-by: John V. Baboval <john.baboval@virtualcomputer.com>Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
xen_disk: remove syncwrite option
This patch removes a dead option.
The same can be achieved removing BDRV_O_NOCACHE and BDRV_O_CACHE_WBfrom the flags passed to bdrv_open.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen_disk: use bdrv_aio_flush instead of bdrv_flush
Use bdrv_aio_flush instead of bdrv_flush.
Make sure to call bdrv_aio_writev/readv after the presync bdrv_aio_flush is fullycompleted and make sure to call the postsync bdrv_aio_flush afterbdrv_aio_writev/readv is fully completed....
xen_disk: properly update stats in ioreq_release()
While for the "normal" case (called from blk_send_response_all())decrementing requests_finished is correct, doing so in the parse errorcase is wrong; requests_inflight needs to be decremented instead....
xen: disable rtc_clock
rtc_clock is only used by the RTC emulator (mc146818rtc.c), however Xenhas its own RTC emulator in the hypervisor so we can disable it.