usb: the big rename
Reorganize usb source files. Create a new hw/usb/ directory and moveall usb source code to that place. Also make filenames a bit moredescriptive. Host adapters are prefixed with "hch-" now, usb deviceemulations are prefixed with "dev-". Fixup paths Makefile and include...
usb: zap hw/ush-{ohic,uhci}.h + init wrappers
Remove the uhci and ohci init wrappers, which all wrapped apci_create_simple() one-liner. Switch callsites to callpci_create_simple directly. Remove the header files wherethe wrappers where declared.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-ehci: drop unused isoch_pause variable
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-ohci: DMA writeback bug fixes
This patch fixes two bugs in the OHCI device where the device writesback data to system memory that should be exclusively under thecontrol of the guest side driver.
In OHCI specification Section 5.2.7, it mentioned "In all cases, Host...
usb: improve packet state sanity checks
Add a new function to check whenever the packet state is as expected,log more informations in case it isn't.
uhci: pass addr to uhci_async_alloc
Also do async->td initialization in uhci_async_alloc now.Prepares for adding tracepoints.
uhci: fix uhci_async_cancel_all
It should also free all queues.
uhci: cancel on schedule stop.
Cancel any in-flight transaction when the guest stops the uhci schedule.
uhci: tracing support
Zap DPRINTF, add tracepoints instead.
uhci: use enum for uhci_handle_td return codes
Step #1 (separate for better bisectability): replace numbers with names.
Merge remote-tracking branch 'stefanha/tracing' into staging
qdev: accept empty string properties
These were stored as NULL due to wrong cut-and-paste from set_pointer.
Reported-by: Gerhard Wiesinger <lists@wiesinger.com>Tested-by: Gerhard Wiesinger <lists@wiesinger.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
vga: add trace event for ppm_save
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Add missing const attributes for MemoryRegionOps
Most MemoryRegionOps already had the const attribute.This patch adds it to the remaining ones.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge remote-tracking branch 'kraxel/usb.42' into staging
xilinx_zynq: fix the build
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Spelling fixes in comments (it's -> its)
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Weil <sw@weilnetz.de>...
sh7750: Remove redundant 'struct' from MemoryRegionOps
The 'struct' is not needed, and all other MemoryRegionOps don't use it.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
usb: queue can have async packets
This can happen today in case the ->complete() callback queues up thenext packet. Also we'll support pipelining soon, which allows to havemultiple packets per queue in flight (aka ASYNC) state.
usb: add pipelining option to usb endpoints
With this patch applied USB drivers can enable pipelining per endpoint.With pipelining enabled the usb core will continue submitting packetseven when there are still async transfers in flight instead of passing...
usb: add shortcut for control transfers
Add a more direct code path to submit control transfers. Instead offeeding three usb packets (setup, data, ack) to usb_handle_packet andhave the do_token_* functions in usb.c poke the control transferparameters out of it just submit a single packet carrying the actual...
xhci: fix control xfers
Use the new, direct control transfer submission method instead ofbypassing the usb core by calling usb_device_handle_control directly.The later fails for async control transfers.
This patch gets xhci + usb-host combo going.
xhci: fix port status
Don't signal port status change if the usb device isn't in attachedstate. Happens with usb-host devices with the pass-through devicebeing plugged out at the host.
usb-ehci: Remove dead nakcnt code
This patch removes 2 bits of dead nakcnt code:
1) usb_ehci_execute calls ehci_qh_do_overlay which does:nakcnt = reload;and then has a block of code which is conditional on:if (reload && !nakcnt) {which ofcourse is never true now as nakcnt == reload....
usb-ehci: Fix and simplify nakcnt handling
The nakcnt code in ehci_execute_complete() marked transactions as finishedwhen a packet completed with a result of USB_RET_NAK, but USB_RET_NAKmeans that the device cannot receive / send data at that time and that...
usb-ehci: Cleanup itd error handling
All error statuses except for NAK are handled in a switch case, move thehandling of NAK into the same switch case.
usb: add USB_RET_IOERROR
We already have USB_RET_NAK, but that means that a device does not wantto send/receive right now. But with host / network redirection we canactually have a transaction fail due to some io error, rather then iethe device just not having any data atm....
uhci_fill_queue: zap debug printf
usb-ehci: split our qh queue into async and periodic queues
qhs can be part of both the async and the periodic schedule, as is shownin later patches in this series it is useful to keep track of the qhs ona per schedule basis.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
usb-ehci: always call ehci_queues_rip_unused for period queues
Before this patch USB 2 devices with interrupt endpoints were not workingproperly. The problem is that to avoid loops we stop processing as soonas we encounter a queue-head (qh) we've already seen since qhs can be linked...
usb-ehci: Drop cached qhs when the doorbell gets rung
The purpose of the IAAD bit / the doorbell is to make the ehci controllerforget about cached qhs, this is mainly used when cancelling transactions,the qh is unlinked from the async schedule and then the doorbell gets rung,...
usb-ehci: Rip the queues when the async or period schedule is halted
usb-ehci: Any packet completion except for NAK should set the interrupt
As clearly stated in the 2.3.2 of the EHCI spec, any time USBERRINT getsets then if the td has its IOC bit set USBINT should be set as well.
This means that for any status except for USB_RET_NAK we should set...
usb-ehci: Fix cerr tracking
cerr should only be decremented on errors which cause XactErr to be set, andwhen that happens the failing transaction should be retried until cerr reaches0 and only then should USBSTS_ERRINT be set (and inactive cleared andUSBSTS_INT set if requested)....
usb-ehci: Never follow table entries with the T-bit set
Before this patch the T-bit was not checked in 2 places, while it should be.
Once we properly check the T-bit everywhere we no longer need the weirdentry < 0x1000 and entry > 0x1000 checks, so this patch removes them....
kvm: x86: Add user space part for in-kernel i8254
This provides the required user space stubs to enable the in-kerneli8254 emulation of KVM.
The in-kernel model supports lost tick compensation according to the"delay" policy. This is enabled by default and can be switched off via a...
i8254: Open-code timer restore
Same as for the APIC: To enable migration between accelerated andnon-accelerated models, we need to arm the channel 0 timer only insidethe emulated PIT model. The common code just saves/restores that timerto the the next_transition_time field....
i8254: Factor out base class for KVM reuse
Applying the concept used for the *PICs once again: establish a baseclass for the i8254 that can be used both by the current user spaceemulation and the upcoming KVM in-kernel version. We share most of thepublic interface of the i8254, specifically to the pcspk, vmstate, reset...
cadence_uart: initial version of device model
Implemented cadence UART serial controller
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: John Linn <john.linn@xilinx.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
cadence_ttc: initial version of device model
Implemented cadence Triple Timer Counter (TCC)
cadence_gem: initial version of device model
Device model for cadence gem ethernet controller.
xilinx_zynq: machine model initial version
Xilinx zynq-7000 machine model. Also includes device model for the zynq-specificsystem level control register (SLCR) module.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
petalogix_s2adsp1800: macro'd magic numbers
defined macros for the addresses of the peripherals in machine model
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
microblaze_boot: enabled -dtb argument
Use the -dtb argument for passing is a custom dtb rather than the oldhardcoded "mb.dtb"
microblaze: factored out common boot code
factored out the copy-pasted common boot code from the two microblaze platformsinto a dedicated microblaze bootloader (microblaze_boot.o).
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
petalogix_s2adsp1800: moved rst logic to rst fn
This belongs in the machine specific reset function
s390: Rework kernel loading: supports elf and newer kernels
This reworks the image loading on s390.
Newer kernels will not always have a 0dd0 (basr 13,0) at address 0x10000.We must not rely on specific code at certain addresses. This check wasintroduced to warn users that tried to load vmlinux, since ELF loading...
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
hw/arm11mpcore: Fix broken realview_mpcore/arm11mpcore_priv properties
Fix confusion in the Property arrays for the "arm11mpcore_priv" (per-CPU devices for the ARM11MPcore CPU) and "realview_mpcore" (realview-eb board specific device encapsulating CPU and some...
arm: clean up GIC constants
Interrupts numbers 0-31 are private to the processor interface, 32-1019 aregeneral interrupts. Add GIC_INTERNAL and substitute everywhere.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>[Peter Maydell: converted some tabs to spaces]...
arm: make sure that number of irqs can be represented in GICD_TYPER.
We currently assume that the number of interrupts (ITLinesNumber inthe architecture reference manual) is divisible by 32, since wepresent it to the guest when it reads GICD_TYPER (in gic_dist_readb())...
arm: add device tree support
If compiled with CONFIG_FDT, allow user to specify a device tree file usingthe -dtb argument. If the machine supports it then the dtb will be loadedinto memory and passed to the kernel on boot.
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>...
Merge remote-tracking branch 'qemu-kvm/memory/core' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'spice/spice.v49' into staging
Merge remote-tracking branch 'kraxel/usb.39' into staging
fdc: take side count into account
Floppies can be simple or double-sided. However, current codewas only taking the common case into account (ie 2 sides).
This repairs single-sided floppies, which where totally brokenbefore this patch : for track > 0, wrong sector number was...
fdc: set busy bit when starting a command
This bit must be active while a command is currently executed.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
fdc: most control commands do not generate interrupts
In fact, only three control commands generate an interrupt:read_id, recalibrate and seek
fdc: handle read-only floppies (abort early on write commands)
A real floppy doesn't attempt to write to read-only media either.
fdc: add CCR (Configuration Control Register) write register
DIR and CCR registers share the same address ; DIR is read-onlywhile CCR is write-only
CCR register is used to change media transfer rate, which will bechecked in following changes.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>...
block: add a transfer rate for floppy types
Floppies must be read at a specific transfer rate, depending of its own format.Update floppy description table to include required transfer rate.
fdc: add a 'check media rate' property. Not used yet
Set it to true for current Qemu versions, and false for previous ones
fdc: check if media rate is correct before doing any transfer
The programmed rate has to be the same as the required rate for thefloppy format ; if that's not the case, the transfer should abort.This check can be disabled by using the 'check_media_rate' property....
fdc: fix seek command, which shouldn't check tracks
The seek command just sends step pulses to the drive and doesn't care ifthere is a medium inserted of if it is banging the head against the drive.
fdc: DIR (Digital Input Register) should return status of current drive...
ide: fail I/O to empty disk
Requesting a read or a write operation on an empty disk can leadto QEMU dumping core.
Also fix a few braces here and there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
memory: allow MemoryListeners to observe a specific address space
Ignore any regions not belonging to a specified address space.
Signed-off-by: Avi Kivity <avi@redhat.com>
memory: support stateless memory listeners
Current memory listeners are incremental; that is, they are expected tomaintain their own state, and receive callbacks for changes to that state.
This patch adds support for stateless listeners; these work by receiving...
memory: switch memory listeners to a QTAILQ
This allows reverse iteration, which in turns allows consistent orderingamong multiple listeners:
l1->add l2->add l2->del l1->del
Signed-off-by: Avi Kivity <avi@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>
memory: move ioeventfd ops to MemoryListener
This way the accelerator (kvm) can handle them directly.
qxl: properly handle upright and non-shared surfaces
Although qxl creates a shared displaysurface when the qxl surface isupright and doesn't need to be flipped there is no guarantee that thesurface doesn't become unshared for some reason. Rename qxl_flip to...
qxl: add optinal 64bit vram bar
This patch adds an 64bit pci bar for vram. It is turned off by default.It can be enabled by setting the size of the 64bit bar to be larger thanthe 32bit bar. Both 32bit and 64bit bar refer to the same memory. Onlythe first part of the memory is available via 32bit bar....
Merge remote-tracking branch 'aneesh/for-upstream' into staging
usb: Resolve warnings about unassigned bus on usb device creation
When creating an USB device the old way, there is no way to specify thetarget bus. Thus the warning issued by usb_create makes no sense andrather confuses our users.
Resolve this by passing a bus reference to the usbdevice_init handler...
usb-xhci: enable packet queuing
qemu usb core has packet queues now, so flip lets the switch.
usb: add tracepoint for usb packet state changes.
usb-ehci: sanity-check iso xfers
This patch adds a sanity check to itd processing to make sure theendpoint addressed by the guest is actually an iso endpoint. Alsoverify that usb drivers don't return USB_RET_ASYNC which is illegal foriso xfers.
usb-desc: fix user trigerrable segfaults (!config)
Check for dev->config being NULL in two places: USB_REQ_GET_CONFIGURATION and USB_REQ_GET_STATUS.
The behavior of USB_REQ_GET_STATUS is unspecified in the Default state,that corresponds to dev->config being NULL (it defaults to NULL and is...
usb-ccid: advertise SELF_POWERED
Before commit ed5a83ddd8c1d8ec7b1015315530cf29949e7c48 each deviceprovided it's own response to USB_REQ_GET_STATUS, but after it thatresponse was based on bmAttributes, which was errounously set forusb-ccid as 0xa0 and not 0xe0....
usb-ehci: Handle ISO packets failing with an error other then NAK
Before this patch the ehci code was not checking for any other errors otherthen USB_RET_NAK. This causes 2 problems:1) Other errors are not reported to the guest.2) When transactions with the ITD_XACT_IOC bit set completing with another...
ehci: drop old stuff
Drop the "ehci under development" banner.Drop unused & inactive (#if 0) code.
usb-uhci: add UHCIQueue
UHCIAsync structs (in-flight requests) grouped in UHCIQueue now.Each (active) usb endpoint gets its own UHCIQueue.
usb-uhci: process uhci_handle_td return code via switch.
Restruct the uhci_handle_td return code processing to make thecontrol flow more clear and the code more readable.
usb-uhci: implement packet queuing
When a usb device is busy processing a packet (and returnsUSB_RET_ASYNC), continue walking the transfer descriptor listand process them to fill the request queue.
usb-hid: fix tablet activation
Activate usb hid pointer devices (mouse+tablet) unconditionallyon polls, even if we NAK the poll due to lack of new events.
usb-ehci: fix reset
Two reset fixes: * pick up s->usbcmd value after ehci_reset call to make sure it keeps the reset value and doesn't get rubbish filled in when val is written back to the mmio register array later on. * make sure the frame timer is zapped on reset....
usb-uhci: cleanup UHCIAsync allocation & initialization.
qxl: remove flipped
Tested on linux and windows guests. For negative stride, qxl_flip copiesdirectly to vga->ds->surface->data, for positive it's reallocated toshare qxl->guest_primary.data
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qxl: introduce QXLCookie
Will be used in the next patch.
qxl: make qxl_render_update async
RHBZ# 747011
Removes the last user of QXL_SYNC when using update drivers that use the_ASYNC io ports.
The last user is qxl_render_update, it is called both by qxl_hw_updatewhich is the vga_hw_update_ptr passed to graphic_console_init, and by...
qxl: fix spice+sdl no cursor regression
regression introduced by 075360945860ad9bdd491921954b383bf762b0e5,
v2: lock around qemu_spice_cursor_refresh_unlocked
Reported-by: Fabiano Fidêncio <fabiano@fidencio.org>Signed-off-by: Alon Levy <alevy@redhat.com>...
qxl: drop qxl_spice_update_area_async definition
It was never used. Introduced in5ff4e36c804157bd84af43c139f8cd3a59722db9qxl: async io support using new spice api
But not used even then.
qxl: require spice >= 0.8.2
drop all ifdefs on SPICE_INTERFACE_QXL_MINOR >= 1 as a result,any check for SPICE_SERVER_VERSION that is now always satisfied,and SPICE_INTERFACE_CORE_MINOR >= 3 tests, because0.8.2 has SPICE_INTERFACE_QXL_MINOR 1 andSPICE_INTERFACE_CORE_MINOR 3....
optimize screendump for the common non-switch case
switch console only if needed, also pass down whenever the console wasswitched or not because a displaysurface redraw is only needed in casethe console was switched.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
nic: zap obsolote romloading bits from ne2k + pcnet
These days one just needs to specify the romfile in PCiDeviceInfo andeverything magically works. It also allows to disable pxe rom loadingvia "romfile=<emptystring>" like it is possible for all other nics....
Remove screendump dummy functions.
The code in console.c verifies whenever a screen_dump functionpointer is present before calling it, so there is no need to supply andummy function. Remove them. Also report an error to notify the userthat he didn't got a screenshot....