summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2014-03-19unifying: rename input queue, fix error queuePeter Wu2-14/+40
Fix error queue name, rename input queue for clarity. Split input and output queue for further work and NAK when there is no interrupt data available.
2014-03-18unifying: WIP for HID++ supportPeter Wu4-14/+326
Error queue is implemented, possible receiver and device properties are filled in (in the header). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17unifying: move definitions to headerPeter Wu2-19/+47
Prepare for adding DJ support, which I expect to be huge and unrelated to the HID code. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17usbdump: fix endpoint lookupPeter Wu1-5/+9
bNumEndpoints specify the number of endpoints in the endpoint descriptor. When the mouse endpoint was tried (EP2), it triggered this assertion because there is only one endpoint for the interface. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17unifying: support HID Get_Report and Set_ReportPeter Wu1-8/+13
Copied from dev-hid.c (order changed to match interfaces order). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17unifying: implement basic HID processingPeter Wu1-22/+143
For now, the receiver has always a mouse and keyboard paired. Set_Idle, Get_Idle, Get_Protocol and Set_Protocol support interface-specific devices. Interrupt data for the HID mode are also implemented. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17usbdump: do not hard-code bus number, use nr from USBBusPeter Wu1-1/+3
Instead of changing bus.c (next_usb_bus) and possibly breaking configurations relying on this number, just add one in the dump code for cosmetic purposes. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix start time offset of capturePeter Wu1-3/+2
There is still a discrepancy (seen 300 ms and 600 ms), but it is better than completely a difference equal to the uptime. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usb-hid: usbdump example for control and interrupt INPeter Wu1-0/+17
This is verified to reproduce the same capture as done inside the VM. The differences are in time, bInterval, URB length, URB ID and the Copy of transfer flags. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: comments updatePeter Wu2-3/+28
And I was wondering why the interrupt packets in dev-hid.c had a reversed type marking...
2014-03-16usbdump: fix IN marking for non-control packetsPeter Wu1-2/+8
Non-control transfers have a meaningless setup buffer. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: constantify variablesPeter Wu2-17/+17
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix reversal of URB length and captured lengthPeter Wu1-4/+11
The "length" field stores the expected size of data. "len_cap" stores the real length of the data in the current packet (the "captured" data). Also try to set a slightly more sane length value depending on submission type, but this is much braindead. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix interval retrieval for endpointPeter Wu1-2/+4
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: initial API extension for handle_dataPeter Wu2-1/+83
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fail early if dump file is not availablePeter Wu3-8/+15
This allows for less less checking by the consumer and avoids unnecessary work if the capture cannot be written anyway. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16unifying: remove unused leftover from dev-wacomPeter Wu1-186/+7
To make a tidy ship, remove unused parts that were taken from dev-wacom. Also enable a handle_data callback (currently empty), handle_reset (currently sets the device mode to HID instead of DJ). This is incomplete, the handle_data callback must contain something. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: get interval from descriptorPeter Wu1-2/+21
It looks very ugly, perhaps a helper function should moved to desc.c? Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16unifying: hook up usbdump with handle_controlPeter Wu1-6/+30
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16Initial usbdump helperPeter Wu3-0/+430
USB packets are captured in the pcap format using the Linux usbmon link-layer type. Right now, this only works with handle_ctrl. Data packets (isochronous, bulk and interrupt) are not (fully) implemented yet. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16unifying: WIP for Logitech Unifying Receiver emulationPeter Wu2-0/+669
Based on hw/usb/dev-wacom.c
2014-03-14virtio-scsi: actually honor sense_size from configuration spacePaolo Bonzini1-1/+3
We were always truncating the sense size to 96 bytes. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-03-14scsi: Fix migration of scsi sense dataFam Zheng1-1/+29
c5f52875 changed the size of sense array in vmstate_scsi_device by mistake. This patch restores the old size, and add a subsection for the remaining part of the buffer size. So that migration is not broken. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-03-14spapr-vscsi: fix CRQ statusAlexey Kardashevskiy1-2/+2
Normally VIOSRP_OK (0) means success and non-zero value means error except VIOSRP_OK2 (0x99) which is another success code by weird accident. This uses 0 as success code always as some guests do not cope with the 0x99 value well. The existing linux driver checks for both VIOSRP_OK and VIOSRP_OK2 since 2.6.32. This returns non-zero code (VIOSRP_ADAPTER_FAIL == 0x10) on errors which can only happen if DMA write failed. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-03-13Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-2.0' ↵Peter Maydell1-18/+6
into staging QOM/QTest infrastructure fixes * QOM cast fix for virtserialport and regression test * QTest error handling fix * QTest output cleanup # gpg: Signature made Thu 13 Mar 2014 20:43:34 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-2.0: main-loop: Suppress "I/O thread spun" warnings for qtest qtest: Fix crash if SIGABRT during qtest_init() virtio-console-test: Test virtserialport as well virtio-console: Fix VIRTIO_CONSOLE() cast macro Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13Merge remote-tracking branch 'remotes/afaerber/tags/ppc-for-2.0' into stagingPeter Maydell1-1/+3
PowerPC queue for 2.0 * Fixes for -device VGA # gpg: Signature made Thu 13 Mar 2014 19:57:12 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/ppc-for-2.0: spapr: Fix return value of vga initialization Fix vga_interface_type for command line argument '-device VGA' Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13virtio-console: Fix VIRTIO_CONSOLE() cast macroAndreas Färber1-18/+6
Commit 0399a3819b27083ba69b88a9baa9025facab85bd (virtio-console: QOM cast cleanup for VirtConsole) broke virtserialport since it shares functions and state struct with virtconsole. Let virtconsole inherit from virtserialport, and use virtserialport type for casting. Note that virtio-serial-port is the abstract base type in virtio-serial-bus.c, whereas virtserialport is the user-instantiatable type in virtio-console.c. Therefore using TYPE_VIRTIO_CONSOLE_SERIAL_PORT. Reported-by: Richard W.M. Jones <rjones@redhat.com> Acked-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-2.0' into stagingPeter Maydell2-40/+57
PReP machine and devices * ppc_rom.bin update * Raven PCI host bridge preparations for OpenBIOS # gpg: Signature made Thu 13 Mar 2014 19:28:37 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/prep-for-2.0: raven: Move BIOS loading from board code to PCI host prep: Update ppc_rom.bin Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13spapr: Fix return value of vga initializationMark Wu1-1/+3
Before spapr_vga_init will returned false if the vga is specified by the command '-device VGA' because vga_interface_type was evaluated to VGA_NONE. With the change in previous patch of this series, spapr_vga_init should return true if it's told that the vga will be initialized in flow of the generic devices initialization. To keep '-nodefaults' have the semantics of bare minimum, it adds a check of 'has_defaults' in usb_enabled() to avoid that a USB controller is added by '-nodefautls, -device VGA' implicitly. This patch also makes two cleanups: 1. skip initialization for VGA_NONE 2. remove the useless 'break' Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13raven: Move BIOS loading from board code to PCI hostHervé Poussineau2-40/+57
Raven datasheet explains where firmware lives in system memory, so do it there instead of in board code. Other boards using the same PCI host will not have to copy the firmware loading code. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> [AF: Drop BIOS size workaround in favor of replacing our firmware blob] Signed-off-by: Andreas Färber <andreas.faerber@web.de>
2014-03-13cputlb: Change tlb_flush() argument to CPUStateAndreas Färber1-1/+1
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu-exec: Change cpu_resume_from_signal() argument to CPUStateAndreas Färber1-1/+1
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change tb_gen_code() argument to CPUStateAndreas Färber1-1/+1
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change cpu_restore_state() argument to CPUStateAndreas Färber1-1/+1
This lets us drop some local variables in tlb_fill() functions. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move exception_index field from CPU_COMMON to CPUStateAndreas Färber4-9/+6
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move mem_io_{pc,vaddr} fields from CPU_COMMON to CPUStateAndreas Färber1-1/+1
Reset them. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13target-i386: Enable x2apic by default on KVMEduardo Habkost2-0/+2
When on KVM mode, enable x2apic by default on all CPU models. Normally we try to keep the CPU model definitions as close as the real CPUs as possible, but x2apic can be emulated by KVM without host CPU support for x2apic, and it improves performance by reducing APIC access overhead. x2apic emulation is available on KVM since 2009 (Linux 2.6.32-rc1), there's no reason for not enabling x2apic by default when running KVM. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13target-i386: Introduce x86_cpu_compat_disable_kvm_features()Eduardo Habkost1-3/+3
Instead of the feature-specific disable_kvm_pv_eoi() function, create a more general function that can be used to disable other feature bits in machine-type compat code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13target-ppc: Clean up ENV_GET_CPU() usageAndreas Färber2-4/+4
Commits fdfba1a298ae26dd44bcfdb0429314139a0bc55a, ab1da85791340e504d10487e1add81b9988afa98, f606604f1c10b60ef294f1b9b229426521a365e3 and 2c17449b3022ca9623c4a7e2a504a4150ac4ad30 added usages of ENV_GET_CPU() macro in target-specific code. Use ppc_env_get_cpu() instead. Cc: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell2-50/+116
staging Block pull request # gpg: Signature made Thu 13 Mar 2014 13:50:49 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: (24 commits) block/raw-win32: bdrv_parse_filename() for hdev block/raw-posix: Strip protocol prefix on creation block/raw-posix: bdrv_parse_filename() for cdrom block/raw-posix: bdrv_parse_filename() for floppy block/raw-posix: bdrv_parse_filename() for hdev qemu-io: Fix warnings from static code analysis block: Unlink temporary file qcow2: Don't write with BDRV_O_INCOMING qcow2: Keep option in qcow2_invalidate_cache() qmp: add query-iothreads command iothread: stash thread ID away dataplane: replace internal thread with IOThread iothread: add "iothread" qdev property type qdev: make get_pointer() handle temporary strings iothread: add I/O thread object aio: add aio_context_acquire() and aio_context_release() rfifolock: add recursive FIFO lock object: add object_get_canonical_path_component() block: Rewrite the snapshot authorization mechanism for block filters. iotests: Test corruption during COW request ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13dataplane: replace internal thread with IOThreadStefan Hajnoczi1-42/+54
Today virtio-blk dataplane uses a 1:1 device-per-thread model. Now that IOThreads have been introduced we can generalize this to N:M devices per threads. This patch drops thread code from dataplane in favor of running inside an IOThread AioContext. As a bonus we solve the case where a guest keeps submitting I/O requests while dataplane is trying to stop. Previously the dataplane thread would continue to process requests until the request gave it a break. Now we can shut down in bounded time thanks to aio_context_acquire/release. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-13iothread: add "iothread" qdev property typeStefan Hajnoczi1-0/+51
Add a "iothread" qdev property type so devices can be hooked up to an IOThread from the comand-line: qemu -object iothread,id=iothread0 \ -device some-device,x-iothread=iothread0 Note that Paolo Bonzini <pbonzini@redhat.com> has suggested using QOM links instead. This way the relationship between the objects is reflected in QOM. There are currently shortcomings of object_property_add_link() which prevent this use case. I will attempt to fix them and move to QOM links in a separate series. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-13qdev: make get_pointer() handle temporary stringsIgor Mammedov1-8/+11
get_pointer()'s print() callback might return a heap allocated string, to avoid adding dedicated get_pointer_foo for this case convert current print() callbacks to return temporary heap allocated string and make get_pointer() free it. Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-13Merge remote-tracking branch 'remotes/afaerber/tags/ppc-for-2.0' into stagingPeter Maydell2-27/+36
PowerPC queue for 2.0-rc0 * QEMUMachine include cleanup * SLOF update * XICS reset fix * sPAPR PCI host bridge refactorings # gpg: Signature made Thu 13 Mar 2014 02:50:51 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/ppc-for-2.0: spapr-pci: Convert fprintf() to error_report() spapr-pci: Convert to QOM realize xics-kvm: Fix reset function pseries: Update SLOF firmware image to qemu-slof-20140304 Move QEMUMachine typedef to qemu/typedefs.h Revert "KVM: Split QEMUMachine typedef into separate header" Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-13spapr-pci: Convert fprintf() to error_report()Alexey Kardashevskiy1-4/+5
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Mike Day <ncmike@ncultra.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13spapr-pci: Convert to QOM realizeAlexey Kardashevskiy1-22/+21
This converts the old-style SysBusDevice::init() callback to a new-style DeviceClass::realize() callback. As a part of conversion, this replaces fprintf(stderr) with error_setg() as realize() does not "return" any value, instead it puts the extended error into **errp. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Mike Day <ncmike@ncultra.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13xics-kvm: Fix reset functionAlexey Kardashevskiy1-1/+10
Currently interrupt priorities are set to 0 (highest) at the very beginning of the guest execution which is not correct and makes the guest produce random interrupt error messages such as: "Interrupt 0x1001 (real) is invalid, disabling it". This also prevents interrupt states from correct migration. This initializes priority to 0xFF as the emulated XICS does. Suggested-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13pci: Move VMState registration/unregistration to QOM realize/unrealizeBandan Das1-21/+30
Use the realize and unrealize hooks to register and unregister vmstate_pcibus respectively. Relocate some stuff to avoid forward declarations. Signed-off-by: Bandan Das <bsd@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> [AF: Keep using PCI_BUS() cast macro] Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13qdev: Realize buses on device realizationBandan Das1-5/+22
Integrate (un)realization of child buses with realization/unrealization of the device hosting them. Code in device_unparent() is reordered for unrealization of buses to work as part of device unrealization. That way no changes need to be made to bus instantiation. Signed-off-by: Bandan Das <bsd@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13qdev: Prepare realize/unrealize hooks for BusStateBandan Das1-0/+41
Add a "realized" property calling realize/unrealize hooks as for devices. Signed-off-by: Bandan Das <bsd@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>