aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2012-03-14microblaze hw/: Don't use CPUStateAndreas Färber6-13/+13
Scripted conversion: for file in hw/microblaze_*.[hc] hw/petalogix_ml605_mmu.c hw/petalogix_s3adsp1800_mmu.c; do sed -i "s/CPUState/CPUMBState/g" $file done Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14m68k hw/: Don't use CPUStateAndreas Färber6-9/+9
Scripted conversion: for file in hw/an5206.c hw/dummy_m68k.c hw/mcf.h hw/mcf5206.c hw/mcf5208.c hw/mcf_intc.c; do sed -i "s/CPUState/CPUM68KState/g" $file done Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14lm32 hw/: Don't use CPUStateAndreas Färber2-9/+9
Scripted conversion: for file in hw/lm32_boards.c hw/milkymist.c; do sed -i "s/CPUState/CPULM32State/g" $file done Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14i386 hw/: Don't use CPUStateAndreas Färber6-30/+30
Scripted conversion: for file in hw/apic.h hw/kvm/apic.c hw/kvmvapic.c hw/pc.c hw/vmport.c hw/xen_machine_pv.c; do sed -i "s/CPUState/CPUX86State/g" $file done Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14cris hw/: Don't use CPUStateAndreas Färber6-9/+9
Scripted conversion: for file in hw/cris-boot.[hc] hw/cris_pic_cpu.c hw/axis_dev88.c hw/etraxfs.h hw/etraxfs_ser.c; do sed -i "s/CPUState/CPUCRISState/g" $file done Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14arm hw/: Don't use CPUStateAndreas Färber17-33/+33
Scripted conversion: for file in hw/arm-misc.h hw/arm_boot.c hw/arm_pic.c hw/armv7m.c hw/exynos4210.h hw/highbank.c hw/integratorcp.c hw/musicpal.c hw/omap.h hw/pxa.h hw/pxa2xx_gpio.c hw/pxa2xx_pic.c hw/realview.c hw/strongarm.h hw/versatilepb.c hw/vexpress.c hw/xilinx_zynq.c ; do sed -i "s/CPUState/CPUARMState/g" $file done Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14alpha hw/: Don't use CPUStateAndreas Färber3-9/+9
Scripted conversion: for file in hw/alpha_*.[hc]; do sed -i "s/CPUState/CPUAlphaState/g" $file done Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14hw/mc146818: Drop unneeded #includesAndreas Färber1-2/+0
pc.h and apic.h are not needed; apic.h would drag in x86 CPUState and is now included directly for TARGET_I386. isa.h is already #included from mc146818rtc.h. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14Rename cpu_reset() to cpu_state_reset()Andreas Färber29-33/+70
Frees the identifier cpu_reset for QOM CPUs (manual rename). Don't hide the parameter type behind explicit casts, use static functions with strongly typed argument to indirect. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14PPC: 405: Use proper CPU resetAlexander Graf2-25/+4
On ppc405ep there is a register that allows for software to reset the core, but not the whole system. Implement this reset using a reset interrupt. This gets rid of a bunch of #if 0'ed code. Reported-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-03-14kvmvapic: align start address as well as sizeAvi Kivity1-1/+3
The kvmvapic code remaps a section of ROM as RAM to allow the guest to maintain state there. It is careful to align the section size to a page boundary, to avoid creating subpages, but neglects to do the same for the start address. These leads to an assert later on when the memory core tries to create a page which is half RAM and half ROM. Fix by aligning the start address to a page boundary. This can be triggered by running qemu-system-x86_64 -enable-kvm -vga none. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-13Merge remote-tracking branch 'kraxel/usb.44' into stagingAnthony Liguori35-201/+4270
* kraxel/usb.44: Endian fix an assertion in usb-msd uhci: alloc can't fail, drop check. uhci: new uhci_handle_td return code for tds still in flight uhci: renumber uhci_handle_td return codes uhci: use enum for uhci_handle_td return codes uhci: tracing support uhci: cancel on schedule stop. uhci: fix uhci_async_cancel_all uhci: pass addr to uhci_async_alloc usb: improve packet state sanity checks usb-ohci: DMA writeback bug fixes usb-ehci: drop unused isoch_pause variable usb: zap hw/ush-{ohic,uhci}.h + init wrappers usb: the big rename
2012-03-13kvmclock: Always register typeAndreas Färber1-2/+0
Currently, the "kvmclock" type is only registered when kvm_enabled(). This breaks when moving type registration to before command line parsing (so that QOM types can be used for CPU and machine). Since the QOM classes are lazy-initialized anyway and kvmclock_create() has another kvm_enabled() check, simply drop the KVM check in kvmclock_register_types(). kvm-i8259, kvm-apic and kvm-ioapic do not suffer from such a check. Reviewed-by: please. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-13Endian fix an assertion in usb-msdBenjamin Herrenschmidt1-3/+3
This fixes a broken endian assumption in an assertion in usb-msd. Cc: Gerd Hoffman <kraxel@redhat.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13uhci: alloc can't fail, drop check.Gerd Hoffmann1-2/+0
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13uhci: new uhci_handle_td return code for tds still in flightGerd Hoffmann1-5/+7
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13uhci: renumber uhci_handle_td return codesGerd Hoffmann1-4/+4
Step #2 (separate for better bisectability): renumber so the silly '-1' goes away. Pick a range which doesn't overlap the old values. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13uhci: use enum for uhci_handle_td return codesGerd Hoffmann1-16/+23
Step #1 (separate for better bisectability): replace numbers with names. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13uhci: tracing supportGerd Hoffmann1-55/+32
Zap DPRINTF, add tracepoints instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13uhci: cancel on schedule stop.Gerd Hoffmann1-0/+1
Cancel any in-flight transaction when the guest stops the uhci schedule. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13uhci: fix uhci_async_cancel_allGerd Hoffmann1-0/+1
It should also free all queues. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13uhci: pass addr to uhci_async_allocGerd Hoffmann1-3/+3
Also do async->td initialization in uhci_async_alloc now. Prepares for adding tracepoints. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13usb: improve packet state sanity checksGerd Hoffmann2-6/+32
Add a new function to check whenever the packet state is as expected, log more informations in case it isn't. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13usb-ohci: DMA writeback bug fixesWei Yang1-2/+15
This patch fixes two bugs in the OHCI device where the device writes back data to system memory that should be exclusively under the control of the guest side driver. In OHCI specification Section 5.2.7, it mentioned "In all cases, Host Controller Driver is responsible for the insertion and removal of all Endpoint Descriptors in the various Host Controller Endpoint Descriptor lists". In the ohci_frame_boundary(), ohci_put_hcca() writes the entire hcca back including the interrupt ED lists which should be under driver control. This violates the specification and can race with a host driver updating that list at the same time. In the OHCI Spec Section 4.6, Transfer Descriptor Queue Processing, it mentioned "Since the TD pointed to by TailP is not accessed by the HC, the Host Controller Driver can initialize that TD and link at least one other to it without creating a coherency or synchronization problem". While the function ohci_put_ed() writes the entire endpoint descriptor back including the TailP which should under driver control. This violate the specification and can race with a host driver updating the TD list at the same time. In each case the solution is to make sure we don't write data which is under driver control. Cc: Gerd Hoffman <kraxel@redhat.com> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13usb-ehci: drop unused isoch_pause variableHans de Goede1-5/+1
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13usb: zap hw/ush-{ohic,uhci}.h + init wrappersGerd Hoffmann13-60/+11
Remove the uhci and ohci init wrappers, which all wrapped a pci_create_simple() one-liner. Switch callsites to call pci_create_simple directly. Remove the header files where the wrappers where declared. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-13usb: the big renameGerd Hoffmann23-53/+4150
Reorganize usb source files. Create a new hw/usb/ directory and move all usb source code to that place. Also make filenames a bit more descriptive. Host adapters are prefixed with "hch-" now, usb device emulations are prefixed with "dev-". Fixup paths Makefile and include paths to make it compile. No code changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-12Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori1-0/+2
* stefanha/tracing: vga: add trace event for ppm_save console: add some trace events maintainers: Add docs/tracing.txt to Tracing docs: correct ./configure line in tracing.txt trace: make trace_thread_create() use its function arg tracetool: Omit useless QEMU_*_ENABLED() check trace: Provide a per-event status define for conditional compilation
2012-03-12qdev: accept empty string propertiesPaolo Bonzini1-4/+0
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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-12vga: add trace event for ppm_saveAlon Levy1-0/+2
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-11Add missing const attributes for MemoryRegionOpsStefan Weil9-13/+13
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>
2012-03-09Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori4-4/+4
* stefanha/trivial-patches: configure: Quote the configure args printed in config.log osdep: Remove local definition of macro offsetof libcacard: Spelling and grammar fixes in documentation Spelling fixes in comments (it's -> its) vnc: Add break statement libcacard: Use format specifier %u instead of %d for unsigned values Fix sign of sscanf format specifiers block/vmdk: Fix warning from splint (comparision of unsigned value) qmp: Fix spelling fourty -> forty qom: Fix spelling in documentation sh7750: Remove redundant 'struct' from MemoryRegionOps
2012-03-09Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori6-240/+716
* qemu-kvm/uq/master: kvm: fill in padding to help valgrind kvm: x86: Add user space part for in-kernel i8254 kvm: Add kvm_has_pit_state2 helper i8254: Open-code timer restore i8254: Factor out base class for KVM reuse
2012-03-09Merge remote-tracking branch 'kraxel/usb.42' into stagingAnthony Liguori6-135/+175
* kraxel/usb.42: xhci: fix port status xhci: fix control xfers usb: add shortcut for control transfers usb-host: enable pipelineing for bulk endpoints. usb: add pipelining option to usb endpoints usb: queue can have async packets uhci_fill_queue: zap debug printf usb: add USB_RET_IOERROR usb: return BABBLE rather then NAK when we receive too much data usb-ehci: Cleanup itd error handling usb-ehci: Fix and simplify nakcnt handling usb-ehci: Remove dead nakcnt code usb-ehci: Fix cerr tracking usb-ehci: Any packet completion except for NAK should set the interrupt usb-ehci: Rip the queues when the async or period schedule is halted usb-ehci: Drop cached qhs when the doorbell gets rung usb-ehci: always call ehci_queues_rip_unused for period queues usb-ehci: split our qh queue into async and periodic queues usb-ehci: Never follow table entries with the T-bit set usb-redir: Set ep type and interface
2012-03-09xilinx_zynq: fix the buildAnthony Liguori1-2/+2
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-08Spelling fixes in comments (it's -> its)Stefan Weil2-2/+2
* it's -> its (fixed for all files) * dont -> don't (only fixed in a line which was touched by the previous fix) * distrub -> disturb (fixed in the same line) Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-07sh7750: Remove redundant 'struct' from MemoryRegionOpsStefan Weil2-2/+2
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>
2012-03-07xhci: fix port statusGerd Hoffmann1-1/+1
Don't signal port status change if the usb device isn't in attached state. Happens with usb-host devices with the pass-through device being plugged out at the host. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07xhci: fix control xfersGerd Hoffmann1-8/+5
Use the new, direct control transfer submission method instead of bypassing 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.
2012-03-07usb: add shortcut for control transfersGerd Hoffmann2-0/+60
Add a more direct code path to submit control transfers. Instead of feeding three usb packets (setup, data, ack) to usb_handle_packet and have the do_token_* functions in usb.c poke the control transfer parameters out of it just submit a single packet carrying the actual data with the control xfer parameters filled into USBPacket->parameters. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb: add pipelining option to usb endpointsGerd Hoffmann2-1/+12
With this patch applied USB drivers can enable pipelining per endpoint. With pipelining enabled the usb core will continue submitting packets even when there are still async transfers in flight instead of passing them on one by one. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb: queue can have async packetsGerd Hoffmann1-0/+3
This can happen today in case the ->complete() callback queues up the next packet. Also we'll support pipelining soon, which allows to have multiple packets per queue in flight (aka ASYNC) state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07uhci_fill_queue: zap debug printfGerd Hoffmann1-1/+0
2012-03-07usb: add USB_RET_IOERRORHans de Goede4-5/+11
We already have USB_RET_NAK, but that means that a device does not want to send/receive right now. But with host / network redirection we can actually have a transaction fail due to some io error, rather then ie the device just not having any data atm. This patch adds a new error code named USB_RET_IOERROR for this, and uses it were appropriate. Notes: -Currently all usb-controllers handle this the same as NODEV, but that may change in the future, OHCI could indicate a CRC error instead for example. -This patch does not touch hw/usb-musb.c, that is because the code in there handles STALL and NAK specially and has a if status < 0 generic catch all for all other errors Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb-ehci: Cleanup itd error handlingHans de Goede1-14/+14
All error statuses except for NAK are handled in a switch case, move the handling of NAK into the same switch case. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb-ehci: Fix and simplify nakcnt handlingHans de Goede1-28/+4
The nakcnt code in ehci_execute_complete() marked transactions as finished when a packet completed with a result of USB_RET_NAK, but USB_RET_NAK means that the device cannot receive / send data at that time and that the transaction should be retried later, which is also what the usb-uhci and usb-ohci code does. Note that there already was some special code in place to handle this for interrupt endpoints in the form of doing a return from ehci_execute_complete() when reload == 0, but that for bulk transactions this was not handled correctly (where as for example the usb-ccid device does return USB_RET_NAK for bulk packets). Besides that the code in ehci_execute_complete() decrement nakcnt by 1 on a packet result of USB_RET_NAK, but -since the transaction got marked as finished, nakcnt would never be decremented again -there is no code checking for nakcnt becoming 0 -there is no use in re-trying the transaction within the same usb frame / usb-ehci frame-timer call, since the status of emulated devices won't change as long as the usb-ehci frame-timer is running So we should simply set the nakcnt to 0 when we get a USB_RET_NAK, thus claiming that we've tried reload times (or as many times as possible if reload is 0). Besides the code in ehci_execute_complete() handling USB_RET_NAK there was also code handling it in ehci_state_executing(), which calls ehci_execute_complete(), and then does its own handling on top of the handling in ehci_execute_complete(), this code would decrement nakcnt *again* (if not already 0), or restore the reload value (which was never changed) on success. Since the double decrement was wrong to begin with, and is no longer needed now that we set nakcnt directly to 0 on USB_RET_NAK, and the restore of reload is not needed either, this patch simply removes all nakcnt handling from ehci_state_executing(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb-ehci: Remove dead nakcnt codeHans de Goede1-20/+0
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. 2) ehci_state_fetchqh does: nakcnt = reload; but before nakcnt is ever used ehci_state_fetchqh is always followed by a ehci_qh_do_overlay call which also does: nakcnt = reload; So doing this from ehci_state_fetchqh is redundant. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb-ehci: Fix cerr trackingHans de Goede1-13/+6
cerr should only be decremented on errors which cause XactErr to be set, and when that happens the failing transaction should be retried until cerr reaches 0 and only then should USBSTS_ERRINT be set (and inactive cleared and USBSTS_INT set if requested). Since we don't have any hardware level errors (and in case of redirection the real hardware has already retried), re-trying makes no sense, so immediately set cerr to 0 on errors which set XactErr. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb-ehci: Any packet completion except for NAK should set the interruptHans de Goede1-1/+1
As clearly stated in the 2.3.2 of the EHCI spec, any time USBERRINT get sets 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 USBINT if the IOC bit is set. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-07usb-ehci: Rip the queues when the async or period schedule is haltedHans de Goede1-1/+4
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>