aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-05-08xen: Support new libxc calls from xen unstable.Anthony PERARD6-32/+164
This patch updates the libxenctrl calls in Qemu to use the new interface, otherwise Qemu wouldn't be able to build against new versions of the library. We check libxenctrl version in configure, from Xen 3.3.0 to Xen unstable. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08xen: Make Xen build once.Anthony PERARD1-1/+1
xen_domainbuild and xen_machine_pv are built only for i386 targets. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08xen: Replace some tab-indents with spaces (clean-up).Anthony PERARD3-534/+634
And put braces for blocks with a single statement. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08machine, Add default_machine_opts to QEMUMachine.Anthony PERARD2-0/+23
With this new field, we can specified which accelerator use to run the machine, if the accelerator is not already specified by either a configuration file or the command line options. Currently, the only use will be made in the xenfv machine. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08Introduce -machine command option.Anthony PERARD5-12/+120
This option gives the ability to switch one "accelerator" like kvm, xen or the default one tcg. We can specify more than one accelerator by separate them by a colon. QEMU will try each one and use the first whose works. So, ./qemu -machine accel=xen:kvm:tcg which would try Xen support first, then KVM and finally TCG if none of the other works. By default, QEMU will use TCG. But we can specify another default in the global configuration file. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08irq: Privatize CPU_INTERRUPT_NMI.Richard Henderson5-5/+7
This interrupt name is used by i386, CRIS, and MicroBlaze. Copy the name into each target. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-08target-i386: Privatize some i386-specific interrupt names.Richard Henderson3-7/+8
SMI, VIRQ, INIT, SIPI, and MCE are all only used by the i386 port. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-08target-arm: Privatize CPU_INTERRUPT_FIQ.Richard Henderson3-2/+4
This interrupt name was only used by the ARM port. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-08irq: Remove CPU_INTERRUPT_TIMER.Richard Henderson2-2/+0
It is no longer used anywhere. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-08target-sparc: Do not check CPU_INTERRUPT_TIMER.Richard Henderson1-3/+0
This bit is never set, therefore we should not read it either. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-08target-mips: Do not check CPU_INTERRUPT_TIMER.Richard Henderson1-4/+0
This bit is never set, therefore we should not read it either. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-08irq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.Richard Henderson2-4/+9
This mask contains all of the bits that should be ignored while single stepping in the debugger. The mask contains 2 bits that are not currently cleared, but are also never set. The bits are included in the mask for consistency in handling of the CPU_INTERRUPT_TGT_EXT_N bits. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-08irq: Introduce CPU_INTERRUPT_TGT_* defines.Richard Henderson2-12/+59
These defines will be place-holders for cpu-specific functionality. Generic code will, at the end of the patch series, no longer have to concern itself about how SMI, NMI, etc should be handled. Instead, generic code will know only that the interrupt is internal or external. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-05Merge remote-tracking branch 'mst/for_anthony' into stagingAnthony Liguori19-298/+545
2011-05-05Merge remote-tracking branch 'kraxel/usb.7.pull' into stagingAnthony Liguori8-149/+445
2011-05-05Merge remote branch 'origin/master' into pciMichael S. Tsirkin393-6353/+32099
Conflicts: exec.c
2011-05-05CPUPhysMemoryClient: Pass guest physical address not region offsetAlex Williamson1-4/+12
When we're trying to get a newly registered phys memory client updated with the current page mappings, we end up passing the region offset (a ram_addr_t) as the start address rather than the actual guest physical memory address (target_phys_addr_t). If your guest has less than 3.5G of memory, these are coincidentally the same thing. If there's more, the region offset for the memory above 4G starts over at 0, so the set_memory client will overwrite it's lower memory entries. Instead, keep track of the guest phsyical address as we're walking the tables and pass that to the set_memory client. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05CPUPhysMemoryClient: Fix typo in phys memory client registrationAlex Williamson1-1/+1
When we register a physical memory client, we try to walk the page tables, calling the set_memory hook for every entry. Effectively playing catchup for the client for everything already registered. With this type, we only walk the 2nd entry of the l1 table, typically missing all of the registered memory. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05pci: Add class 0x403 as 'audio controller'Jan Kiszka1-0/+1
Used by HD audio controllers like our intel-hda. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05MSI: Robust resource releaseJan Kiszka3-9/+12
msi_init may fail, so we need to check on uninit if the cap was actually installed. This also avoids that the users need to check. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Support 32 bit read/write access to flash registerStefan Weil1-0/+9
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Support byte read access to general control registerStefan Weil1-0/+3
The general control register is a byte register. Add support for byte reads. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Support byte/word read/write access to MDI control registerStefan Weil1-2/+32
MDI control is a 32 bit register, but may be read or written using 8 or 16 bit access. Data is latched when the MSB is written. Add support for byte/word read/write access. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Support byte/word writes to pointer registerStefan Weil1-17/+16
pointer is a 32 bit register, but may be written using 8 or 16 bit writes. Add support for byte/word writes. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Support byte/word writes to port addressStefan Weil1-2/+18
port is a 32 bit register, but may be written using 8 or 16 bit writes. Add support for byte/word writes. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Fix endianness issuesStefan Weil1-44/+97
Like other Intel devices, e100 (eepro100) uses little endian byte order. This patch was tested with these combinations: i386 host, i386 + mipsel guests (le-le) mipsel host, i386 guest (le-le) i386 host, mips + ppc guests (le-be) mips host, i386 guest (be-le) mips and mipsel hosts were emulated machines. v2: Use prefix for new functions. Add the same prefix to stl_le_phys. Fix alignment of mem (needed for word/dword reads/writes). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Pad received short framesStefan Weil1-1/+25
QEMU sends frames smaller than 60 bytes to ethernet nics. Such frames are rejected by real NICs and their emulations. To avoid this behaviour, other NIC emulations pad received frames. This patch enables this workaround for eepro100, too. All related code is marked with CONFIG_PAD_RECEIVED_FRAMES, so we can drop this in case QEMU's networking code is ever changed. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Remove unused structure elementStefan Weil1-3/+3
cppcheck reports that 'packet' is unused. It was only used to calculate the size of the preceding data. Removing it saves a lot of stack space (local variable rx). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Remove type casts which are no longer neededStefan Weil1-7/+6
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05eepro100: Avoid duplicate debug messagesStefan Weil1-5/+9
When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice. Now logging in eepro100_write1 and eepro100_write2 is similar to the logging in eepro100_write4 (which already was correct). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-04usb: mass storage fixGerd Hoffmann1-0/+1
Initialize scsi_len with zero when starting a new request, so any stuff leftover from the previous request is cleared out. This may happen in case the data returned by the scsi command doesn't fit into the buffer provided by the guest. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-04usb: move complete callback to port opsGerd Hoffmann7-34/+34
2011-05-04musb: get musb state via container_of()Gerd Hoffmann1-20/+34
2011-05-04ohci: get ohci state via container_of()Gerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-04uhci: keep uhci state pointer in async packet struct.Gerd Hoffmann1-4/+8
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-04uhci: switch to QTAILQGerd Hoffmann1-48/+15
2011-05-04usb: control buffer fixesHans de Goede2-1/+7
Windows allows control transfers to pass up to 4k of data, so raise our control buffer size to 4k. For control out transfers the usb core code copies the control request data to a buffer before calling the device's handle_control callback. Add a check for overflowing the buffer before copying the data. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-05-04usb-linux: Add support for buffering iso out usb packetsHans de Goede1-51/+101
Extend the iso buffering code to also buffer iso out packets, this fixes for example using usb speakers with usb redirection. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-05-04usb-linux: We only need to keep track of 15 endpointsHans de Goede1-3/+3
Currently we reserve room for endpoint data for 16 endpoints, but given that we only use endpoint data for endpoints 1-15, and always index the array with the endpoint-number - 1, 15 is enough. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-05-04usb-linux: Refuse iso packets when max packet size is 0 (alt setting 0)Hans de Goede1-1/+5
Refuse iso usb packets when then max packet size for the endpoint is 0, this avoids an abort in usb_host_alloc_iso() caused by trying to qemu_malloc a 0 bytes large buffer.
2011-05-04usb-linux: Refuse packets for endpoints which are not in the usb descriptorHans de Goede1-0/+13
If an endpoint is not in the usb descriptor we've no idea what kind of endpoint it is and thus how to handle it, refuse packages in this case. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-05-04usb-linux: Add support for buffering iso usb packetsHans de Goede1-17/+226
Currently we are submitting iso packets to the host one at a time, as we receive them from the emulated host controller. This has 2 problems: 1) If we were fast enough to submit every packet in time for the next host host controller usb frame, we would be generating 1000 hardware interrupts per second on the host 2) We are not fast enough to submit every packet in time for the next host host controller usb frame, causing us to not submit iso urbs in some usb frames which causes devices with an endpoint with an interval of 1 ms (so every frame) to loose data. This causes for example ubs-1.1 webcams to not work properly (usb-2.0 is not supported at all atm). This patch fixes both problems by changing the iso packet pass through handling to buffer packets. This version only does so for iso input packets (webcams, audio in) I'm working on a second patch extending this to iso output packets (audio out). This patch makes use of the linux batching of iso packets in one urb. When an iso in packet gets received from the emulated host controller, it immediately submits 3 urbs with 32 iso in packets each. This causes the host to only get an hw interrupt every 32 packets dropping the interrupt rate to 32 interrupts per second and gives it a queue of urbs to work from once the first 32 iso in packets have been received to make sure no packets are dropped. Besides submitting a whole bunch or urbs as soon as the first urb is received, effectively creating a buffer inside the kernel, this patch also gets rid of the asynchroneous completion for iso in urbs. Instead they are only marked as complete in the fd write callback (which usbfs uses to signal complete urbs). These complete packets then get consumed by returning them synchroneously to the emulated host controller when it submits an iso in packet for the ep in question. When no complete packets are ready (which happens when the stream is starting) a 0 length packet gets returned to the emulated host controller. With this patch I've several usb-1.1 webcams working well with usb pass through, where as without this patch none of them work. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-05-04usb-linux: Get the alt. setting from sysfs rather then asking the devHans de Goede1-0/+18
At least one device I have lies when receiving a USB_REQ_GET_INTERFACE, always returning 0 even if the alternate setting is different. This is likely caused because in practice this control message is never used as the operating system's usb stack knows which alternate setting it has told the device to get into, and thus this ctrl message does not get tested by device manufacturers. When usb_fs_type == USB_FS_SYS, the active alt. setting can be read directly from sysfs, which allows using this device through qemu's usb redirection. More in general it seems a good idea to not send needless control msg's to devices, esp. as the code in question is called every time a set_interface is done. Which happens multiple times during virtual machine startup, and when device drivers are activating the usb device. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-05-04usb-linux: introduce a usb_linux_alt_setting functionHans de Goede1-15/+25
The next patch in this series introduces multiple ways to get the alt setting dependent upon usb_fs_type, it is cleaner to put this into its own function. Note that this patch also changes the assumed alt setting in case of an error getting the alt setting to be 0 (a sane default) rather then the interface numberwhich makes no sense. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-05-03spice: drop obsolete iothread lockingGerd Hoffmann2-14/+0
We don't use qemu internals from spice server context any more. Thus we don't also need to grab the iothread mutex from spice server context. And we don't have to temporarely release the lock to avoid deadlocks. Drop all the calls. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03spice: don't call displaystate callbacks from spice server context.Gerd Hoffmann4-13/+29
This patch moves the displaystate callback calls for setting the cursor and the mouse pointer from spice server to qemu (iothread) context. This allows us to simplify locking. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03spice: don't create updates in spice server context.Gerd Hoffmann3-27/+54
This patch moves the creation of spice screen updates from the spice server context to qemu iothread context (display refresh timer to be exact). This way we avoid accessing qemu internals (display surface) from spice thread context which in turn allows us to simplify locking. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03Make spice dummy functions inline to fix calls not checking return valuesJes Sorensen1-2/+10
qemu_spice_set_passwd() and qemu_spice_set_pw_expire() dummy functions needs to be inline, in order to handle the case where they are called without checking the return value. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03NBD: Avoid leaking a couple of strings when the NBD device is closedNick Thomas1-0/+4
Signed-off-by: Nick Thomas <nick@bytemark.co.uk> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-05-03qemu-progress.c: printf isn't signal safeJes Sorensen1-1/+6
Change the signal handling to indicate a signal is pending, rather then printing directly from the signal handler. In addition make the signal prints go to stderr, rather than stdout. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>