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....
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>
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.
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: fix kernel_commandline handling
The current handling of kernel parameters is broken. The pointeris always valid, even if no -kernel or -append is specified.We must check if the kernel rom address is valid instead,otherwise qemu might segfault.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>...
S390: fix error handling on kernel and initrd failures
If the user specifies a non-existing or non-accessable kernel or initrdqemu does not fail, instead it ipls into the system, which then fallsinto a program check loop due to the zeroed memory with no kernel....
S390: reboot: reset device pages on reboot
This patch fixes reboot on s390 by resetting the devicepage on reboot.
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>Signed-off-by: Alexander Graf <agraf@suse.de>
S390: remove default cdrom, sd-card and floppy support
This patch simply disables CDROM, SD card and floppy support for thes390 virtio machine. Without this patch, a default CDROM drive wouldget added which has currently no backing on s390.
Signed-off-by: Einar Lueck <elelueck@de.ibm.com>...
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>...
vga: Don't switch to 1 x 1 character text screen
Initially, vga_get_text_resolution returns a text resolution of 1 x 1(vga register values are 0).
This is visible during MIPS Malta boot with SDL. It also occurs with thei386 or x86_64 system emulation when it runs in single step mode:...
prep: Move int-ack register from PReP to Raven PCI emulation
Register is one byte-wide (as per specification), so there is no needto specify endianness.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>[AF: Limit access validity to size 1]Signed-off-by: Andreas Färber <andreas.faerber@web.de>
prep: Initialize PC speaker
Speaker init has been added in 506b7ddf889312659b36c667f7ae17bc9e909418,but audio subsystem init was missing.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Andreas Färber <andreas.faerber@web.de>
fdc: Parametrize ISA base, IRQ and DMA
Keep the PC values as defaults but allow to override them for PReP.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Andreas Färber <andreas.faerber@web.de>Reviewed-by: Markus Armbruster <armbru@redhat.com>
isa: Add isa_bus_from_device() method
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Andreas Färber <andreas.faerber@web.de>
i82378/i82374: Do not create DMA controller twice
This fixes a crash in PReP emulation when using DMA controller to accessfloppy drive.
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
target-arm: Move A9 config_base_address reset value to ARMCPU
Move the A9 config_base_address cp15 register reset value toARMCPU. This should become a QOM property so that the Highbankboard can set it without having to pull in cpu-qom.h, but atleast this avoids the implicit dependency on reset ordering...
Merge remote-tracking branch 'kraxel/usb.49' into staging
Merge remote-tracking branch 'amit/master' into staging
pc-sysfw: make sure to call qdev_init
We're not actually calling qdev_init for the pc-sysfw device. Since we createthe canonical path during realize, this was causing an assert to trigger whenattempting to read a link pointing to pc-sysfw.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb: add serial number generator
This patch adds a function which creates unique serial numbers for usbdevices and puts it into use. Windows guests tend to become unhappy ifthey find two identical usb devices in the system. Effects range fromnon-functional devices (with yellow exclamation mark in device manager)...
usb-uhci: update irq line on reset
uhci_reset() clears irq mask and irq status registers, but doesn'tupdate the irq line. Which may result in suspious IRQs after uhcireset. Fix it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>