summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-03-14bsd-user: Don't overuse CPUStateAndreas Färber1-2/+2
Use CPU*State where applicable. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-03-14darwin-user: Don't overuse CPUStateAndreas Färber2-9/+9
Use CPU*State where applicable. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-03-14linux-user: Don't overuse CPUStateAndreas Färber4-124/+131
In target-specific code use CPU*State. While at it, fix indentation on those lines. Signed-off-by: Andreas Färber <afaerber@suse.de>
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-14target-unicore32: Rename to CPUUniCore32StateAndreas Färber1-4/+4
This aids in refactoring CPUState by adopting the common naming scheme. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14target-sparc: Typedef struct CPUSPARCState earlyAndreas Färber1-2/+4
Will be needed for qemu_irq_ack callback. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14target-lm32/microblaze: Typedef struct CPU{MB,LM32}StateAndreas Färber2-0/+2
Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14monitor: Avoid CPUState in read/write functionsAndreas Färber1-28/+28
Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14monitor: Don't access registers through CPUStateAndreas Färber1-246/+246
Use CPUX86State etc. instead (hand-converted). 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ärber48-61/+98
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 Graf4-27/+7
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-14qom: Introduce object_class_get_list()Andreas Färber2-0/+28
This function allows to obtain a singly-linked list of classes, which can be sorted by the caller. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14qom/object.c: rename type_class_init() to type_initialize()Igor Mitsyanko1-6/+6
Function name type_class_init() gave us a wrong impression of separation of type's "class" and "object" entities initialization. Name type_initialize() is more appropriate for type_class_init() function (considering what operations it performs). Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14qom: if @instance_size==0, assign size of object to parent object sizeIgor Mitsyanko1-2/+17
QOM documentation states that for objects of type with @instance_size == 0 size will be assigned to match parent object's size. But currently this feauture is not implemented and qemu asserts during creation of object with zero instance_size. Set appropriate value for type instance_size during type_class_init() call. object_initialize_with_type() must call type_class_init() before asserting type->instance_size, and object_new_with_type() must call type_class_init() before object allocation. Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 'kiszka/queues/slirp' into stagingAnthony Liguori12-39/+116
* kiszka/queues/slirp: slirp: Fix compiler warning for w64 slirp: Cleanup resources on instance removal slirp: Remove unneeded if_queued slirp: Fix queue walking in if_start slirp: Prevent recursion of if_start slirp: Keep next_m always valid
2012-03-13Merge remote-tracking branch 'kraxel/usb.44' into stagingAnthony Liguori39-218/+226
* 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-13qom: Add QOM support to user emulatorsAndreas Färber8-8/+70
Link the Object base class and the module infrastructure for class registration. Introduce $(universal-obj-y) for objects that are more common than $(common-obj-y), so that those only get built once. Call QOM module init for type registration. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-13qom: Register QOM infrastructure earlyAndreas Färber1-2/+2
The constructors for QOM TYPE_INTERFACE were executed rather late in vl.c's main(). Call them very early so that QOM can safely be used for machines and CPUs. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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-13slirp: Fix compiler warning for w64Stefan Weil1-1/+1
Casting a pointer to an integer value must use uintptr_t or intptr_t (not long) for portable code. MinGW-w64 requires this because sizeof(long) != sizeof(void *) for w64 hosts, so casting to long raises a compiler warning. I use uintptr_t instead of intptr_t because changing the sign does not matter here and casting pointers to unsigned values seems more reasonable (the unsigned value is a non negative offset. Cc: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-03-13slirp: Cleanup resources on instance removalJan Kiszka10-0/+58
Close & free sockets when shutting down a slirp instance, also release all buffers. CC: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-03-13slirp: Remove unneeded if_queuedJan Kiszka3-17/+2
There is now a trivial check on entry of if_start for pending packets, so we can drop the additional tracking via if_queued. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-03-13slirp: Fix queue walking in if_startJan Kiszka1-21/+39
Another attempt to get this right: We need to carefully walk both the fastq and the batchq in if_start while trying to send packets to possibly not yet resolved hosts on the virtual network. So far we just requeued a delayed packet where it was and then started walking the queues from the top again - that couldn't work. Now we pre- calculate the next packet in the queue so that the current one can safely be removed if it was sent successfully. We also need to take into account that the next packet can be from the same session if the current one was sent and there are no other sessions. CC: Fabien Chouteau <chouteau@adacore.com> CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> CC: Stefan Weil <sw@weilnetz.de> Tested-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-03-13slirp: Prevent recursion of if_startJan Kiszka2-1/+11
if_start can be called recursively via if_encap. Avoid this as our scheme of dequeuing packets is not compatible with this. CC: Fabien Chouteau <chouteau@adacore.com> CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> CC: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-03-13slirp: Keep next_m always validJan Kiszka1-8/+14
Make sure that next_m always points to a packet if batchq is non-empty. This will simplify walking the queues in if_start. CC: Fabien Chouteau <chouteau@adacore.com> CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> CC: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.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 Hoffmann2-55/+63
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 Hoffmann3-6/+33
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 Hoffmann27-70/+74
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 'mdroth/qga-pull-3-12-2012' into stagingAnthony Liguori7-21/+774
* mdroth/qga-pull-3-12-2012: qemu-ga: add guest-sync-delimited qemu-ga: add guest-network-get-interfaces command qemu-ga: add win32 guest-suspend-ram command qemu-ga: add win32 guest-suspend-disk command. qemu-ga: add guest-suspend-hybrid qemu-ga: add guest-suspend-ram qemu-ga: add guest-suspend-disk
2012-03-12Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori28-267/+1054
* kwolf/for-anthony: test-coroutine: add performance test for nesting coroutine: adding configure option for sigaltstack coroutine backend coroutine: adding configure choose mechanism for coroutine backend coroutine: adding sigaltstack method (.c source) qcow2: Reduce number of I/O requests qcow2: Add qcow2_alloc_clusters_at() qcow2: Factor out count_cow_clusters qmp: convert blockdev-snapshot-sync to a wrapper around transactions add mode field to blockdev-snapshot-sync transaction item rename blockdev-group-snapshot-sync qapi: complete implementation of unions use QSIMPLEQ_FOREACH_SAFE when freeing list elements Add 'make check-block' make check: Add qemu-iotests subset qemu-iotests: Mark some tests as quick qcow2: Add error messages in qcow2_truncate block: handle -EBUSY in bdrv_commit_all() qcow2: Add some tracing qed: do not evict in-use L2 table cache entries Group snapshot: Fix format name for backing file
2012-03-12Merge remote-tracking branch 'qemu-kvm/memory/core' into stagingAnthony Liguori6-267/+168
* qemu-kvm/memory/core: memory: get rid of cpu_register_io_memory() memory: dispatch directly via MemoryRegion exec: fix code tlb entry misused as iotlb in get_page_addr_code() memory: store section indices in iotlb instead of io indices memory: make phys_page_find() return an unadjusted section
2012-03-12Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori7-12/+64
* 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-12Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2-7/+10
* qmp/queue/qmp: qapi-schema.json: fix comment for type ObjectPropretyInfo qapi-schema: fix typos and explain 'spice' auth qjson.h: include compiler.h for GCC_FMT_ATTR
2012-03-12qemu-ga: add guest-sync-delimitedMichael Roth5-9/+77
guest-sync leaves it as an exercise to the user as to how to reliably obtain the response to guest-sync if the client had previously read in a partial response (due qemu-ga previously being restarted mid-"sentence" due to reboot, forced restart, etc). qemu-ga handles this situation on its end by having a client precede their guest-sync request with a 0xFF byte (invalid UTF-8), which qemu-ga/QEMU JSON parsers will treat as a flush event. Thus we can reliably flush the qemu-ga parser state in preparation for receiving the guest-sync request. guest-sync-delimited provides the same functionality for a client: when a guest-sync-delimited is issued, qemu-ga will precede it's response with a 0xFF byte that the client can use as an indicator to flush its buffer/parser state in preparation for reliably receiving the guest-sync-delimited response. It is also useful as an optimization for clients, since, after issuing a guest-sync-delimited, clients can safely discard all stale data read from the channel until the 0xFF is found. More information available on the wiki: http://wiki.qemu.org/Features/QAPI/GuestAgent#QEMU_Guest_Agent_Protocol Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-03-12qemu-ga: add guest-network-get-interfaces commandMichal Privoznik3-0/+246
This command returns an array of: [ifname, hwaddr, [ipaddr, ipaddr_family, prefix] ] for each interface in the system. Currently, only IPv4 and IPv6 are supported. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2012-03-12qemu-ga: add win32 guest-suspend-ram commandMichael Roth1-9/+25
S3 sleep implementation for windows.
2012-03-12qemu-ga: add win32 guest-suspend-disk command.Gal Hammer2-13/+121
Implement guest-suspend-disk RPC for Windows. Functionally this should be equivalent to the posix implementation. Signed-off-by: Gal Hammer <ghammer@redhat.com>
2012-03-12qemu-ga: add guest-suspend-hybridLuiz Capitulino3-0/+38
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>