virtio-scsi: do not crash on adding buffers to the event queue
The event queue is not supported yet and the handler does nothave to do much anyway when buffers are added. However, thehandler is called unconditionally by the virtio layer, and thisresults in a crash as soon as buffers are added to the event...
scsi: Fix data length == SCSI_SENSE_BUF_SIZE
Fix the edge case where the sense data length is exactly the sameas SCSI_SENSE_BUF_SIZE.This makes SCSI requests work that use all of the available 95 bytesense data.
Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com>...
scsi: Fix LOAD_UNLOAD
Change operation code of LOAD_UNLOAD command to 0x1b as described insection 7.3 of the SCSI Stream Commands spec.
Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com>Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>...
scsi: Ensure command and transfer lengths are set for all SCSI devices
scsi-generic relies on those values to be correct, so it is important thatthose values are initialized properly for all device types.
Reported-by: Christian Hoff <christian.hoff@de.ibm.com>...
megasas: LSI Megaraid SAS HBA emulation
This patch adds an emulation for the LSI Megaraid SAS 8708EM2 HBA.I've tested it to work with Linux, Windows Vista, and Windows7.
Signed-off-by: Hannes Reinecke <hare@suse.de>[ Squashed trivial changes from Andreas Faerber, rebased over IOMMU...
scsi: add a qdev property for the disk's WWN
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
atapi: implement READ DISC INFORMATION
This command is not necessary for CD-ROM and DVD-ROM, but some versions ofudev trip on its absence.
Cc: Kevin Wolf <kwolf@redhat.com>Cc: Markus Armbruster <armbru@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi-disk: implement READ DISC INFORMATION
ISCSI: Add SCSI passthrough via scsi-generic to libiscsi
Update iscsi to allow passthrough of SG_IO scsi commands when the iscsidevice is forced to be scsi-generic.
Implement both bdrv_ioctl() and bdrv_aio_ioctl() in the iscsi backend,emulate the SG_IO ioctl and pass the SCSI commands across to the...
megasas: Add header file
This patch adds the header file for megasas.
Signed-off-by: Hannes Reinecke <hare@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi: simplify handling of the VPD page length field
The last four bytes of the thin provisioning page were cut out.
iommu: Allow PCI to use IOMMU infrastructure
This patch adds some hooks to let PCI devices and busses use the new IOMMUinfrastructure. When IOMMU support is enabled, each PCI device nowcontains a DMAContext * which is used by the pci_dma_*() wrapper functions....
pseries: Implement IOMMU and DMA for PAPR PCI devices
Currently the pseries machine emulation does not support DMA for emulatedPCI devices, because the PAPR spec always requires a (guest visible,paravirtualized) IOMMU which was not implemented. Now that we have...
Better support for dma_addr_t variables
A while back, we introduced the dma_addr_t type, which is supposed tobe used for bus visible memory addresses. At present, this is analias for target_phys_addr_t, but this will change when we eventuallyadd support for guest visible IOMMUs....
iommu: Add universal DMA helper functions
Not that long ago, every device implementation using DMA directlyaccessed guest memory using cpu_physical_memory_*(). This meant thatadding support for a guest visible IOMMU would require changing everyone of these devices to go through IOMMU translation....
usb-ohci: Use universal DMA helper functions
The OHCI device emulation can provide both PCI and SysBus OHCIimplementations. Because of this, it was not previously converted touse the PCI DMA helper functions.
This patch converts it to use the new universal DMA helper functions....
iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers
dma-helpers.c contains a number of helper functions for doingscatter/gather DMA, and various block device related DMA. Currently,these directly access guest memory using cpu_physical_memory_*(),...
ide/ahci: Use universal DMA helper functions
The AHCI device can provide both PCI and SysBus AHCI deviceemulations. For this reason, it wasn't previously converted to usethe pci_dma_*() helper functions. Now that we have universal DMAhelper functions, this converts AHCI to use them....
usb: Convert usb_packet_{map, unmap} to universal DMA helpers
The USB UHCI and EHCI drivers were converted some time ago to use thepci_dma_*() helper functions. However, this conversion was not completebecause in some places both these drivers do DMA via the usb_packet_map()...
iommu: Introduce IOMMU emulation infrastructure
This patch adds the basic infrastructure necessary to emulate an IOMMUvisible to the guest. The DMAContext structure is extended withinformation and a callback describing the translation, and the various...
pseries: Convert sPAPR TCEs to use generic IOMMU infrastructure
The pseries platform already contains an IOMMU implementation, since it isessential for the platform's paravirtualized VIO devices. This IOMMUsupport is currently built into the implementation of the VIO "bus" and...
rtl8139: validate rx ring before receiving packets
Commit ff71f2e8cacefae99179993204172bc65e4303df prevent the possiblecrash during initialization of linux driver by checking the operatingmode.This seems too strict as:
- the real card could still work in mode other than normal...
qdev: fix use-after-free in the error path of qdev_init_nofail
From Markus:
Before:
$ qemu-system-x86_64 -display none -drive if=ide qemu-system-x86_64: Device needs media, but drive is empty qemu-system-x86_64: Initialization of device ide-hd failed...
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'spice/spice.v58' into staging
Merge remote-tracking branch 'sstabellini/compile-xs' into staging
Merge remote-tracking branch 'sstabellini/xen-pt' into staging
Merge remote-tracking branch 'kraxel/usb.54' into staging
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
PPC: BookE: Implement EPR SPR
On the e500 series, accessing SPR_EPR magically turns into an access atthat CPU's IACK register on the MPIC. Implement that logic to get kernelsthat make use of that feature work.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: e500: Refactor serial dt generation
When generating serial port device tree nodes, we duplicate quite a bitof code, because there are 2 of them in the mpc8544ds board we emulate.
Shove the generating code into a function, so we duplicate less code....
PPC: e500: allow users to set the /compatible property via -machine
Device trees usually have a node /compatible, which indicate which machinetype we're looking at. For quick prototyping, it can be very useful to changethe contents of that node via the command line....
uImage: increase the gzip load size
Recent u-boot has different defines for its gzip extract buffer, but thecommon ground seems to be 64MB. So let's bump it up to that, enabling meto load my test image again ;).
PPC: e500: Use new MPIC dt format
Due to popular demand, we're updating the way we generate the MPICnode and interrupt lines based on what the current state of art is.
Requested-by: Scott Wood <scottwood@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: e500: Use new SOC dt format
Due to popular demand, let's clean up the soc node a bit and usemore recent dt notions.
PPC: e500: Define addresses as always 64bit
Every time we use an address constant, it needs to potentially fit intoa 64bit physical address space. So let's define things accordingly.
PPC: e500: Extend address/size of / to 64bit
We want to be able to support >= 4GB of RAM. To do so, we need to be ableto tell the guest OS how much RAM it has.
However, that information today is capped to 32bit. So let's extend theoffset and size fields to 64bit, so we can fit in big addresses and even...
PPC: e500: dt: use 64bit cell helper
We have a nice 64bit helper to ease the device tree generation andmake the code more readable when creating 64bit 2-cell parameters.Use it when generating the device tree.
PPC: e500: dt: use target_phys_addr_t for ramsize
We're passing the ram size as uint32_t, capping it to 32 bits atm.Change to target_phys_addr_t (uint64_t) to make sure we have allthe bits.
PPC: e500: enable manual loading of dtb blob
We want to be able to override the automatically created device treeby using the -dtb option. Implement this for the mpc8544ds machine.
PPC: e500: dt: create /soc8544 node dynamically
PPC: e500: dt: create serial nodes dynamically
PPC: e500: dt: create mpic node dynamically
PPC: e500: dt: create global-utils node dynamically
PPC: e500: dt: create pci node dynamically
PPC: e500: dt: start with empty device tree
Now that all of the device tree bits are generated during runtime, wecan get rid of the device tree blob and instead start from scratch withan empty device tree.
dt: Add -machine dumpdtb option to dump the current dtb
Now that we are dynamically creating the dtb, it's really useful tobe able to dump the created blob for debugging.
This patch implements a -machine dumpdtb=<file> option for e500 thatdumps the dtb exactly in the form the guest would get it to disk. It...
PPC: e500: require libfdt
Now that we're moving all of the device tree generation from an externalpre-execution generated blob to runtime generation using libfdt, we absolutelymust have libfdt around.
This requirement was there before already, as the only way to not require libfdt...
PPC: e500: dt: create memory node dynamically
PPC: e500: dt: create /cpus node dynamically
PPC: e500: dt: create /hypervisor node dynamically
PPC: e500: dt: create / node dynamically
PPC: e500: dt: create /chosen node dynamically
pseries: Correctly create ibm,segment-page-sizes property
The core tcg/kvm code for ppc64 now has at least the outlinecapability to support pagesizes beyond the standard 4k and 16MB. TheCPUState is initialized with information advertising the available...
spapr_vscsi: Error handling fixes
We were incorrectly g_free'ing an object that isn't allocatedin one error path and failed to release it completely in another
This fixes qemu crashes with some cases of IO errors.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>...
spapr: Add "memop" hypercall
This adds a qemu-specific hypervisor call to the pseries machinewhich allows to do what amounts to memmove, memcpy and xor overregions of physical memory such as the framebuffer.
This is the simplest way to get usable framebuffer speed from...
PPC: mpc8544ds: Span initial TLB entry over as much RAM as we need
The initial TLB entry is supposed to help us run the guest -kernel payload.This means the guest needs to be able to access its own memory, the initrdmemory and the device tree.
So far we only statically reserved a TLB entry from [0;256M[. This patch...
add pc-1.2
vga: raise default vgamem size
Old size: 8 MB (traditional upstream qemu value).New size: 16 MB (traditional qemu-kvm value).
Also adds compat properties so old machine typeskeep the old default values.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qxl: add vgamem_size_mb and vgamem_size
In preperation for supporting a larger framebuffer for multiple monitorson a single card, add a property to qxl vgamem_size_mb, and correspondingbyte sized vgamem_size, and use instead of VGA_RAM_SIZE.
[ kraxel: simplify property handling, add sanity checks ]...
hw/qxl: s/qxl_guest_bug/qxl_set_guest_bug/
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qxl: stop dirty loging when not in vga mode
Tested with linux guest. Not sure how to check actual performance affectof this. Checked with the previously send traceevent that the kvm ioctlto start/stop dirty logging is being called.(KVM_SET_USER_MEMORY_REGION)....
hw/qxl: ignore guest from guestbug until reset
soft_reset is called from any of: * QXL_IO_RESET * vga io * pci reset handler
qxl: reset current_async on qxl_soft_reset
vga: raise xres+yres limits
The vgabios will check whenever any given video mode will fit into thegiven video memory before adding it to the list of available modes, sothere is no need to keep xmax * ymax * 32bpp lower than VGA_RAM_SIZE.
Lets raise the limits a bit. Should be good for a few years, display...
vga: make vram size configurable
Zap the global VGA_RAM_SIZE #define, make the vga ram size configurablefor standard vga and vmware vga. cirrus and qxl are left with a fixedsize (and private VGA_RAM_SIZE #define) for now.
qxl needs some non-trivial adjustments in the mode list handling deal...
arm_gic: Send dbg msgs to stderr not stdout
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
fdc: use LOG_UNIMP logging
Convert uses of FLOPPY_ERROR to either FLOPPY_DPRINTF(for implemented cases) or to use LOG_UNIMP (unimplemented).
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Introduce Xen PCI Passthrough, PCI config space helpers
A more complete history can be found here:git://xenbits.xensource.com/qemu-xen-unstable.git
Signed-off-by: Allen Kay <allen.m.kay@intel.com>Signed-off-by: Guy Zana <guy@neocleus.com>Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
Introduce apic-msidef.h
This patch move the msi definition from apic.c to apic-msidef.h. So it can beused also by other .c files.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>
Introduce Xen PCI Passthrough, MSI
Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>Signed-off-by: Shan Haitao <haitao.shan@intel.com>Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
pci_ids: Add INTEL_82599_SFP_VF id.
We are using this in our quirk lookup provided by patchtitled: Introduce Xen PCI Passthrough, PCI config space helpers.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>...
Introduce XenHostPCIDevice to access a pci device on the host.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
pci.c: Add opaque argument to pci_for_each_device.
The purpose is to have a more generic pci_for_each_device by passing an extraargument to the function called on every device.
This patch will be used in a next patch.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
qdev-properties: Introduce pci-host-devaddr.
This new property will be used to specify a host pci device address.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Introduce Xen PCI Passthrough, qdevice
xilinx_timer: Removed include of qemu-timer
The Xilinx timer does not interact with the qemu_timer API, so dont include it.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
xilinx_timer: Fixed deadlock issue
The timer was deadlocking when the interval was set too low. It would cause aflood of timer events and the CPU would halt indefinately. This is a known issueand theres a generic workaround in place in ptimer on ptimer_set_limit(),...
xenstore: Use <xenstore.h>
In the next release of Xen (4.2), xs.h became deprecated.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen: Reorganize includes of Xen headers.
Because xs.h will be remove in future release of Xen, this patch removes theextra includes of this headers.
Also, it removes the extra includes of xenctrl.h and xen/io/xenbus.h as therealready are in xen_common.h....
ehci: add live migration support
usb: restore USBDevice->attached on vmload
ehci: tracing improvements
usb-host: attach only to running guest
usb-host: live migration support
uhci: fix uhci_async_cancel_all
We update the QTAILQ in the loop, thus we must use the SAFE versionto make sure we don't touch the queue struct after freeing it.
https://bugzilla.novell.com/show_bug.cgi?id=766310
hw/pxa2xx_pic: Convert coprocessor registers to new scheme
Convert the coprocessor access functions for the pxa2xx PIC to thearm_cp_reginfo scheme.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/pxa2xx.c: Convert CLKCFG and PWRMODE cp14 regs
Convert the PXA2xx CLKCFG and PWRMODE cp14 registers to thenew arm_cp_reginfo scheme.
hw/pxa2xx: Convert cp14 perf registers to new scheme
Convert the PXA2xx cp14 perf registers from old-stylecoprocessor hooks to the new scheme.
Add PIIX4 properties to control PM system states.
This patch adds two things. First it allows QEMU to distinguish betweenregular powerdown and S4 powerdown. Later separate QMP notification willbe added for S4 powerdown. Second it allows S3/S4 states to be disabled...
Allow machines to configure the QEMU_VERSION that's exposed via hardware
QEMU exposes its version to the guest's hardware and in some cases that is wrong(e.g. Windows prints messages about driver updates when you switchthe QEMU version).There is a new field now on the struct QEmuMachine, hw_version, which may...
make: automatically include dependencies in recursive subdir rules (v2)
I think I understand enough of what's going on in these rules to ensure this isright. But I could certainly use a second or third opinion...
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/omap.h: Drop broken MEM_VERBOSE tracing
Remove the MEM_VERBOSE tracing option from omap.h. This worked byintercepting cpu_register_io_memory() calls; it has been brokensince cpu_register_io_memory() was removed in favour of theMemoryRegion API.
hw/a9mpcore: Fix compilation failure if physaddrs are 64 bit
Add a cast to a logging printf to avoid a compilation failureif target_phys_addr_t is a 64 bit type. (This is better thanusing TARGET_FMT_plx because we really don't need a full16 digit hex string to print the offset into a device.)...
cadence_gem: avoid stack-writing buffer-overrun
Use sizeof(rxbuf)-size (not sizeof(rxbuf-size)) as the numberof bytes to clear. The latter would always clear 4 or 8bytes, possibly writing beyond the end of that stack buffer.Alternatively, depending on the value of the "size" parameter,...
cadence_ttc: changed master clock frequency
Change the timer clock frequency to 133MHz which is correct. the old 2.5MHzvalue was for the pre-silicon emulation platform.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
arm_boot: Conditionalised DTB command line update
The DTB command line should only be overwritten if the user provides a commandline with -append. Otherwise whatever command line was in the DTB should stayunchanged.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...