Commit Graph

5194 Commits

Author SHA1 Message Date
Juha Riihimäki d4220389ff hw/nand: qdevify
Qdevify the NAND device.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:21:31 +02:00
Peter Maydell 89f640bc04 hw/nand: Writing to NAND can only clear bits
Writing to a NAND device cannot set bits, it can only clear them;
implement this rather than simply copying the data.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:11:24 +02:00
Juha Riihimäki d72245fbcf hw/nand: Support multiple reads following READ STATUS
After receiving READ STATUS command all subsequent IO reads should return
the status register value until another command is issued.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:10:06 +02:00
Juha Riihimäki 48197dfa6a hw/nand: Support devices wider than 8 bits
Support NAND devices which are wider than 8 bits.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:09:32 +02:00
Andrzej Zaborowski ac2466cdc6 nand: Bump vmstate version after changing structure.
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:01:37 +02:00
Juha Riihimäki d5f2fd586f hw/nand: Support large NAND devices
Add support for NAND devices of over 1Gb.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:00:48 +02:00
Peter Maydell 522f253ca8 hw/nand: Pass block device state to init function
Pass the BlockDeviceState to the nand_init() function rather
than having it look it up via drive_get() itself.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:00:45 +02:00
Peter Maydell c4f05c8cf7 lm832x: Take DeviceState pointer in lm832x_key_event()
Since lm832x has been qdev'ified, its users will generally
have a DeviceState pointer rather than an i2c_slave pointer,
so adjust lm832x_key_event's prototype to suit.

This allows the n810 (its only user) to actually pass a correct
pointer to it rather than NULL. The effect is that we no longer
segfault when a key is pressed.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:00:42 +02:00
Juha Riihimäki 77831c204f hw/omap_gpio.c: Convert to qdev
Convert the OMAP GPIO module to qdev.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:00:40 +02:00
Peter Maydell 0a34f96690 hw/omap_clk: Add the clock for the OMAP2430-specific fifth GPIO module
The OMAP2430 has a fifth GPIO module which earlier OMAP2 models lack; add
the clock definition for it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:00:38 +02:00
Juha Riihimäki f9049203d3 hw/omap_l4.c: Add helper function omap_l4_region_base
Add helper function omap_l4_region_base() to return the base address
of a particular region of an L4 target agent.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by:  Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-30 06:00:33 +02:00
Anthony Liguori 3046c98404 Merge remote-tracking branch 'agraf/xen-next' into staging 2011-07-29 09:42:12 -05:00
Anthony Liguori e374560232 Merge remote-tracking branch 'kraxel/migration.2' into staging 2011-07-29 09:39:37 -05:00
Göran Weinholt 6b8273a1b9 multiboot: Fix bss segment support
Multiboot images can specify a bss segment. The boot loader must clear
the memory of the bss and ensure that no modules or structures are
allocated inside it. Several fields are provided in the Multiboot
header that were previously not used properly. The header is now used
to determine how much data should be read from the image and how much
memory should be reserved to the bss segment.

Signed-off-by: Göran Weinholt <goran@weinholt.se>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 09:33:56 -05:00
Dr. David Alan Gilbert 33fa8234c3 Fix last sector write on sd card
When writing the last sector of an SD card using WRITE_MULTIPLE_BLOCK
QEmu throws an error saying that we've run off the end, and leaves
itself in the wrong state.

    Tested on ARM Vexpress model.

Signed-off-by: Dr. David Alan Gilbert <david.gilbert@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 09:33:48 -05:00
wayne 3d3b8303c6 showing a splash picture when start
Added options to let qemu transfer two configuration files to bios:
"bootsplash.bmp" and "etc/boot-menu-wait", which could be specified by command
    -boot splash=P,splash-time=T
P is jpg/bmp file name or an absolute path, T have a max value of 0xffff, unit
is ms. With these two options, if user invoke qemu with menu=on option, then
a splash picture would be showed in a given time. For example:
    qemu -boot menu=on,splash=/root/boot.bmp,splash-time=5000
would make boot.bmp shown as a brand with 5 seconds in the booting up process.
This feature need the new seabios's support, which could be got from git.

Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 08:25:44 -05:00
Avi Kivity 6da48311bb usb-ohci: convert to MemoryRegion
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 08:25:44 -05:00
Avi Kivity ec3bb837a2 sysbus: add MemoryRegion based memory management API
Allow registering sysbus device memory using a MemoryRegion.  Once all users
are converted, sysbus_init_mmio() and sysbus_init_mmio_cb() will be removed.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 08:25:44 -05:00
Avi Kivity 79ff8cb0df pci: add MemoryRegion based BAR management API
Allow registering a BAR using a MemoryRegion.  Once all users are converted,
pci_register_bar() and pci_register_bar_simple() will be removed.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 08:25:44 -05:00
Avi Kivity 1e39101c64 pci: pass address space to pci bus when created
This is now done sloppily, via get_system_memory().  Eventually callers
will be converted to stop using that.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 08:25:44 -05:00
Avi Kivity 6bd105151a pc: move global memory map out of pc_init1() and into its callers
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 08:25:44 -05:00
Avi Kivity 00cb2a99f5 pc: convert pc_memory_init() to memory API
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 08:25:44 -05:00
Avi Kivity 4aa63af149 pc: grab system_memory
While eventually this should come from the machine initialization function,
take a short cut to avoid converting all machines now.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 08:25:44 -05:00
Jan Kiszka 5ab28c8340 qdev: Reset hot-plugged devices
Device models rely on the core invoking their reset handlers after init.
We do this in the cold-plug case, but so far we miss this step after
hot-plug.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-29 08:17:40 -05:00
Isaku Yamahata 43e86c8f5b pcie_host: verify mmcfg address range
For a conventional pci device behind
a pcie-to-pci bridge, pci_host handlers get confused by
an out of bounds access in the range [256, 4K).

Check for such an access and make it have no effect.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-29 08:01:52 +03:00
Amit Shah 845f85fa15 virtio: Plug memleak by freeing vdev
virtio_common_init() allocates RAM for the vdev struct (and any
additional memory, depending on the size passed to the function).  This
memory wasn't being freed until now.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-27 20:19:27 +03:00
Amit Shah b52dfd71f3 virtio-net: don't use vdev after virtio_cleanup
virtio_cleanup() will be changed by the following patch to remove the
VirtIONet struct that gets allocated via virtio_common_init().  Ensure
we don't dereference the structure after calling the cleanup function.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-27 20:18:47 +03:00
Amit Shah d92551f28e virtio-blk: Fix memleak on exit
Calling virtio_cleanup() will free up memory allocated in
virtio_common_init().

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-27 20:08:19 +03:00
Michael S. Tsirkin 1129714ff4 virtio-pci: use generic logic for command access
In practice, guests don't generate config requests
that cross a word boundary, so the logic to
detect command word access is correct because
PCI_COMMAND is 0x4. But depending on this is
tricky, further, it will break with guests
that do try to generate a misaligned access
as we pass it to devices without splitting.

Better to use the generic range_covers_byte for this.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-27 20:08:15 +03:00
Jan Kiszka 42e4126b79 pci: Common overflow prevention
Introduce pci_config_read/write_common helpers to prevent passing
accesses down the callback chain that go beyond the config space limits.
Adjust length assertions as they are no longer correct (cutting may
generate valid 3 byte accesses).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-27 10:57:22 +03:00
Stefano Stabellini 679f4f8b17 xen: implement unplug protocol in xen_platform
The unplug protocol is necessary to support PV drivers in the guest: the
drivers expect to be able to "unplug" emulated disks and nics before
initializing the Xen PV interfaces.
It is responsibility of the guest to make sure that the unplug is done
before the emulated devices or the PV interface start to be used.

We use pci_for_each_device to walk the PCI bus, identify the devices and
disks that we want to disable and dynamically unplug them.

Changes in v2:

- use PCI_CLASS constants;

- replace pci_unplug_device with qdev_unplug;

- do not import hw/ide/internal.h in xen_platform.c;

Changes in v3:

- introduce piix3-ide-xen, that support hot-unplug;

- move the unplug code to hw/ide/piix.c;

- just call qdev_unplug from xen_platform.c to unplug the IDE disks;

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-26 07:02:17 +02:00
Alexander Graf 59d21e537b xen: make xen_enabled even more clever
When using xen_enabled() we're currently only checking if xen is enabled
at all during the build. But what if you want to build multiple targets
out of which only one can potentially run xen code?

That means that for generic code we'll still have to fall back to the
variable and potentially slow the code down, but it's not as important as
that is mostly xen device emulation which is not touched for non-xen targets.

The target specific code however can with this patch see that it's unable to
ever execute xen code. We can thus always return 0 on xen_enabled(), giving
gcc enough hints to evict the mapcache code from the target memory management
code.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
2011-07-26 06:43:11 +02:00
Anthony PERARD 30ab61252b xen: Fix xen_enabled().
Use the "host" CONFIG_ define instead of the "target" one.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-26 06:43:10 +02:00
Blue Swirl aad04cd024 Fix chrdev return value conversion
6e1db57b2a didn't
convert brlapi or win32 chrdevs, breaking build for those.

Fix by converting the chrdevs.

Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-24 14:48:57 +00:00
Matthew Fernandez 8e31bf388e Correct spelling of licensed
Correct typos of "licenced" to "licensed".

Reviewed-by: Stefan Weil <weil@mail.berlios.de>
Reviewed-by: Andreas F=E4rber <andreas.faerber@web.de>
Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 11:26:12 -05:00
Jan Kiszka 17604dac28 mc146818rtc: Handle host clock resets
Make use of the new clock reset notifier to update the RTC whenever
rtc_clock is the host clock and that happens to jump backward. This
avoids that the RTC stalls for the period the host clock was set back.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 11:26:12 -05:00
Jan Kiszka 9e8dd45164 notifier: Pass data argument to callback
This allows to pass additional information to the notifier callback
which is useful if sender and receiver do not share any other distinct
data structure.

Will be used first for the clock reset notifier.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 11:26:06 -05:00
Markus Armbruster e0e8384dd4 ide: Turn properties any IDE device must have into bus properties
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 11:21:29 -05:00
Markus Armbruster d6cca4b048 virtio-serial: Turn props any virtio-serial-bus device must have into bus props
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 11:20:41 -05:00
Markus Armbruster 021a131860 virtio-serial: Clean up virtser_bus_dev_print() output
Old version looks like this in info qtree (last four lines):

          dev: virtconsole, id ""
            dev-prop: is_console = 1
            dev-prop: nr = 0
            dev-prop: chardev = <null>
            dev-prop: name = <null>
             dev-prop-int: id: 0
             dev-prop-int: guest_connected: 1
             dev-prop-int: host_connected: 0
             dev-prop-int: throttled: 0

Indentation is off, and "dev-prop-int" suggests these are properties
you can configure with -device, which isn't the case.  The other
buses' print_dev() callbacks don't do that.  For instance, PCI's
output looks like this:

        class Ethernet controller, addr 00:03.0, pci id 1af4:1000 (sub 1af4:0001)
        bar 0: i/o at 0xffffffffffffffff [0x1e]
        bar 1: mem at 0xffffffffffffffff [0xffe]
        bar 6: mem at 0xffffffffffffffff [0xfffe]

Change virtser_bus_dev_print() to that style.  Result:

          dev: virtconsole, id ""
            dev-prop: is_console = 1
            dev-prop: nr = 0
            dev-prop: chardev = <null>
            dev-prop: name = <null>
            port 0, guest on, host off, throttle off

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 11:20:02 -05:00
Markus Armbruster 1cc2428cce usb-ccid: Drop unused CCIDCardInfo callback print()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 11:20:02 -05:00
Richard Henderson 0fe28e0d9f vga: Fix type of lfb/map_addr/end.
These addresses have been passed through pci_to_cpu_addr,
and thus need to be full target_phys_addr_t.

Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 11:19:02 -05:00
Kevin Wolf 6e1db57b2a qemu-char: Print strerror message on failure
The only way for chardev drivers to communicate an error was to return a NULL
pointer, which resulted in an error message that said _that_ something went
wrong, but not _why_.

This patch changes the interface to return 0/-errno and updates
qemu_chr_open_opts to use strerror to display a more helpful error message.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 11:18:57 -05:00
Adam Lackorzynski 49e40b6627 multiboot: Support commas in module parameters
Support commas in the parameter list of multiboot modules as well as for the
kernel command line, by using double commas (via get_opt_value()).

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 10:56:55 -05:00
Paolo Bonzini 6141dbfe0a report serial devices created with -device in the PIIX4 config space
Serial and parallel devices created with -device are not reported in
the PIIX4 configuration space, and are hence not picked up by the DSDT.
This upsets Windows, which hides them altogether from the guest.

To avoid this, check at the end of machine initialization whether the
corresponding I/O ports have been registered.  The new function in
ioport.c does this; this also requires a tweak to isa_unassign_ioport.

I left the comment in piix4_pm_initfn since the registers I moved do
seem to match the 82371AB datasheet.  There are some quirks though.
We are setting this bit:

    "Device 8 EIO Enable (EIO_EN_DEV8)—R/W. 1=Enable PCI access to the
    device 8 enabled I/O ranges to be claimed by PIIX4 and forwarded
    to the ISA/EIO bus. 0=Disable. The LPT_MON_EN must be set to enable
    the decode."

but not LPT_MON_EN (bit 18 at 50h):

    LPT Port Enable (LPT_MON_EN)—R/W. 1=Enable accesses to parallel
    port address range (LPT_DEC_SEL) to generate a device 8 (parallel
    port) decode event. 0=Disable.

We're also setting the LPT_DEC_SEL field (that's the 0x60 written to
63h) to 11, which means reserved, rather than to 01 (378h-37Fh).

Likewise we're not setting SA_MON_EN, SB_MON_EN (respectively bit 14
and bit 16 at address 50h) for the serial ports.  However, we're setting
COMA_DEC_SEL and COMB_DEC_SEL correctly, unlike the corresponding register
for the parallel port.

All these fields are left as they are, since they are probably only
meant to be used in the DSDT.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 10:56:55 -05:00
Jan Kiszka 6eed18568d net: Consistently use qemu_macaddr_default_if_unset
Drop the open-coded MAC assignment from net_init_nic and replace it with
standard qemu_macaddr_default_if_unset which is also used by qdev. That
avoid creating colliding MACs when instantiating NICs via different
mechanisms.

This change requires to store the MAC as MACAddr in NICInfo, and the
remaining nd_table users need to be updated.

Based on suggestion by Peter Maydell.

CC: Markus Armbruster <armbru@redhat.com>
CC: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-23 10:19:50 -05:00
Anthony Liguori e07fc405dc Merge remote-tracking branch 'spice/spice.v39' into staging 2011-07-22 09:24:07 -05:00
Anthony Liguori cfe7bb19d2 Merge remote-tracking branch 'kraxel/usb.21' into staging 2011-07-22 09:23:49 -05:00
Anthony Liguori bf1cd9b4f5 Merge remote-tracking branch 'kwolf/for-anthony' into staging 2011-07-22 09:23:43 -05:00
Gerd Hoffmann 0070f095d9 usb-uhci: fix irq handling on error.
Spec on UHCI_STS_USBERR: "If the TD on which the error interrupt
occurred also had its IOC bit set, both this bit and Bit 0 are set."

Make UHCI emulation do that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-22 13:36:31 +02:00
Gerd Hoffmann e7e73892a6 usb-hid: fixup changed tracking.
Remove leftover calls to usb_hid_changed().

Take care to update the changed flag after delivering a event via
GET_REPORT like we do when sending events via interrupt endpoint.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-22 13:36:31 +02:00
Hervé Poussineau cd3e2409a3 ds1225y: convert to qdev device, and use it in MIPS Jazz emulation
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-20 20:54:51 +00:00
Hervé Poussineau d43ed9ec25 ds1225y: use trace framework
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-20 20:54:50 +00:00
Hervé Poussineau 86f25c7c37 ds1225y: Remove protection stuff, which doesn't belong to this device
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-20 20:54:49 +00:00
Gerd Hoffmann 98e51ec92e usb-serial doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann 4ab0ba9e26 usb-net doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann 2474e5052b usb-bt doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann ccce9fd205 usb-wacom doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann f54b656303 usb storage: first migration support bits.
Tag vmstate as unmigratable for the time being,
to be removed when mgration support is finished.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann 9490fb0624 ehci doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Gerd Hoffmann b7ce1b27f6 ahci doesn't support migration
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 14:49:41 +02:00
Yonit Halperin 8927cfbba2 qxl: upon reset, if spice worker is stopped, the command rings can be not empty
Spice worker does no longer process commands when it is stopped.
Otherwise, it might crash during migration when attempting to process
commands while the guest is not completely loaded.

Cc: Alon Levy <alevy@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 10:08:53 +02:00
Gerd Hoffmann 2837c8ea1f vmstate: add no_migrate flag to VMStateDescription
This allows to easily tag devices as non-migratable,
so any attempt to migrate a virtual machine with the
device in question active will make migration fail.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20 09:23:33 +02:00
Hannes Reinecke 3e1c0c9a4b scsi-disk: Mask out serial number EVPD
If the serial number is not set we should mask it out in the
list of supported VPD pages and mark it as not supported.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-19 15:39:05 +02:00
Hannes Reinecke 653c1c3fb6 scsi-disk: Fixup debugging statement
A debugging statement wasn't converted to the new interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-19 15:39:05 +02:00
Hannes Reinecke c5bf71a9a3 scsi: Add 'hba_private' to SCSIRequest
'tag' is just an abstraction to identify the command
from the driver. So we should make that explicit by
replacing 'tag' with a driver-defined pointer 'hba_private'.
This saves the lookup for driver handling several commands
in parallel.
'tag' is still being kept for tracing purposes.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-19 15:38:58 +02:00
Anthony Liguori 03ff09580e Merge remote-tracking branch 'agraf/xen-next' into staging 2011-07-19 08:04:35 -05:00
Anthony Liguori b4dabf9587 Merge remote-tracking branch 'kraxel/usb.19' into staging 2011-07-19 08:03:20 -05:00
Anthony Liguori de20fbcac9 Merge remote-tracking branch 'spice/spice.v38' into staging 2011-07-19 08:02:35 -05:00
Anthony Liguori 6734529435 Merge remote-tracking branch 'mst/for_anthony' into staging 2011-07-19 07:43:54 -05:00
Hannes Reinecke 348e7b8dcd iov: Update parameter usage in iov_(to|from)_buf()
iov_to_buf() has an 'offset' parameter, iov_from_buf() hasn't.
This patch adds the missing parameter to iov_from_buf().
It also renames the 'offset' parameter to 'iov_off' to
emphasize it's the offset into the iovec and not the buffer.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-18 16:06:27 +02:00
Amit Shah 0219d73283 virtio-console: Prevent abort()s in case of host chardev close
A host chardev could close just before the guest sends some data to be
written.  This will cause an -EPIPE error.  This shouldn't be propagated
to virtio-serial-bus.

Ideally we should close the port once -EPIPE is received, but since the
chardev interface doesn't return such meaningful values to its users,
all we get is -1 for any kind of error.  Just return 0 for now and wait
for chardevs to return better error messages to act better on the return
messages.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-07-18 15:30:15 +05:30
Amit Shah 95c9cde2df virtio-serial-bus: Fix trailing \n in error_report string
Markus fixed offenders in the file but one instance sneaked in via
another patch.  Fix it.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-07-18 15:30:15 +05:30
Amit Shah d02e4fa4a8 virtio-console: Add some trace events
Add some trace events for messages passed between the char layer and the
virtio-serial bus.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-07-18 15:30:14 +05:30
Amit Shah 49e3fdd7f2 virtio-serial-bus: Add trace events
Add some trace events for messages passed between the guest and host.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-07-18 15:30:14 +05:30
Michael S. Tsirkin c8eac1cfa1 virtio: fix indirect descriptor buffer overflow
We were previously allowing arbitrarily-long indirect descriptors, which
could lead to a buffer overflow in qemu-kvm process.

CVE-2011-2212

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:34 +03:00
Michael S. Tsirkin 0d2b962d16 xen: move to new pci initializers
move ids to pci info structure

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:34 +03:00
Anthony PERARD ce4fd422a6 hw/piix_pci.c: Fix PIIX3-xen to initialize ids
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:34 +03:00
Michael S. Tsirkin 33d5ad53c1 pci_ids: tweak names to match linux/pci_ids.h
Sync xen names to ones used by linux. Add
xen platform device id as well.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:34 +03:00
Michael S. Tsirkin c1be973ae1 vhost: fix double free on device stop
vhost dev stop failed to clear the log field.
Typically not an issue as dev start overwrites this field,
but if logging gets disabled before the following start,
it doesn't so this causes a double free.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-17 18:47:33 +03:00
Alexander Graf 25a118130f xen_console: fall back to qemu serial device
The new xen_console protocol changed the default xen_console output device
from whatever Qemu chose to whatever xenstore choses and "pty" as fallback.

This is not how Qemu works. It has its own serial redirection semantics. So
it xenstore doesn't contain information on what to do, Qemu is the place to
ask.

Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 0f51726adc xen_console: support the new extended xenstore protocol
Since CS 21994 on xen-unstable.hg and CS
466608f3a32e1f9808acdf832a5843af37e5fcec on qemu-xen-unstable.git, few
changes have been introduced to the PV console xenstore protocol, as
described by the document docs/misc/console.txt under xen-unstable.hg.

From the Qemu point of view, very few modifications are needed to
correctly support the protocol: read from xenstore the "output" node
that tell us what the output of the PV console is going to be.
In case the output is a tty, write to xenstore the device name.

Changes in v2:

- fix error paths: free malloc'ed strings and close the xenstore
connection before returning;

- remove useless snprintf in xenstore_store_pv_console_info if i == 0.

Changes in v3:

- replace xs_daemon_open/xs_daemon_close with xs_open/xs_close.

Changes in v4:

- add a compatibility implementation of xs_open/xs_close.

Changes in v5:

- fix code style.

[agraf] fix build error due to missing stub

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 7cef3f4fdb xen_disk: treat "aio" as "raw"
Sometimes the toolstack uses "aio" without an additional format
identifier, in such cases use "raw".

Updated in v2:

- fix code style.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 5ea3c2b405 xen_disk: cope with missing xenstore "params" node
When disk is a cdrom and the drive is empty the "params" node in
xenstore might be missing completely: cope with it instead of
segfaulting.

Updated in v2:

- actually removed the strchr(blkdev->params, ':') that caused the
segfault;

- free all the allocated strings from xenstore before returning;

Updated in v3:

- set blkdev fields to NULL after free'ing them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 37cdfcf194 xen: add vkbd support for PV on HVM guests
Register the vkbd backend even when running as device emulator for HVM
guests: it is useful because it doesn't need a frequent timer like usb.

Check whether the XenInput DisplayState has been set in the initialise
state, rather than the input state.
In case the DisplayState hasn't been set and there is no vfb for this
domain, then set the XenInput DisplayState to the default one.

Changed in v2:

- use qemu_free instead of free;

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Stefano Stabellini 5e6b701aba xen_console: fix memory leak
con_init leaks the string "type", fix it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:25 +02:00
Jan Kiszka 868bb33faa xen: Fold CONFIG_XEN_MAPCACHE into CONFIG_XEN
Xen won't be enabled if there is no backend support available for the
host. And that also means the map cache will work. So drop the separate
config switch and move the required stubs over to xen-stub.c.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17 01:54:24 +02:00
Hervé Poussineau 429bef6912 esp: cancel current request only if some request is in flight
This bug was introduced in 94d3f98a3f3caddd7875f9a11776daeb84962a7b:
scsi_cancel_io was checking if some request was pending before trying
to cancel it, while scsi_req_cancel always cancels the request.

This may lead to a crash of Qemu due to dereferencing a NULL pointer,
as exhibited by NetBSD 5.1 installer on MIPS Magnum emulation.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 21:29:39 +00:00
Alexander Graf 06c46bbab0 spapr: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:33 +00:00
Alexander Graf 04bc74edec s390-virtio: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:32 +00:00
Alexander Graf db663d0f7a ppc405_uc: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:31 +00:00
Alexander Graf 75b0646f9e pl080: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:30 +00:00
Alexander Graf ae5d3eb474 msix: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:29 +00:00
Alexander Graf c5d29d2fec msi: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:28 +00:00
Alexander Graf 6c7796e5c1 intel-hda: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:27 +00:00
Alexander Graf 8517263fcb hpet: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12 20:00:26 +00:00
Gerd Hoffmann 3dc345d587 usb-ohci: raise interrupt on attach
Got lost in commit 618c169b57,
add it back in.  Also fix codestyle while we are at it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-08 11:26:10 +02:00
Gerd Hoffmann 6c2385270b usb-hub: remove unused descriptor arrays
Somehow they where left over when converting the hub
to the new usb descriptor infrastructure ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-08 11:26:10 +02:00
Gerd Hoffmann dd850cf203 usb: fixup bluetooth descriptors
Commit 4696425cd0 changes some
endpoints from isocrounous to interrupt by mistake.  Fix it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-08 11:26:10 +02:00
Jes Sorensen eb3b58f96f usb_register_port(): do not set port->opaque and port->index twice
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-08 11:26:10 +02:00