scsi: reference-count requests
With the next patch, a device may hold SCSIRequest for an indefinitetime. Split a rather big patch, and protect against access errors,by reference counting them.
There is some ugliness in scsi_send_command implementation due to...
lsi: extract lsi_find_by_tag
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Christoph Hellwig <hch@lst.de>
scsi: add tracing of scsi requests
scsi-generic: Remove bogus double complete
scsi-generic scsi_read_complete() should not both call the clientcomplete callback with SCSI_REASON_DATA and callscsi_command_complete(). The former will cause the client to queue anew read or write request, while the later will free the request data...
scsi: introduce scsi_req_data
This abstracts calling the command_complete callback, reducing churnin the following patches.
scsi: introduce SCSIBusOps
There are more operations than a SCSI bus can handle, besides completingcommands. One example, which this series will introduce, is cleaning upafter a request is cancelled.
More long term, a "SCSI bus" can represent the LUNs attached to a...
scsi-generic: do not use a stale aiocb
If a request is canceled after it has been completed, scsi_cancel_iowould pass a stale aiocb to bdrv_aio_cancel. Avoid this.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Christoph Hellwig <hch@lst.de>
Merge remote-tracking branch 'kraxel/CVE-2011-1751' into staging
Merge branch 'trivial-patches' of git://repo.or.cz/qemu/stefanha
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
piix_pci: fix piix3_set_irq_pic()
If pic_irq is greater than 7, the irq level is always 0 on 32bits.
Signed-off-by: TeLeMan <geleman@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/realview.c: Remove duplicate #include line
Remove a duplicate #include of sysbus.h.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/sd.c: Don't complain about SDIO commands CMD52/CMD53
The SDIO specification introduces new commands 52 and 53.Handle as illegal command but do not complain on stderr,as SDIO-aware OSes (including Linux) may legitimately usethese in their probing for presence of an SDIO card....
pSeries: Clean up write-only variables
A few pieces of the pSeries emulation code have variables which are setbut never used, which causes warnings on gcc 4.6. This patch removesthese instances.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
s390x: fix memory detection for guests > 64GB
the s390 memory detection has a 16bit field that specifies the amount ofincrements. This patch adopts the memory size to always fit into thatscheme. This also fixes virtio detection for these guests, since the...
s390x: keep hint on virtio managing size
The s390x virtio bus keeps management information on virtio after the topof the guest's RAM. We need to be able to tell the guest the size of itsRAM (without virtio stuff), but also be able to trap when the guest accesses...
ahci: Fix non-NCQ accesses for LBA > 16bits
AHCI provides two ways of reading/writing data:
1) NCQ 2) ATA commands with the LBA in the command FIS
In the second code path, we didn't handle any LBAs that were bigger than16 bits, so whenever a guest that used high LBA numbers wanted to access...
Ignore pci unplug requests for unpluggable devices (CVE-2011-1751)
This patch makes qemu ignore unplug requests from the guest for pcidevices which are tagged as non-hotpluggable. Trouble spot is thepiix4 chipset with the ISA bridge. Requests to unplug that one will...
blockdev: Store -drive option media in DriveInfo
DriveInfo is closely tied to -drive, and like -drive, it mixesinformation about host and guest part of the block device. UnlikeDriveInfo, BlockDriverState should be about the host part only.
One of the remaining guest bits there is the "type hint". -drive...
scsi: Split qdev "scsi-disk" into "scsi-hd" and "scsi-cd"
A "scsi-disk" is either a hard disk or a CD-ROM, depending on theassociated BlockDriverState's type hint. Unclean; disk vs. CD belongsto the guest part, not the host part.
Have separate qdevs "scsi-hd" and "scsi-cd" to model disk vs. CD in...
ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd"
An "ide-drive" is either a hard disk or a CD-ROM, depending on theassociated BlockDriverState's type hint. Unclean; disk vs. CD belongsto the guest part, not the host part.
Have separate qdevs "ide-hd" and "ide-cd" to model disk vs. CD in...
ahci: Fix crashes on duplicate BH registration
If ahci_dma_set_inactive is called a while there is still a pending BHfrom a previous run, we will crash on the second run ofahci_check_cmd_bh as it overwrites AHCIDevice::check_bh. Avoid thisbroken and redundant duplicate registration....
ide: cleanup warnings
Add \n.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/xen_disk: Remove unused local variable
cppcheck report:hw/xen_disk.c:309: style: Variable 'len' is assigned a value that is never used
Cc: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Turn debug messages into assertions
These printfs aren't really debug messages, but clearly indicate a bug if theyever become effective. Noone uses DEBUG_IDE, let's re-enable the checkunconditionally and make it an assertion instead of printfs in the device...
ahci: Unbreak bar registration
Fix regression of 667bb59: ahci_init initializes ahci.mem, so we have tomove bar registration after it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Conflicts: cpu-all.h
Merge remote-tracking branch 'agraf/xen-next' into staging
PPC: Qdev'ify e500 pci
The e500 PCI controller isn't qdev'ified yet. This leads to severe issueswhen running with -drive.
To be able to use a virtio disk with an e500 VM, let's convert the PCIcontroller over to qdev.
Reviewed-by: Paul Brook <paul@codesourcery.com>...
PPC: Make MPC8544DS obey -cpu switch
The MPC8544DS board emulation code ignored the user defined -cpu switch.This patch enables it to only provide a sane default, not force an e500v2CPU inside.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: Make MPC8544DS emulation work w/o KVM
The MPC8544DS board emulation was only used with KVM so far, so someparts of the code didn't provide proper values for non-KVM execution.
This patch makes the machine work without KVM enabled. To actually usethis, you also need proper e500v2 MMU emulation....
PPC MPC7544DS: Use new TLB helper function
Now that we have some nice helpers that can find us a TLB entry, let'suse that on the machine initialization code, so we don't need to knowabout the internals of the TLB array.
Fix off-by-one error in sizing pSeries hcall table
The pSeries machine uses two tables to look up guest hcalls for emulation.One of these is exactly one entry too small to hold all the hcalls it needsto, leading to memory corruption.
This patch fixes the bug, and while we're at it, make both tables 'static'...
pseries: Increase maximum CPUs to 256
The original pSeries machine was limited to 32 CPUs, more or lessarbitrarily. Particularly when we get SMT KVM guests it will bepretty easy to exceed this. Therefore, raise the max number of CPUsin a pseries machine guest to 256....
Make pSeries 'model' property more closely resemble real hardware
Currently, the qemu emulated pseries machine puts"qemu,emulated-pSeries-LPAR" in the device tree's root level 'model'property. Unfortunately this confuses some installers and ybin, which...
Place pseries vty devices at addresses more similar to existing machines
Currently the qemu pseries machine numbers its virtual serial devicesfrom 0. However, existing pSeries machines running pHyp number them from0x30000000.
In theory these indices are arbitrary, since everything necessary for the...
monitor: add PPC BookE SPRs
Read them via KVM_GET_SREGS in kvm_arch_get_registers(),and display them in "info registers".
Also get CR and PID from the existing KVM_GET_REGS.
Signed-off-by: Scott Wood <scottwood@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
usb-musb: uninline functions
Prototype without "inline" keyword breaks the build with some gccversions. Noticed by Alexander Graf.
Fix this by removing the inline keywork everywhere. Some functionscan't be inlined anyway as the are referenced using function pointers....
lsi53c895a: Rename 'sense' to 'status'
The 'sense' field in the HBA status structure is misnamed, as itactually carries the SCSI status. Rename it.
Signed-off-by: Hannes Reinecke <hare@suse.de>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
ac97: Remove unused local variables
cppcheck report:hw/ac97.c:1004: style: Variable 'written' is assigned a value that is never usedhw/ac97.c:1072: style: Variable 'written' is assigned a value that is never used
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
Fix typos in comments (instanciation -> instantiation)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix typos in comments and code (occured -> occurred and related)
The code changed here is an unused data type name (evt_flush_occurred).
Fix typo in comment (responsiblity -> responsibility)
Fix typos in comment (threshhold -> threshold, mapp -> map)
Fix typos in comments (imediately -> immediately)
Fix typos in comments (interupt -> interrupt)
Fix typos in comments (accessable -> accessible, priveleged -> privileged)
Fix typo in comment (colum -> column)
Fix typo in comment (auxilliary -> auxiliary)
xen: Add Xen hypercall for sleep state in the cmos_s3 callback.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Alexander Graf <agraf@suse.de>
xen: Introduce Xen Interrupt Controller
Every set_irq call makes a Xen hypercall.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Signed-off-by: Alexander Graf <agraf@suse.de>
xen: Introduce the Xen mapcache
On IA32 host or IA32 PAE host, at present, generally, we can't createan HVM guest with more than 2G memory, because generally it's almostimpossible for Qemu to find a large enough and consecutive virtualaddress space to map an HVM guest's whole physical address space....
pci: Use of qemu_put_ram_ptr in pci_add_option_rom.
Prevent a deadlock caused by leaving a map cache bucket locked by thepreceding qemu_get_ram_ptr() call.
Signed-off-By: John Baboval <john.baboval@virtualcomputer.com>Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
xen: Initialize event channels and io rings
Open and bind event channels; map ioreq and buffered ioreq rings.
Signed-off-by: Arun Sharma <arun.sharma@intel.com>Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>...
xen: Add initialisation of Xen
The xenpv machine use the common init function.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
pc_memory_init: Move memory calculation to the caller.
This patch moves above_4g_mem_size and below_4g_mem_size calculation inthe caller of pc_memory_init (pc_init1). And the prototype ofpc_memory_init is changed because there is no need anymore to have...
xen: Add xenfv machine
Introduce the Xen FV (Fully Virtualized) machine to Qemu, some more Xenspecific call will be added in further patches.
pc, Disable vmport initialisation with Xen.
This is because there is not synchronisation of the vcpu registerbetween Xen and QEMU, so vmport can't work properly.
This patch introduces no_vmport parameter to pc_basic_device_init.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
piix_pci: Introduces Xen specific call for irq.
This patch introduces Xen specific call in piix_pci.
The specific part for Xen is in write_config, set_irq and get_pirq.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>...
machine, Add default_machine_opts to QEMUMachine.
With this new field, we can specified which accelerator use to run themachine, if the accelerator is not already specified by either aconfiguration file or the command line options.
Currently, the only use will be made in the xenfv machine....
xen: Replace some tab-indents with spaces (clean-up).
And put braces for blocks with a single statement.
xen: Support new libxc calls from xen unstable.
This patch updates the libxenctrl calls in Qemu to use the new interface,otherwise Qemu wouldn't be able to build against new versions of thelibrary.
We check libxenctrl version in configure, from Xen 3.3.0 to Xen...
Fix typo in code and comments
Replace writeable -> writable
Merge remote-tracking branch 'mst/for_anthony' into staging
Merge remote-tracking branch 'kraxel/usb.7.pull' into staging
Merge remote branch 'origin/master' into pci
Conflicts: exec.c
pci: Add class 0x403 as 'audio controller'
Used by HD audio controllers like our intel-hda.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
MSI: Robust resource release
msi_init may fail, so we need to check on uninit if the cap wasactually installed. This also avoids that the users need to check.
eepro100: Support byte/word writes to pointer register
pointer is a 32 bit register, but may be written using 8 or 16 bit writes.Add support for byte/word writes.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100: Support byte/word read/write access to MDI control register
MDI control is a 32 bit register, but may be read or written using8 or 16 bit access. Data is latched when the MSB is written.
Add support for byte/word read/write access.
eepro100: Support byte read access to general control register
The general control register is a byte register.Add support for byte reads.
eepro100: Support 32 bit read/write access to flash register
eepro100: Fix endianness issues
Like other Intel devices, e100 (eepro100) uses little endian byte order.
This patch was tested with these combinations:
i386 host, i386 + mipsel guests (le-le)mipsel host, i386 guest (le-le)i386 host, mips + ppc guests (le-be)...
eepro100: Support byte/word writes to port address
port is a 32 bit register, but may be written using 8 or 16 bit writes.Add support for byte/word writes.
eepro100: Pad received short frames
QEMU sends frames smaller than 60 bytes to ethernet nics.Such frames are rejected by real NICs and their emulations.To avoid this behaviour, other NIC emulations pad receivedframes. This patch enables this workaround for eepro100, too....
eepro100: Remove unused structure element
cppcheck reports that 'packet' is unused.
It was only used to calculate the size of the preceding data.Removing it saves a lot of stack space (local variable rx).
eepro100: Remove type casts which are no longer needed
eepro100: Avoid duplicate debug messages
When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice.Now logging in eepro100_write1 and eepro100_write2 is similar to thelogging in eepro100_write4 (which already was correct).
usb: mass storage fix
Initialize scsi_len with zero when starting a new request, so anystuff leftover from the previous request is cleared out. This mayhappen in case the data returned by the scsi command doesn't fitinto the buffer provided by the guest....
uhci: switch to QTAILQ
uhci: keep uhci state pointer in async packet struct.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ohci: get ohci state via container_of()
musb: get musb state via container_of()
usb: move complete callback to port ops
usb: control buffer fixes
Windows allows control transfers to pass up to 4k of data, so raise ourcontrol buffer size to 4k. For control out transfers the usb core code copiesthe control request data to a buffer before calling the device's handle_control...
spice: don't create updates in spice server context.
This patch moves the creation of spice screen updates from the spiceserver context to qemu iothread context (display refresh timer to beexact). This way we avoid accessing qemu internals (display surface)...
spice: don't call displaystate callbacks from spice server context.
This patch moves the displaystate callback calls for setting the cursorand the mouse pointer from spice server to qemu (iothread) context.This allows us to simplify locking.
spice: drop obsolete iothread locking
We don't use qemu internals from spice server context any more.Thus we don't also need to grab the iothread mutex from spiceserver context. And we don't have to temporarely release thelock to avoid deadlocks. Drop all the calls....
atapi: Move comment to proper place
Move misplaced comment for media_is_dvd()
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
atapi: Explain why we need a 'media not present' state
After the re-org of the atapi code, it might not be intuitive for areader of the code to understand why we're inserting a 'media notpresent' state between cd changes.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
ide/atapi: fix set but unused
Signed-off-by: Alon Levy <alevy@redhat.com>Acked-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
milkymist-vgafb: fix console resizing
After enabling the framebuffer, ensure that the console is resized.
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
milkymist-sysctl: fix timers
Prevent timers from firing right after starting.
lm32: add Milkymist Minimac2 support
This patch adds support for Milkymist's minimal Ethernet MAC v2. Itsuperseds minimac1.
kvm: create kvmclock when one of the flags are present
kvmclock presence can be signalled by two different flags. So fordevice creation, we have to test for both.
Signed-off-by: Glauber Costa <glommer@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
Merge remote-tracking branch 'amitshah/for-anthony' into staging
Merge remote-tracking branch 'jvrao/for-anthony' into staging
virtio-serial: Fix endianness bug in the config space
The virtio serial specification requres that the values in the configspace are encoded in native endian of the guest.
The qemu virtio-serial code did not do conversion to the guest endianformat what caused problems when host and guest use different format....
char: Allow devices to use a single multiplexed chardev.
This fixes regression caused by commit2d6c1ef40f3678ab47a4d14fb5dadaa486bfcda6("char: Prevent multiple devices opening same chardev"):
-nodefaults -nographic -chardev stdio,id=stdio,mux=on,signal=off \...