usb/hid: add hid_pointer_activate, use it
HID reorganziation broke the usb tablet in windows xp. The reason isthat xp activates idle before it starts polling, which creates achicken-and-egg issue: We don't call hid_pointer_poll because there areno pending events. We don't get any events because the activation code...
etrax: Allocate DMA connections at board level.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
etrax: Remove hw/etraxfs.c.
The Bare ETRAX FS board was a fictive machine that I used whendeveloping the CRIS system emulation. Since we support thereal AXIS-dev88 developer boards, there is no reason tokeep the fictive one around.
This commit also removes the double registration of the axis-dev88...
lance: unbreak after memory API conversion
The conversion passed the wrong opaque pointer, causing a crash on first use.Pass the correct opaque.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
pci: remove support for pre memory API BARs
Not used anymore.
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
isa-mmio: convert to memory API
sun4u: convert to memory API
fixes memory leak on repeated BAR map/unmap
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ehci: convert to memory API
uhci: convert to memory API
xen-platform: convert to memory API
Since this device bypasses PCI and registers I/O ports directly withthe system bus, it needs further attention.
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>...
msix: convert to memory API
The msix table is defined as a subregion, to allow for a BAR thatmixes device specific regions with the msix table.
pci: remove pci_register_bar_simple()
Superceded by pci_register_bar_region().
pci: convert pci rom to memory API
pci: remove pci_register_bar()
Superceded by pci_register_bar_region(). The implementationsare folded together.
pci: fold BAR mapping function into its caller
There is only one function, so no need for a function pointer.
pci: rename pci_register_bar_region() to pci_register_bar()
ahci: convert to memory API
intel-hda: convert to memory API
lsi53c895a: convert to memory API
An optimization that fast-pathed DMA reads from the SCRIPTS memorywas removed int the process. Likely it breaks with iommus anyway.
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
ppc: convert to memory API
ne2000: convert to memory API
pcnet: convert to memory API
Also related chips.
i6300esb: convert to memory API
Also add missing destructor.
virtio-pci: convert to memory API
except msix.
[jan: fix build][aliguori: fix build]
ac97: convert to memory API
fixes BAR sizing as well.
e1000: convert to memory API
eepro100: convert to memory API
Note: the existing code aliases the flash BAR into the MMIO bar. This isprobably a bug. This patch does not correct the problem.
es1370: convert to memory API
ide: convert to memory API
ivshmem: convert to memory API
excluding msix.
cirrus: simplify mmio BAR access functions
Make use of the memory API's ability to satisfy multi-byte accesses viamultiple single-byte accesses.
cirrus: simplify bitblt BAR access functions
cirrus: simplify vga window mmio access functions
vga: simplify vga window mmio access functions
We have to keep vga_mem_{read,write}b() since they're used by cirrus.
Reviewed-by: Richard Henderson <rth@twiddle.net>...
cirrus: simplify linear framebuffer access functions
pci: pass I/O address space to new PCI bus
This lets us register BARs in the I/O address space.
pci: allow I/O BARs to be registered with pci_register_bar_region()
rtl8139: convert to memory API
pci: add API to get a BAR's mapped address
Some (hacky) devices that have a back-channel to read thisaddress back outside the normal configuration mechanisms, suchas VMware svga.
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>...
vmsvga: don't remember pci BAR address in callback any more
We're going to remove the callback, so we can't use it to save theaddress. Use the pci API instead.
vga: convert vga and its derivatives to the memory API
Convert all vga memory to the memory API. Note we need to fall back toget_system_memory(), since the various buses don't pass the vga windowas a memory region.
We no longer need to sync the dirty bitmap of the cirrus mapped memory...
qdev: Eliminate duplicate reset
qbus_reset_all_fn was registered twice, so a lot of device resetfunctions were also called twice when QEMU started.Which was introduced by 80376c3fc2c38fdd45354e4b0eb45031f35587edThis patch fixes it by making the main_system_bus creation not register...
Check fread() results to avoid gcc 4.6 warnings
When compiling with gcc 4.6, some code in fw_cfg.c complains that fop_retis assigned but not used (which is true). However, it looks like themeaningless assignments to fop_ret were done to suppress other gcc warnings...
kvmclock: Fix feature detection
Bit-wise or the feature flags and drop the obsolete #ifdef.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Merge remote-tracking branch 'mst/for_anthony' into staging
Merge remote-tracking branch 'spice/spice.v40' into staging
Merge remote-tracking branch 'kraxel/usb.22' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
virtio-balloon: Add exit handler, fix memleaks
Add an exit handler that will free up RAM after a virtio-balloon deviceis unplugged.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>
virtio-balloon: Unregister savevm section on device unplug
Migrating after unplugging a virtio-balloon device resulted in an errormessage on the destination:
Unknown savevm section or instance '0000:00:04.0/virtio-balloon' 0load of migration failed
Fix this by unregistering the section on device unplug....
virtio-balloon: Separate status handling into separate function
Separate out the code to retrieve balloon info from the code that setsballoon values.
This will be used to separate the two callbacks from balloon.c and helpcope with 'balloon 0' on the monitor. Currently, 'balloon 0' causes a...
balloon: Separate out stat and balloon handling
Passing on '0' as ballooning target to indicate retrieval of stats isbad API. It also makes 'balloon 0' in the monitor cause a segfault.Have two different functions handle the different functionality instead....
virtio-balloon: Fix header comment; add Copyright
Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-balloon: Check if balloon registration failed
Multiple balloon registrations are not allowed; check if theregistration with the qemu balloon api succeeded. If not, fail thedevice init.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>...
usb-hid: create & use HIDState
First step in separating out the HID emulation code from usb-hid, so itcan be reused without creating a dummy usb device like bluetooth does.
This creates a HIDState struct, moves the non-usbish fields fromUSBHIDStruct there. Renames non-usbish structs, defines and functions...
usb-hid: add event callback
Add callback for event notification, which allows to un-usbify morefunctions. Also split separate hid_* functions for reset and release.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-hid: add hid_has_events()
Add hid_has_events function, use it to figure whenever there are pendingevents instead of checking and updating USBHIDState->changed.
Setting ->changed to 1 on init is removed, that should have absolutelyno effect as the initial state of ->idle is 0 so we report hid state...
usb-hid: split hid code to hw/hid.[ch]
Almost pure code motion. Unstatic hid interface functions and addthem to the header file. Some renames. Some code style cleanups.
hid: move idle+protocol from usb-hid to hid too.
bluetooth: kill dummy usb device, use hid code directly.
usb-storage: iovec support
Add full iovec support to usb-storage.
uhci: remove buffer
Map guest memory and pass on a direct pointer instead of copyingthe bits to a indirect buffer.
ehci: iovec support, remove buffer
Map guest memory and pass on a direct pointer instead of copyingthe bits to a indirect buffer. EHCI transfer descriptors canreference multiple (physical guest) pages so we'll actually startseeing usb packets wich carry iovec with more than one element....
usb-serial: iovec support
Add full support for iovecs to usb-serial.
usb: use iovecs in USBPacket
Zap data pointer from USBPacket, add a QEMUIOVector instead.Add a bunch of helper functions to manage USBPacket data.Switch over users to the new interface.
Note that USBPacket->len was used for two purposes: First topass in the buffer size and second to return the number of...
lm32: softusb: claim to support full speed
The QEMU keyboard and mouse reports themselves as full speed devices,though they are actually low speed devices. Until this is fixed, claim thatwe are supporting full speed devices.
Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
vhost: remove an incorrect assert
The 'to' can go negative when the first region gets removed(it gets incremented by to 0 immediately afterward), whichmakes the assertion fail. Nothing breaks ifto < 0 here so just remove the assert.
Tested-by: David Ahern <daahern@cisco.com>...
qxl: add QXL_IO_FLUSH_{SURFACES,RELEASE} for guest S3&S4 support
Add two new IOs. QXL_IO_FLUSH_SURFACES - equivalent to update area for all surfaces, used to reduce vmexits from NumSurfaces to 1 on guest S3, S4 and resolution change (windows driver implementation is such that this is done on each of those occasions)....
qxl: bump pci rev
Inform guest drivers about the new features I/O commands we havenow (async commands, S3 support) if building with newer spice, i.e.if SPICE_INTERFACE_QXL_MINOR >= 1.
sneaked in some 81+ column line spliting.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
qxl: async io support using new spice api
Some of the QXL port i/o commands are waiting for the spice server tocomplete certain actions. Add async versions for these commands, so wedon't block the vcpu while the spice server processses the command.Instead the qxl device will raise an IRQ when done....
spice: add worker wrapper functions.
Add wrapper functions for all spice worker calls.
spice: add qemu_spice_display_init_common
Factor out SimpleSpiceDisplay initialization intoqemu_spice_display_init_common() and call it fromboth qxl.c (for vga mode) and spice-display.c
spice/qxl: move worker wrappers
Move the wrapper functions which are used by qxl only to qxl.c.Rename them from qemu_spice_* to qxl_spice_*. Also pass in aqxl state pointer instead of a SimpleSpiceDisplay pointer.
qxl: fix surface tracking & locking
Surface tracking needs proper locking since it is used from vcpu and spiceworker threads, add it. Also reset the surface counter when zapping allsurfaces.
qxl: add io_port_to_string
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qxl: error handling fixes and cleanups.
Add qxl_guest_bug() function which is supposed to be called in casesanity checks of guest requests fail. It raises an error IRQ andlogs a message in case guest debugging is enabled.
Make PANIC_ON() abort instead of exit. That macro should be used...
qxl: make qxl_guest_bug take variable arguments
qxl: only disallow specific io's in vga mode
Since the driver is still in operation even after moving to UNDEFINED, i.e.by destroying primary in any way.
scsi-disk: Codingstyle fixes
Replace tabs with spaces.
Signed-off-by: Hannes Reinecke <hare@suse.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi: Remove references to SET_WINDOW
SET_WINDOW command is vendor-specific only.So we shouldn't try to emulate it.
scsi: Remove REZERO_UNIT emulation
REZERO_UNIT command is obsolete. Remove support for it.
scsi: Sanitize command definitions
Sanitize SCSI command definitions.Add _10 suffix to READ_CAPACITY, WRITE_VERIFY, VERIFY, READ_LONG,WRITE_LONG, and WRITE_SAME.Add new command definitions for LOCATE_10, UNMAP, VARLENGTH_CDB,WRITE_FILEMARKS_16, EXTENDED_COPY, ATA_PASSTHROUGH, ACCESS_CONTROL_IN,...
scsi-disk: Remove 'drive_kind'
Instead of using its own definitions scsi-disk shouldbe using the device type of the parent device.
exec.h cleanup
Move softmmu_exec.h include directives from target-*/exec.h totarget-*/op_helper.c. Move also various other stuff only used inop_helper.c there.
Define global env in dyngen-exec.h.
For i386, move wrappers for segment and FPU helpers from user-exec.c...
revamp acpitable parsing and allow to specify complete (headerful) table
This patch almost rewrites acpi_table_add() function(but still leaves it using old get_param_value() interface).The result is that it's now possible to specify whole table(together with a header) in an external file, instead of just...
sd: do not add one sector to the disk size
This leads to random off-by-one error.When the size of the SD is exactly 1GB, the emulation was returning awrong SDHC CSD descriptor.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
usb-hid: Fix 0/0 position for Windows in tablet mode
For unknown reasons, Windows drivers (tested with XP and Win7) ignoreusb-tablet events that move the pointer to 0/0. So always report 0/0 as1/0.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Add support for Zipit Z2 machine
Zipit Z2 is small PXA270 based handheld.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
onenand: Add missing brace.
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/onenand: program actions can only clear bits
The program actions onenand_prog_main() and onenand_prog_spare()can only set bits.
This implies a rewrite of onenand_erase() to not use the programfunctions, since erase does need to set bits.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>...
onenand: Handle various ID fields separately
Handle the manufacturer, device and version IDs separately rather thansmooshing them all together into a single uint32_t. Note that the IDregisters are actually 16 bit, even though typically the top bits are 0...
onenand: Pass BlockDriverState to init function
Pass the BlockDriverState to the onenand init function so it doesn'tneed to look up the drive itself.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/nand: qdevify
Qdevify the NAND device.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]Signed-off-by: Riku Voipio <riku.voipio@iki.fi>[Peter Maydell: More fixes and cleanups for upstream submission]...
hw/nand: Writing to NAND can only clear bits
Writing to a NAND device cannot set bits, it can only clear them;implement this rather than simply copying the data.
hw/nand: Support multiple reads following READ STATUS
After receiving READ STATUS command all subsequent IO reads should returnthe status register value until another command is issued.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]...
hw/nand: Support devices wider than 8 bits
Support NAND devices which are wider than 8 bits.
nand: Bump vmstate version after changing structure.
hw/nand: Support large NAND devices
Add support for NAND devices of over 1Gb.
hw/nand: Pass block device state to init function
Pass the BlockDeviceState to the nand_init() function ratherthan having it look it up via drive_get() itself.