Revert "Revert "rtl8139: do the network/host communication only in normal operating mode""
This reverts commit 9c92bf7f6c3f675e60b8ba8a5287bb88ea1eac36.
Per Jason's request.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.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
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)...
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>
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 'sstabellini/for_1.1_rc3' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
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>
scsi: declare vmstate_info_scsi_requests to be static
Signed-off-by: Jim Meyering <meyering@redhat.com>
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?:...
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>
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.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Avi Kivity <avi@redhat.com>
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.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
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: 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...
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...
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: do not initialize the interval timer and PCSPK emulator
PIT and PCSPK are emulated by the hypervisor so we don't need to emulatethem in Qemu: this patch prevents Qemu from waking up needlessly atPIT_FREQ on Xen.
kvm: x86: Wire up MSI support for in-kernel irqchip
Catch writes to the MSI MMIO region in the KVM APIC and forward them tothe kernel. Provide the kernel support GSI routing, this allows toenable MSI support also for in-kernel irqchip mode.
Introduce MSIMessage structure
Will be used for generating and distributing MSI messages, both inemulation mode and under KVM.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
pc: Enable MSI support at APIC level
Push msi_supported enabling to the APIC implementations where we canencapsulate the decision more cleanly, hiding the details from thegeneric code.
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Merge remote-tracking branch 'afaerber-or/qom-1.1' into staging
Merge remote-tracking branch 'kraxel/usb.50' into staging
Merge remote-tracking branch 'spice/spice.v55' into staging
Merge remote-tracking branch 'sweil/for-1.1' into staging
qdev: fix -device foo,?
Since most property types do not have a parse property now, this wasbroken. Fix it by looking at the setter instead.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Acked-by: Andreas F=E4rber <afaerber@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
usb-host: handle guest-issued clear halt
Most important here is to update our internal endpoint state so we knowthe endpoint isn't in halted state any more. Without this usb-hosttries to clear halt again with the next data transfer submitted. Doingthis twice is (a) not correct and (b) confuses some usb devices,...
qxl: set size of PCI IO BAR correctly (16) for revision 2
Also move it up into switch(qxl->revision) block
Signed-off-by: Uri Lublin <uril@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
fix some common typos
These were identified using: http://github.com/lyda/misspell-checkand run like this to create a bourne shell script using GNU sed's-i option:
git ls-files|grep -vF .bin | misspellings -f - |grep -v '^ERROR:' |perl \-pe 's/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/sed -i '\''${2}s!$3!$4!'\'' $1/'...
mips_fulong2e: Don't register "cpu" VMState twice
We have the following simplified callgraph in mips_fulong2e_init():
cpu_init() => cpu_mips_init() object_new() mips_cpu_initfn() cpu_exec_init() register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION,...
pc: Add back PCI.rombar compat property
This was erroneously dropped in d6c730086cbf24382eb8cff25551798769edfd84(pc: reduce duplication in compat machine types).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>...
qdev: Fix adding of ptr properties
ptr properties have neither a get/set or a print/parse which means that whenthey're added they aren't treated as static or legacy properties.
Just assume properties like this are legacy properties and treat them as such....
qdev: Use object_property_print() in info qtree
Otherwise, non-string properties without a legacy counterpart are missed.Also fix error propagation in object_property_print() itself.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
sun4u: implement interrupt clearing registers
Implement registers for clearing OBIO and PCI interrupts
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sun4u: initialize OBIO interrupt mappings
Similarly to PCI interrupt mappings, the OBIO ones have to be initialized.
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
Merge remote-tracking branch 'bonzini/scsi-next' into staging
Merge remote-tracking branch 'spice/spice.v54' into staging
Merge remote-tracking branch 'sweil/fixes' into staging
rtl8139: fix regression in TxStatus/TxAddr read
Commit afe0a595356192 added byte reads for TxStatus/TxAddr, butbroke 32-bit reads; the mask generation
(1 << (8 * size)) - 1
is unspecified in C for size >= sizeof(int), and in fact returns 0on x86....
fdc: simplify media change handling
This also (partly) fixes IBM OS/2 Warp 4.0 floppy installation, wherenot all floppies have the same format (2x80x18 for the first ones,2x80x23 for the next ones).
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>...
hw/ac97: Make a bunch of mixer registers read only
The Linux ac97 driver tries to see if optional things like video inputvolume control are available in 2 ways:1) See if the mute bit is set after reset, if it is no further tests are done2) If the mute bit is not set it does a write/read test of the mute bit...
hw/ac97: Use AC97_Record_Gain_Mute not AC97_Line_In_Volume_Mute
After commit 19677a380a70348134ed7650b294522617eb03fc:"hw/ac97: add support for volume control"
We are (correctly) using AC97_Record_Gain_Mute and not AC97_Line_In_Volume_Mutefor recording volume, but various places in hw/ac97 were still assumimg that...
hw/ac97: Mask out unused bits of volume controls
The Linux ac97 drivers does a number of register read/write tests tosee how much resolution a volume control actually has.
This patch takes this into account by masking out any bits written toa volume control reg which should not be there according to the spec....
hw/ac97: Mask out the EAPD bit on Powerdown Ctrl/Stat writes
The Linux AC97 driver tests this bit to decide wether or not to showan External amplifier toggle control.
This patch was also tested with a Windows XP guest without any issues.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
hw/ac97: Fix log message in mixer_load
Fix a small copy and paste error in logging.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: malc <av1474@comtv.ru>
scsi: parse 16-byte tape CDBs
The transfer length for these commands is different from the transferlength of the corresponding disk commands, so parse it specially.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi: do not require a minimum allocation length for INQUIRY
The requirements on the INQUIRY buffer size are not in my copy of SPC(SPC-4 r27) and not observed by LIO. Rip them out.
scsi: do not require a minimum allocation length for REQUEST SENSE
The requirements on the REQUEST SENSE buffer size are not in my copy of SPC(SPC-4 r27) and not observed by LIO. Rip them out.
scsi: set VALID bit to 0 in fixed format sense data
The INFORMATION field (bytes 3..6) is never set by QEMU, so the VALIDbit must be 0.
scsi: remove useless debug messages
Optional inquiry information is declared obsolete in the latest versionsof the standard; invalid CDBs or unsupported VPD pages are supportedcan be diagnosed with trace_scsi_inquiry.
scsi: Add assertion for use-after-free errors
The QEMU emulation which is currently used with Raspberry PI images(qemu-system-arm -M versatilepb ...) accesses memory which was freed.
Valgrind output (extract):
scsi: do not report bogus overruns for commands in the 0x00-0x1F range
Interpreting cdb4 == 0 as a request to transfer 256 blocks is onlyneeded for READ_6 and WRITE_6. No other command in that range needsthat special-casing, and the resulting overrun breaks scsi-testsuite's...
scsi-disk: add dpofua property
Linux expects REQ_FUA to be advertised only if WRITE+FUA is faster thanWRITE+SYNCHRONIZE CACHE, so we should not set the DPOFUA bit. However,it is useful to have it for testing purposes, so add a qdev property toset it....
scsi: change "removable" field to host many features
It is pointless to add a uint32_t field for every new feature.Since we will need a new feature soon, convert accesses to "removable" to look at bit 0 only.
scsi: fix refcounting for reads
Recently introduced FUA support also gave us a use-after-freeof the BlockAcctCookie within a SCSIDiskReq, due to unbalancedreference counting.
The patch fixes this by making scsi_do_read look like a combinationof scsi_*_complete + scsi_*_data. It does both a ref (like...
scsi: fix WRITE SAME transfer length and direction
scsi: Specify the xfer direction for UNMAP and ATA_PASSTHROUGH commands
scsi_cmd_xfer_mode() is used to specify the xfer direction for SCSIcommands that come in from the guest. If the direction is set incorrectlythis will eventually cause QEMU to kernel-panic the guest....
scsi: prevent data transfer overflow
Avoid sending more than 2GB of data, as that can cause overflowsin int32_t variables.
hw/qxl.c: qxl_phys2virt: replace panics with guest_bug
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qxl: check for NULL return from qxl_phys2virt
qxl: replace panic with guest bug in qxl_track_command
qxl: fix > 80 chars line
qxl: don't abort on guest trigerrable ring indices mismatch
qxl: cleanup s/__FUNCTION__/__func__/
qxl: interface_notify_update: remove guest trigerrable abort
qxl: qxl_add_memslot: remove guest trigerrable panics
qxl: ioport_write: remove guest trigerrable abort
qxl: don't assert on guest create_guest_primary
qdev: Fix memory leak in function set_pci_devfn
Valgrind reported this memory leak which occured very often.
Test scenario:
qemu-system-i386 (no arguments), only BIOS started, terminate withmonitor command (quit).
v2:Use error_free instead of g_free (hint from Andreas Färber, thanks)....
hw/pc_sysfw: Fix memory leak
Valgrind reported this memory leak which occured a few times.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Andreas Färber <afaerber@suse.de>
ATA: Allow WIN_SECURITY_FREEZE_LOCK as nop
When using Windows 8 with an AHCI disk drive, it issues a blue screen.The reason is that WIN_SECURITY_FREEZE_LOCK / CFA_WEAR_LEVEL is notsupported by our ATA implementation, but Windows expects it to be there....
Merge remote-tracking branch 'agraf/s390-for-upstream' into staging
ppce500_spin: Replace assert by hw_error (fixes compiler warning)
The default case in function spin_read should never be reached,therefore the old code used assert(0) to abort QEMU.
This does not work when QEMU is compiled with macro NDEBUG defined.In this case (and also when the compiler does not know that assert...
booke:Use MMU API for creating initial mapping for secondary cpus
Initial Mapping creation for secondary CPU in SMP was missing new MMU API.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
pseries: Implement automatic PAPR VIO address allocation
PAPR virtual IO (VIO) devices require a unique, but otherwise arbitrary,"address" used as a token to the hypercalls which manipulate them.
Currently the pseries machine code does an ok job of allocating these...
pseries: Use the same interrupt swizzling for host bridges as p2p bridges
Currently the pseries PCI code uses a somewhat strange scheme of PCI irqallocation - one per slot up to a maximum that's greater than the usual 4.This scheme more or less worked, because we were able to tell the guest the...
pseries: Fix use of global CPU state
Commit ed120055c7f9b26b5707d3ceabbe5a3f06aaf937 (Implement PAPR VPAfunctions for pSeries shared processor partitions) introduced thederegister_dtl() function and typo "emv" as name of its argument.This went unnoticed because the code in that function can access the...
s390: reset avail and used index on reboot
reset the guest vring avail/used idx fields, otherwise it's possiblethat old values remain in memory which would cause a reboot to failwith a "Guest moved used index" message
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>...