sim-card
/
qemu
Archived
10
0
Fork 0
Commit Graph

3393 Commits

Author SHA1 Message Date
Amit Shah a1829205a5 virtio-serial: Use MSI vectors for port virtqueues
This commit enables the use of MSI interrupts for virtqueue
notifications for ports. We use nr_ports + 1 (for control channel) msi
entries for the ports, as only the in_vq operations need an interrupt on
the guest.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20 08:25:23 -06:00
Amit Shah b60c470b8d virtio-serial: Add a 'virtserialport' device for generic serial port support
This commit adds a simple chardev-based serial port. Any data the guest
sends is forwarded to the chardev and vice-versa.

Sample uses for such a device can be obtaining info from the guest like
the file systems used, apps installed, etc. for offline usage and
logged-in users, clipboard copy-paste, etc. for online usage.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20 08:25:23 -06:00
Amit Shah f146ec9a6d virtio-serial-bus: Add ability to hot-unplug ports
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20 08:25:23 -06:00
Amit Shah 160600fd13 virtio-serial-bus: Add a port 'name' property for port discovery in guests
The port 'id' or number is internal state between the guest kernel and
our bus implementation. This is invocation-dependent and isn't part of
the guest-host ABI.

To correcly enumerate and map ports between the host and the guest, the
'name' property is used.

Example:

    -device virtserialport,name=org.qemu.port.0

This invocation will get us a char device in the guest at:

    /dev/virtio-ports/org.qemu.port.0

which can be a symlink to

    /dev/vport0p3

This 'name' property is exposed by the guest kernel in a sysfs
attribute:

    /sys/kernel/virtio-ports/vport0p3/name

A simple udev script can pick up this name and create the symlink
mentioned above.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20 08:25:23 -06:00
Amit Shah 6663a1956e virtio-serial-bus: Maintain guest and host port open/close state
Via control channel messages, the guest can tell us whether a port got
opened or closed. Similarly, we can also indicate to the guest of host
port open/close events.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20 08:25:23 -06:00
Amit Shah 98b19252cf virtio-console: qdev conversion, new virtio-serial-bus
This commit converts the virtio-console device to create a new
virtio-serial bus that can host console and generic serial ports. The
file hosting this code is now called virtio-serial-bus.c.

The virtio console is now a very simple qdev device that sits on the
virtio-serial-bus and communicates between the bus and qemu's chardevs.

This commit also includes a few changes to the virtio backing code for
pci and s390 to spawn the virtio-serial bus.

As a result of the qdev conversion, we get rid of a lot of legacy code.
The old-style way of instantiating a virtio console using

    -virtioconsole ...

is maintained, but the new, preferred way is to use

    -device virtio-serial -device virtconsole,chardev=...

With this commit, multiple devices as well as multiple ports with a
single device can be supported.

For multiple ports support, each port gets an IO vq pair. Since the
guest needs to know in advance how many vqs a particular device will
need, we have to set this number as a property of the virtio-serial
device and also as a config option.

In addition, we also spawn a pair of control IO vqs. This is an internal
channel meant for guest-host communication for things like port
open/close, sending port properties over to the guest, etc.

This commit is a part of a series of other commits to get the full
implementation of multiport support. Future commits will add other
support as well as ride on the savevm version that we bump up here.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20 08:25:23 -06:00
Amit Shah bb61564c77 virtio: Remove duplicate macro definition for max. virtqueues, bump up the max
VIRTIO_PCI_QUEUE_MAX is redefined in hw/virtio.c. Let's just keep it in
hw/virtio.h.

Also, bump up the value of the maximum allowed virtqueues to 64. This is
in preparation to allow multiple ports per virtio-console device.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20 08:25:23 -06:00
Naphtali Sprei f5edb014ed Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.
Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,
pass the request in the flags parameter to the function.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20 08:25:22 -06:00
Gerd Hoffmann 374ef70452 pc: add driver version compat properties
This patch adds compat property entries for ide-disk.ver and
scsi-disk.ver to pc-0.10 and pc-0.11.  With this patch applied
the scsi and ide disks report "0.10" and "0.11" as version when
you start qemu with "-M pc-0.10" or "-M pc-0.11".

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19 16:31:04 -06:00
Gerd Hoffmann 383b4d9b79 scsi: device version property
This patch adds a new property named 'ver' to scsi-disk which allows to
specify the version which the virtual disk/cdrom should report to the
guest.  By default this is the qemu version (i.e. 0.12).  usage:

  -drive if=none,id=disk,file=...
  -device lsi
  -device scsi-disk,drive=disk,bus=scsi.0,unit=0,ver=42

You can also switch the version for all scsi drives using:

  -global scsi-disk.ver=42

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19 16:31:04 -06:00
Gerd Hoffmann 47c0634030 ide: device version property
This patch adds a new property named 'ver' to ide-drive which allows to
specify the version which the virtual disk/cdrom should report to the
guest.  By default this is the qemu version (i.e. 0.12).  usage:

  -drive if=none,id=disk,file=...
  -device ide-drive,bus=ide.0,unit=0,drive=disk,ver=42

You can also switch the version for all ide drives using:

  -global ide-drive.ver=42

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19 16:31:04 -06:00
Kevin Wolf beb6f0de7a Fix QEMU_WARN_UNUSED_RESULT
Since commit 747bbdf7 QEMU_WARN_UNUSED_RESULT is never defined as it is
conditional on a define from config-host.h which is included only later.
Include that file earlier to get the warnings back.

Reactivating it unfortunately leads to some warnings about unused qdev_init
results. These calls are changed to qdev_init_nofail to avoid build failures.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19 16:31:04 -06:00
Igor V. Kovalenko 4ef1a3d3b3 rtl8139: fix clang reporting unused assignment of VLAN tagging data
Currently we do not implement VLAN tagging for rtl8139(C+),
still data is read from ring buffer headers.

- augment unused assignment with TODO item
- cast txdw1 to void for now

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19 16:31:02 -06:00
Stefan Weil 7b8737de03 eepro100: Fix multicast support
* Handling of multicast list was missing.
* Multicast all was missing.
* Promiscuous mode for multicast frames was wrong.

This patch is a step to synchronize my maintainer version
of eepro100.c (git://repo.or.cz/qemu/ar7.git) with the
version integrated in QEMU.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-01-19 16:31:02 -06:00
Stefan Weil f3a52e503b eepro100: Restructure code (new function tx_command)
Handling of transmit commands is rather complex,
so about 80 lines of code were moved from function
action_command to the new function tx_command.

The two new values "tx" and "cb_address" in the
eepro100 status structure made this possible without
passing too many parameters.

In addition, the moved code was cleaned a little bit:
old comments marked with //~ were removed, C++ style
comments were replaced by C style comments, C++ like
variable declarations after code were reordered.

Simplified mode is still broken. Nor did I fix
endianess issues. Both problems will be fixed in
additional patches (which need this one).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-01-19 16:31:01 -06:00
Blue Swirl 787cfbc432 Sparc32: improve DMA controller IRQ debugging
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-16 09:06:35 +00:00
Blue Swirl dca47eddba ESP: improve IRQ debugging
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-16 09:06:34 +00:00
Artyom Tarasenko 10760f0fa7 sparc32 do not clear interrupts when masking
Don't clear interrupts on disabling, because
* Sun4M_SystemArchitecture_edited2.pdf doesn't describe
  that masking or un-masking IRQ shall clear pending ones.

* Field tests also show that SPARCstation-20 doesn't
  clear them.

* The patch makes Solaris 2.5.1/2.6 boot ~1500 times
  faster (~20 seconds instead of ~8 hours)

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-16 09:06:32 +00:00
Edgar E. Iglesias fccd2613d6 nand: Correct random data reads.
Random reading depends on having the last row/page latched and not beeing
clobbered between read and any following random reads.

Also, s->iolen must be updated when loading the io/data register with
randomly accessed flash data.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-01-15 00:06:16 +01:00
Shin-ichiro KAWASAKI 0a4e7cd237 sh: sm501: Add hardware cursor feature
This patch adds hardware cursor feature to SM501 graphics chip emulation,
to make the graphic console more useful for QEMU SH4 users.

Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-01-14 16:15:50 +01:00
Christoph Hellwig 4277906d28 virtio-blk: remove dead variable in virtio_blk_handle_scsi
As pointed out by clang size is only ever written to, but never actually
used.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-13 17:14:15 -06:00
Amit Shah c4af120f5f hw/vga.c: remove dead assignment
clang-analyzer points out a redundant assignment.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-13 17:14:15 -06:00
Amit Shah 22c253d9d6 virtio: net: remove dead assignment
clang-analyzer points out value assigned to 'len' is not used.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-13 17:14:15 -06:00
Blue Swirl 884a0c7677 pcnet: remove dead nested assignment, spotted by clang
Although the value stored to 'addr' is used in the enclosing expression,
the value is never actually read from 'addr'.

Probably a typo.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-13 18:59:54 +00:00
Blue Swirl f7e683b8c3 Sparc32: remove dead increment, spotted by clang
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-13 18:58:51 +00:00
Blue Swirl f368a3cea4 Sparc32: remove a variable used only for debugging to avoid a clang warning
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-13 18:55:11 +00:00
Blue Swirl 8983536388 Sparc32: remove unused env/envs variables, spotted by clang
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-13 18:52:50 +00:00
Stefan Weil cb95c2e44e pci: Add missing 'const' in argument to pci_get_xxx
pci_get_byte, pci_get_word, pci_get_long and pci_get_quad
all take a const uint8_t pointer, because they only read
the configuration data.

Their prototypes should reflect this fact.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-01-13 14:50:34 +02:00
Stefan Weil 938a632402 eepro100: Update ROM file support
Use new way to associate ROM files to devices.

Currently, there is only a ROM file for i82559er
included in QEMU, so the patch does not add
.romfile for the other devices.

When flexible mode is fixed in eepro100, adding
more ROM files will be possible. It should be
possible to create them from pxe-i82559er.bin,
because etherboot uses the same driver for all
eepro100 devices (only PCI ids differ).

Maybe it is even possible to create a single
pxe-i8255x.bin which supports all eepro100 devices
(not supported with current etherboot).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-01-13 14:50:18 +02:00
Stefan Weil 61702408c7 eepro100: Fix initial value for PCI_STATUS
The numerical value was wrong (0x2800 instead of 0x0280)
which indeed did not make sense.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-01-13 14:28:31 +02:00
Michael S. Tsirkin c9f79a3f79 virtio-net: mac property is mandatory
Mac feature bit isn't going to work as all network cards already have a
'mac' property to set the mac address.  Remove it from mask and add in
get_features.

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-12 14:32:19 -06:00
Blue Swirl 3eb26cc216 Sparc64: Fix PCI config accessor order
Fix by Igor Kovalenko.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-12 20:04:53 +00:00
Michael S. Tsirkin dbd483242c qdev: fix thinko leading to guest crashes
Without this fix, guest crashes with drive=virtio.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-12 13:24:52 -06:00
malc 514d97dea6 dma/sb16: make clang analyzer not complain
Signed-off-by: malc <av1474@comtv.ru>
2010-01-12 21:55:53 +03:00
Blue Swirl 5a5d4a7651 Sparc64: enable real access to PCI configuration space
Leave the bogus access method used by OpenBIOS in place for now.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-11 21:20:53 +00:00
Gerd Hoffmann 20a86364c9 pc: add rombar to compat properties for pc-0.10 and pc-0.11
So '-M pc-0.10' and '-M pc-0.11' will use the fw_cfg rom load method
by default.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:41:00 -06:00
Gerd Hoffmann 88169ddf82 pci: allow loading roms via fw_cfg.
This patch adds a pci bus property 'rombar' which specifies whenever
the pci rom should be loaded via pci rom bar (default) or via fw_cfg.
The later can be used for compatibility with older qemu versions where
no pci rom bar is present.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:41:00 -06:00
Gerd Hoffmann 8832cb805d roms: rework rom loading via fw
This patch changes the way rom loading via fw_cfg is handled.
Instead of having pc_init1() call a function which passed all
roms to the firmware config we simply pass a pointer to fw_cfg
to the rom loader.

Advantage: loading roms via firmware works also for devices which
are initialized after pc_init1(), i.e. everyting added via -device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:41:00 -06:00
Gerd Hoffmann de9352bcae fw_cfg: rom loader tweaks.
Changes:
 - make dir argument mandatory, we allways have one anyway
   (vgaroms or genroms).
 - check for duplicates, skip loading if found.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:41:00 -06:00
Gerd Hoffmann bdb5ee3064 roms: minor fixes and cleanups.
Changes:
  - Drop extra file argument from rom_add_file().
  - Drop fw_dir check in do_info_roms, we allways have a dir name.
  - code style fixes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:41:00 -06:00
Gerd Hoffmann 2cae6f5e34 pc: add machine type for 0.12
Add a new machine type for qemu 0.12.

Also fixup the 0.11 machine type: msi for virtio-blk-pci was enabled
after the 0.11 release, so turn it off in the 0.11 machine type.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:41:00 -06:00
Michael S. Tsirkin 49e75cf388 virtio-pci: thinko fix
Since patch ed757e140c0ada220f213036e4497315d24ca8bct, virtio will
sometimes clear all status registers on bus master disable, which loses
information such as VIRTIO_CONFIG_S_FAILED bit.  This is a result of
a patch being misapplied: code uses !  instead of ~ for bit
operations as in Yan's original patch.  This obviously does not make
sense.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:41:00 -06:00
Michael S. Tsirkin 8172539d21 virtio: add features as qdev properties
Add feature bits as properties to virtio. This makes it possible to e.g. define
machine without indirect buffer support, which is required for 0.10
compatibility, or without hardware checksum support, which is required for 0.11
compatibility.  Since default values for optional features are now set by qdev,
get_features callback has been modified: it sets non-optional bits, and clears
bits not supported by host.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:40:59 -06:00
Michael S. Tsirkin 704a76fcd2 virtio: rename features -> guest_features
Rename features->guest_features. This is
what they are, avoid confusion with
host features which we also need to keep around.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:40:59 -06:00
Michael S. Tsirkin d2364ee424 qdev: add bit property type
This adds "bit" property type, which is a boolean stored in a 32 bit
integer field, with legal values on and off.  Will be used by virtio for
feature bits.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 13:40:59 -06:00
Gerd Hoffmann aa4d32c474 lsi: pass lsi_request to lsi_reselect
All callers of lsi_reselect have a lsi_request struct at hand anyway.
So just pass it directly instead of having lsi_reselect search for it
using the tag.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 09:56:30 -06:00
Gerd Hoffmann b96a0da06b lsi: move dma_len+dma_buf into lsi_request
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 09:56:30 -06:00
Gerd Hoffmann daa70311e0 lsi: move current_dev into lsi_request
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 09:56:30 -06:00
Gerd Hoffmann af12ac9880 lsi: have lsi_request for the whole life time of the request.
Right now lsi_request is allocated when a request is queued and released
when a request is unqueued.  With this patch applied the lsi_request is
kept for the whole lifetime of the scsi request.

Rationale: We can use it for per-request data then.  The patch does that
already for the request tag.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 09:56:30 -06:00
Gerd Hoffmann 042ec49dc5 lsi: use QTAILQ for lsi_queue
Replace the funky array logic for queued commands with standard
qemu list functions.  Also rename lsi_queue to lsi_request.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 09:56:30 -06:00
Roland Dreier f2d928d44e vmware_vga: Check cursor dimensions passed from guest to avoid buffer overflow
Check that the cursor dimensions passed from the guest for the
DEFINE_CURSOR command don't overflow the available space in the
cursor.image[] or cursor.mask[] arrays before copying data from the
guest into those arrays.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11 09:56:30 -06:00
Blue Swirl 0b987f1934 PCI: Fix a typo
Fixes build with PCI_DEBUG defined.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-10 20:54:38 +00:00
Blue Swirl bae7b517a2 Sparc64: increase APB register range
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-10 18:25:48 +00:00
Blue Swirl 9c9b0512c7 Sparc64: use firmware configuration device for command line storage
Avoid a ROM conflict.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-09 21:27:04 +00:00
Igor V. Kovalenko d532b26c9d sparc64: interrupt trap handling
cpu_check_irqs
- handle SOFTINT register TICK and STICK timer bits
- only check interrupt levels greater than PIL value
- handle preemption by higher level traps

cpu_exec
- handle CPU_INTERRUPT_HARD only if interrupts are enabled
- PIL 15 is not special level on sparcv9

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-08 17:25:13 +00:00
Igor V. Kovalenko 709f2c1b23 sparc64: add macros to deal with softint and timer interrupt
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-08 17:15:45 +00:00
Adam Lackorzynski 52001445c9 multiboot: Separate multiboot loading into separate file
Move multiboot loading code into separate files as suggested by Alex Graf.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-08 09:58:41 -06:00
Adam Lackorzynski ee0216275b multiboot: Support arbitrary number of modules.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-08 09:58:41 -06:00
H. Peter Anvin c9f398e53f debugcon: support for debugging consoles (e.g. Bochs port 0xe9)
Add generic support for debugging consoles (simple I/O ports which
when written to cause debugging output to be written to a target.)
The current implementation matches Bochs' port 0xe9, allowing the same
debugging code to be used for both Bochs and Qemu.

There is no vm state associated with the debugging port, simply
because it has none -- the entire interface is a single, stateless,
write-only port.

Most of the code was cribbed from the serial port driver.

v2: removed non-ISA variants (they can be introduced when/if someone
wants them, using code from the serial port); added configurable
readback (Bochs returns 0xe9 on a read from this register, mimic that
by default)  This retains the apparently somewhat controversial user
friendly option, however.

v3: reimplemented the user friendly option as a synthetic option
("-debugcon foo" basically ends up being a parser-level shorthand for
"-chardev stdio,id=debugcon -device isa-debugcon,chardev=debugcon") --
this dramatically reduced the complexity while keeping the same level
of user friendliness.

v4: spaces, not tabs.

v5: update to match current top of tree.  Calling qemu_chr_open()
already during parsing no longer works; defer until we are parsing the
other console-like devices.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-08 09:58:40 -06:00
Anthony Liguori ea3fdd5d8c Merge remote branch 'mst/for_anthony' into staging 2010-01-06 07:16:59 -06:00
Aurelien Jarno 3e372cf87f loader: don't call realloc(non_null, 0) when no symbols are present
According to C99, realloc(non_null, 0) != free(non_null), that's why
it is forbidden in QEMU.

When there are no symbols, nsyms equals to 0. Free the syms structure
and set it to NULL instead of reallocating it with a size of 0.

This fixes -kernel with stripped kernels.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
2010-01-03 03:14:37 +01:00
Blue Swirl b430a22562 Sparc64: split DPRINTF into CPUIRQ and EBUS versions
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-30 12:27:17 +00:00
Blue Swirl 302698e882 Sparc64: fix compile with DEBUG_IRQ enabled
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-30 12:26:01 +00:00
Blue Swirl f6b6f1bc80 Sparc64: move APB PCI memory base to correct location
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-27 20:52:39 +00:00
Blue Swirl cf61680217 PCI: Fix bus address conversion
Pass physical addresses to map functions instead of PCI bus addresses.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-27 20:52:36 +00:00
Blue Swirl 6bb4ca57a1 sparc: make command line available also via firmware configuration device
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-27 18:25:49 +00:00
Kirill A. Shutemov 5a41ecc5f2 hw/pc.c: fix warnings with _FORTIFY_SOURCE
CC    i386-softmmu/pc.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c: In function 'load_multiboot':
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c:614: error: ignoring return value of 'fread', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c: In function 'load_linux':
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c:888: error: ignoring return value of 'fread', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c:889: error: ignoring return value of 'fread', declared with attribute warn_unused_result
make[1]: *** [pc.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-25 18:19:17 +00:00
Blue Swirl c71b5b4a9c PCI: partially revert 2e01c8cf4b
Bus address conversion was not correct.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-25 18:18:29 +00:00
Blue Swirl 2e01c8cf4b PCI: make pci_mem_base private
Make pci_mem_base private to PCIBus. Add a function to set it.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-25 16:50:36 +00:00
Blue Swirl 2fe0ee97f9 Fix Sparse error: dubious one-bit signed bitfield
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-25 16:12:26 +00:00
Blue Swirl f6dc18df5c Fix Sparse warning: dubious: !x & y
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-25 16:12:17 +00:00
Blue Swirl 545557d4ab scsi: fix Sparse warning: Initializer entry defined twice
Both REWIND and REZERO_UNIT use 0x01, READ_POSITION and PRE_FETCH
share 0x34.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-25 16:11:40 +00:00
Aurelien Jarno ad674e53b5 MAC DBDMA: store register values in native endianness
Store the register values in native endianness, by dropping all the
endianness conversion functions, and converting the endianness in
dbdma_readl/dbdma_writel instead.

Also guard the endianness conversion with TARGET_WORDS_BIGENDIAN to
simulate the backward connection of the bus.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-24 19:40:29 +01:00
Aurelien Jarno f21a59c224 loader: more ignores for rom intended to be loaded by the bios
Similarly to what has been done in e405a2ba91,
ignore rom intended to be loaded by the bios in find_rom() and rom_copy().

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-24 19:30:25 +01:00
Avi Kivity e405a2ba91 Don't load options roms intended to be loaded by the bios in qemu
The first such option rom will load at address 0, which isn't very nice,
and the second will report a conflict and abort, which is horrible.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-24 08:33:03 +01:00
Michael S. Tsirkin 2758aa520d e1000: add link to data sheet
Link to data sheet at intel.com so people can find it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-23 15:40:42 +00:00
Isaku Yamahata 56594fe3dc piix_pci: add link to i440fx data sheet.
add link to i440fx data sheet.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:01 +02:00
Isaku Yamahata 4da5fcd391 piix_pci: use range helper function
use range helper function in i440fx_write_config().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:01 +02:00
Isaku Yamahata f2c688bb42 piix_pci: define symbolic value for PAM0, PAM6 and SMRAM.
Define symbolic value in i440fx configuration space
for 0x59, 0x5f and 0x7f and use them.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:00 +02:00
Isaku Yamahata 98a3cb024b msix: use range helper function.
use range helper function in msix_write_config().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:00 +02:00
Isaku Yamahata a40e3411d1 acpi: use range helper function.
use range helper function in pm_write_config().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:00 +02:00
Isaku Yamahata e0fe020441 gt64xxx: remove gt64120_{read, write}_config().
They call only pci_default_{read, write}_config().
So they aren't necessary.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:00 +02:00
Isaku Yamahata fb58a897fd pci: use pci_regs.h
include pci_regs.h and remove duplicated defines.
And remove unused PCI_REVISION and PCI_SUBDEVICE_ID.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:00 +02:00
Isaku Yamahata cb67beb136 pci: import Linux pci_regs.h
Import Linux pci_regs.h. Later PCI register definitions in pci.h
will be eliminated.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:00 +02:00
Isaku Yamahata 3d09c490e5 pci: s/PCI_SUBVENDOR_ID/PCI_SUBSYSTEM_VENDOR_ID/g
To match Linux PCI register definition,
rename PCI_SUBVENDOR_ID to PCI_SUBSYSTEM_VENDOR_ID.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:00 +02:00
Isaku Yamahata b8ba4176aa pci: remove PCIBus::config_reg.
PCIBus::config_reg isn't used anymore, so remove it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin b81ebc6990 pci: remove unused macro
PCI_STATUS_DEVSEL is unused, and it also
has a different name in pci_regs.h
Remove.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin d74dbb9476 usb-ohci: symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin db579e9e73 usb-uhci: symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin 4468fb6343 ac97: symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin fcce95e2ee wdt_i6300esb: symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin d3e2f1353e es1370: symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin 5d89715b00 pci: add another devsel macro
will be used by ensoniq emulation

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin 5845f0e5e8 lsi: symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin 3fa0f9552b vmware_vga: symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin 409570a735 cmd646: symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin 1e68f8c4a6 piix: symbolic constants
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin 508cc6b466 eepro100: symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change in meaningful ways.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin d577679e57 pci: add more status bits
will be used by eepro100.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin 97526229da pcnet: switch to symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin 0b5b3547cd rtl: switch to symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin e6c4cfd503 ne2000: switch to symbolic names for pci registers
No functional changes. I verified that the generated binary
does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:35:00 +02:00
Michael S. Tsirkin a9cbacb0d6 e1000: switch to symbolic names for pci registers
No functional changes. I verified that the generated
object binary does not change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Glauber Costa <glommer@gmail.com>
2009-12-23 16:34:59 +02:00
Michael S. Tsirkin a7b15a5cc6 Revert "Revert "pci: interrupt disable bit support""
This reverts commit d587e07871.
2009-12-23 16:33:56 +02:00
Paul Brook 21a8894168 ARM PBX-A9 memory map tweaks
Add core tile memeory to the RealView PBX-A9 board.  Document the
memeory maps that are known to work with the qemu bootloader.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-12-21 20:19:12 +00:00
Paul Brook 209bf9658a LAN9118 improvements
Implement LAN9118 general purpose timer and PHY interrupts. Fix global
interrupt status bit.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-12-21 15:06:59 +00:00
Alexander Graf 73b01960b4 PPC: Make DCR uint32_t
For what I know DCR is always 32 bits wide, so we should also use uint32_t to
pass it along the stacks.

This fixes a warning when compiling qemu-system-ppc64 with KVM enabled, making
it compile without --disable-werror

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-21 16:03:03 +01:00
Aurelien Jarno b711de9565 PPC64: Fix alternate timebase
Fix the alternate time base the same way as the default timebase. SPR_ATBL
should return a 64-bit value on 64 bit implementations.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-21 13:52:08 +01:00
Alexander Graf e3ea652962 PPC64: Fix timebase
On PPC we have a 64-bit time base. Usually (PPC32) this is accessed using
two separate 32 bit SPR accesses to SPR_TBU and SPR_TBL.

On PPC64 the SPR_TBL register acts as 64 bit though, so we get the full
64 bits as return value. If we only take the lower ones, fine. But Linux
wants to see all 64 bits or it breaks.

This patch makes PPC64 Linux work even after TB crossed the 32-bit boundary,
which usually happened a few seconds after bootup.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-21 13:42:37 +01:00
Andreas Färber 46214a2785 ppc64: Change default machine to mac99
Also change the New World default CPU to 970FX for ppc64,
since the G4 is a 32-bit CPU.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-21 10:04:30 +01:00
Kevin Wolf 935effc2bb Multiboot support: Fix rom_copy
ROMs need to be loaded if they are anywhere in the requested area, not
only at the very beginning. This fixes Multiboot with ELF kernels that
have more than one program header.

Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-19 21:49:39 +01:00
Aurelien Jarno f9e69bd9cf roms: allow roms to be loaded at address 0
It was possible to load roms at address 0, but commit
632cf034b4 started to forbid that, which
broke at least ARM versatile.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-19 19:45:27 +01:00
Aurelien Jarno 060fbfe1d6 hw/openpic.c: replace tabs by spaces
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-19 16:04:52 +01:00
Alexander Graf b4b784fe98 target-ppc: Use interrupts for escc
When using the escc with Linux, we need interrupts. So instead of creating
a dummy device, let's just map them to the openpic we have anyways.

This makes Linux on PPC64 with console=ttyPZ0 work.

Obviously, this change needs to be reflected in openbios. Patch for that
follows this one. Please update the binary then.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-19 16:04:52 +01:00
Alexander Graf d14ed2548c target-ppc: Initialize OpenPIC properly
When lowering an IRQ line, we search for the line we're supposed to lower.

Usually we run into an optimization there that queues up interrupts. This
queue ends with -1. Unfortunately we didn't set the first item to -1.

This patch fixes this, making interrupts work on PPC64.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-19 16:04:52 +01:00
Anthony Liguori c749374978 e1000: Don't muck with PCI commmand register
Otherwise, the driver does not work in Linux after the INT_DISABLE changes in
PCI.

Michael Tsirkin had a patch to do this, I'm not sure what happened to it.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-19 08:26:03 -06:00
Riku Voipio 384dce1ede usb-musb: convert fifo to 8bit and add more registers
Convert musb fifo to 8bit to allow 8/16/32bit access

MUSB allows reading and writing to the fifo in 32/16/8 bit
width. The Linux kernel does this sometimes, most usually at
the end of writing the packet to allow packet to end at a
odd bytecount.

Convert the fifo to 8bit allows removing lots of shifts
which shows that the fifo is more natural as 8bit.

While at it, add multiple missing register definitions and
and cleanup debug prints.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-18 23:23:56 +01:00
Juha Riihimäki 109ac32fb5 handle SD CMD5 without error messages
From: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-18 23:23:56 +01:00
Riku Voipio 659139d780 Make USB hid devices self-powered
Simplifies power budget negotiation.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-18 23:23:56 +01:00
Gerd Hoffmann 632cf034b4 roms: remove option rom packing logic
Now that we load the option roms via fw_cfg, we can stop copying
them to the 0xc000 -> 0xe000.  The patch does just that.

Also the rom loader gets simplified as all remaining users of the
rom loader load the bits at a fixed address so the packing and
aligning logic can go away.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:34 -06:00
Gerd Hoffmann 379526a40e roms: use new fw_cfg file xfer support.
roms: use fw_cfg for vgabios and option rom loading, additionally to
deploying them the traditional way (copy to 0xc0000 -> 0xe0000 range).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:34 -06:00
Gerd Hoffmann abe147e0ce fw_cfg: add API for file transfer.
This patch adds a file transfer interface to fw_cfg.  Intended to be
used for passing non-pci option roms and vgabios to seabios.  Namespace
is modeled after the existing cbfs filesystem support in seabios.

Reading the new FW_CFG_FILE_DIR entry returns a file list.
Fields there are in network byte order (aka bigendian).

aliguori: fix fw_cfg.h for multiboot.bin, add proper fw_cfg.h declarations,
          quiet fprintf() in fw_cfg.c

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:34 -06:00
Gerd Hoffmann c2b5bda43a fw_cfg: make calls typesafe
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:34 -06:00
Gerd Hoffmann 8c52c8f320 pci romfiles: add property, add default to PCIDeviceInfo
This patch adds a romfile property to the pci bus.  It allows to specify
a romfile to load into the rom bar of the pci device.  The default value
comes from a new field in PCIDeviceInfo.  The property allows to change
the file and also to disable the rom loading using an empty string.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:34 -06:00
Anthony Liguori c2039bd0ff Support PCI based option rom loading
Currently, we preload option roms into the option rom space in memory.  This
prevents DDIM from functioning correctly which severely limits the number
of roms we can support.

This patch introduces a pci_add_option_rom() which registers the
PCI_ROM_ADDRESS bar which points to our option rom.  It also converts over
the cirrus vga adapter, the rtl8139, virtio, and the e1000 to use this
new mechanism.

The result is that PXE boot functions even with three unique types of cards.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:34 -06:00
Daniel P. Berrange ec7efac4a9 Fix backcompat for hotplug of SCSI controllers
SCSI controllers have no trouble existing without any attached
disks. This could be achieved with the (legacy) monitor syntax

  pci_add pci_addr=auto storage if=scsi

This is now denied with

  scsi requires a backing file/device.
  failed to add if=scsi

There is no need for this denial and it breaks compatability
with existing QEMU usage, so remove the check for presence
of a drive.

  Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:33 -06:00
Juan Quintela 47f5ba7248 fdc: fix migration from 0.11
0.11 uses as instance ide io_base, get it back

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:33 -06:00
Juan Quintela aef30c3c6a Revert "fdc: fix vmstate variable passed"
Floppy used the io_base address to register savevm region.

This reverts commit 2966b390d0.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:33 -06:00
Dave Airlie 8095cb3ed2 vmware: increase cursor buffer size.
The cursor pixmap size we calculate later ends up being 4096 dwords
long by the looks of it. This boots an F12 LiveCD now.

Signed-off-by: Dave Airlie <airlied@linux.ie>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:33 -06:00
Anthony Liguori b5cc6e32ba VMware VGA: Only enable dirty log tracking when fifo is disabled
This patch enables dirty log tracking whenever it's needed and disables it
when it is not.

We unconditionally enable dirty log tracking on reset, restart dirty log
tracking when PCI IO regions are remapped, and disable/enable it based on
commands from the guest.

Rebased-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:33 -06:00
Anthony Liguori a6109ff1b5 Fix VMware VGA depth computation
VMware VGA requires that the depth presented to the guest is the same as the
DisplaySurface that it renders to.  This is because it performs a very simple
memcpy() to blit from one surface to another.

We currently hardcode a 24-bit depth.  The surface allocator for SDL may, and
usually will, allocate a surface with a different depth causing screen
corruption.

This changes the code to allocate the DisplaySurface before initializing the
device which allows the depth of the DisplaySurface to be used instead of
hardcoding something.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:32 -06:00
Anthony Liguori ee3e41a9a0 Make sure to enable dirty log tracking for VMware VGA
This is needed for VMware VGA to work properly under KVM.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:32 -06:00
Anthony Liguori f0138a63a4 Make sure to enable dirty tracking of VBE vram mapping
Apparently, VBE maps the VGA vram to a fixed physical location.  KVM requires
that all mappings of the VGA vram have dirty tracking enabled on them.  Any
access to the VGA vram through the VBE mapping currently fails to result in
dirty page tracking updates causing a black screen.

This is the true root cause of VMware VGA not working correctly under KVM and
likely also an issue with some of the std-vga black screen issues too.

Cirrus does not enable VBE so it would not be a problem when using Cirrus.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Rebased-by: Dave Airlie <airlied@redhat.com>
2009-12-18 11:26:31 -06:00
Dave Airlie f351d050dc vmware: setup PCI BAR 2 for FIFO as per vmware spec
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:31 -06:00
Gerd Hoffmann 9ef5c4bf81 qdev: improve property error reporting.
Add a error message in case we fail to parse a qdev property.

Also make qemu not abort() in case setting a global property can't be
set.  This used to be a clear programming error.  The introduction of
the -global switch changed that though, so better exit instead (after
printing the new error message).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:30 -06:00
Gerd Hoffmann 42be86ce95 usb-net: use qdev for -usbdevice
Rebased to master, adapted to device renaming by armbru,
no other changes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:28 -06:00
Gerd Hoffmann 15ff770544 Check rom_load_all() return value.
Check rom_load_all() return value.
Also don't make option rom loading failure fatal.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:27 -06:00
Gerd Hoffmann ac33f8fad1 defaults: split default_drive
Split default_drive into default_{floppy,cdrom,sdcard}.
Also add QEMUMachine flags to disable them per machine.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:27 -06:00
Markus Armbruster 18dd19a7d9 qdev: Improve uni-north device names
Switch to the names suggested by Blue Swirl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:26 -06:00
Kevin Wolf 092493be3c Fix loading of ELF multiboot kernels
The multiboot implementation assumed that there is only one program header
(which contains the entry point) and that the entry point is at the start of
the code. This doesn't hold true generally and caused too little data to be
loaded.

Fix the loading code to pass the whole loaded data to the Multiboot Option ROM.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:26 -06:00
Anthony Liguori d587e07871 Revert "pci: interrupt disable bit support"
This reverts commit 0ea5709a32085f7d14901a09d12bd35f9b267607.

Per discussion with Michael Tsirkin, this is too risky for 0.12

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-18 11:26:25 -06:00
Alexander Graf e249651ca9 S390: Bail out without KVM
Currently only the S390 KVM target works. To keep users from accidently not
using KVM, let's not even initialize the machine when KVM is not used.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-18 16:39:19 +01:00
Alexander Graf 86f3dba651 S390: Don't tell guest we're updating config space
Currently we always set the "config space changed" bit to 1 when triggering
any virtio interrupt. While that worked in 2.6.27, newer kernels interpret
that value as "only the config space changed and nothing else happened".

Since we usually trigger interrupts to tell the guest that something did
happen, we just not tell it the config space changed for now until we
implement the correct callback for that.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-18 16:34:26 +01:00
Alexander Graf a1e4b07f04 S390: Loop through virtio console devices
We used to always create one single virtio console device. This breaks when
either zero of multiple virtio console devices are requested, so let's use
the same code as on x86.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-18 16:34:20 +01:00
Richard Henderson fe57ca82b0 target-alpha: Add placeholders for missing userspace PALcalls.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-17 18:11:58 +01:00
Stefan Weil 5a2b3fc5aa s390: Fix buggy assignment
nd->model keeps dynamically allocated model names.
So casting of a constant string is wrong here.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-16 18:25:07 +01:00
Richard Henderson ab471ade02 target-alpha: Implement RD/WRUNIQUE in the translator
When emulating user-mode only, there's no reason to exit
the translation block to effect a call_pal.  We can generate
a move to/from the unique slot directly.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13 21:36:16 +01:00
Igor V. Kovalenko 90228ee395 workaround for cmd646 bmdma register access while no dma is active
This is a workaround only, and is a partial revert
of a few changes to BMDMAState which removed pci_dev
field on the way.

- cmd646 pci_from_bm() expects bm->unit value to
correspond with bm data being passed to callback
as opaque pointer. This breaks when write to dma
control register of second channel happens when no
dma operation is in progress, so bm->unit is zero
for second channel, and pci_from_bm() returns garbage
pointer. Crash happens shortly after that while
dereferencing that pointer.

v0->v1: cleaned up dead code from pci_from_bm.

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-13 19:03:31 +00:00
Michael S. Tsirkin cf708987d7 s390: typo fix
s390 code has an obvious typo, which results in:
hw/s390-virtio.c: At top level:
hw/s390-virtio.c:249: error: request for member ‘no_vga’ in something not a structure or union

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13 19:44:07 +01:00
Michael S. Tsirkin 0435d39360 s390: fix build on 32 bit host
Building on 32 bit host we get:
hw/s390-virtio.c: In function ‘s390_init’:
hw/s390-virtio.c:184: error: integer constant is too large for ‘unsigned long’ type
64 bit values must be ULL.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13 19:44:00 +01:00
Artyom Tarasenko 82407d1a40 fdc/sparc32: don't hang on detection under OBP
Stepping through the SS-5's OBP initialization routines
it looks like reading fdc main status register should
clear the fd interrupt.
The patch doesn't fix problems with fdc on sparc platform,
it only fixes fdc detection.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-13 13:30:44 +00:00
Artyom Tarasenko c5de386ac9 Sparc32: implement AFX for SS-5
Implement a stub for the AFX register on SparcStation-5.
This stub is needed for running the original SS-5 OBP
instead of OpenBIOS (which allows to boot Solaris 2.5.1
and Solaris 2.6 kernels).

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-13 13:30:19 +00:00
Artyom Tarasenko ad3cea4248 scsi-disk: Inquiry with allocation length of CDB < 36 (v4)
According to the SCSI-2 specification,
http://ldkelley.com/SCSI2/SCSI2/SCSI2/SCSI2-08.html#8.2.5 ,
"if the allocation length of the command descriptor block (CDB) is too
small to transfer all of the parameters, the additional length shall
not be adjusted to reflect the truncation."
The 36 mandatory bytes of response are written to outbuf, and then
only the length requested in CDB is transferred.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-13 10:55:04 +00:00
Luiz Capitulino 7a344f7ac7 PCI: Convert pci_device_hot_add() to QObject
Return a QDict with information about the just added device.

This commit should not change user output.

Please, note that this patch does not do error handling
conversion. In error conditions the handler still calls
monitor_printf().

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:49 -06:00
Gerd Hoffmann 11f4d7f483 scsi: fix drive hotplug.
This patch fills the DriveInfo->unit after hotplugging a scsi disk.
It makes a difference when auto-assigning a scsi id, where unit was
left filled with '-1' instead of the actual scsi id.

With this patch applied the the drive naming logic in drive_init() works
as good as it did in previous releases.  Which means it works fine with
a single scsi bus.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:44 -06:00
Gerd Hoffmann 09e3acc6cf pci: don't hw_error() when no slot is available.
Current PCI code will simply hw_error() and thus abort in case no free
PCI slot is available or the requested PCI slot is already in use by
another device.  For the hotplug case this behavior is not acceptable.
This patch makes qemu pass up the error properly, so the calling code
can decide whenever it wants to exit with an error (on startup) or
whenever it wants to continue (hotplug).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:44 -06:00
Gerd Hoffmann 53e0d8affe pci: don't abort() when trying to hotplug with acpi off.
The PCI bus on x86 requires ACPI for hotplug support, thus disbling ACPI
also disables hotplug for the PCI bus.  This patch makes qemu check
whenever the PCI bus in question can handle hotplug before trying to add
devices.  This is needed because qdev will abort() on any attempt to
hotplug devices into a non-hotpluggable bus.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:44 -06:00
Gerd Hoffmann 986c5f7854 Set default console to virtio on S390x
All "normal" system emulation targets in qemu I'm aware of display
output on either VGA or serial output.

Our S390x virtio machine doesn't have such kind of legacy hardware. So
instead we need to default to a virtio console.

Add flags to QEMUMachine to indicate which kind of default devices make
sense for the machine in question.  Use it for S390x: enable virtcon,
disable serial, parallel and vga.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:44 -06:00
Gerd Hoffmann 07a8de3566 qdev: also match bus name for global properties
i.e. -global PCI.<property>=<value> will set a default property for all
PCI devices.  Also works for the compat properties used by machine
types.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:41 -06:00
Gerd Hoffmann 458fb6792d qdev: make compat stuff more generic
This patch renames the compat properties into global properties and
makes them more generic.  The compatibility stuff is only one of
multiple possible users now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:40 -06:00
Markus Armbruster 556cd09885 qdev: Replace device names containing whitespace
Device names with whitespace require quoting in the shell and in the
monitor.  Some of the offenders are also overly long.  Some have a
more convenient alias, some don't.

The place for verbose device names is DeviceInfo member desc.  The
name should be short & sweet.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Markus Armbruster 063846984c qdev: Separate USB product description from qdev name
Using the qdev name for the product description makes for inconvenient
qdev names.

Put the product description in new USBDeviceInfo member product_desc.
Make usb_qdev_init() use it.  No user or guest visible change, since
the value is still the same.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Markus Armbruster 0fe6d12e0b qdev: Rename USBDevice member devname to product_desc
It's not a device name, it's the USB product description string.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Gleb Natapov ba32edab7f fix rtc-td-hack on host without high-res timers
On hosts without high-res timers it is impossible to inject rtc interrupt
faster then 1kHz. Windows sometimes configures RTC to generate 1kHz
interrupts, so we can't inject missed interrupts when running on such
hosts. Always injecting an interrupt on REG_C read is also not an option
since Windows wait for REG_C to become zero with interrupt disabled
during boot. This patch uses mixed approach: accelerate timer + inject
up to 1000 interrupts on REG_C read.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Michael S. Tsirkin 6d74ca5aa8 virtio: verify features on load
migrating between hosts which have different features
might break silently, if the migration destination
does not support some features supported by source.

Prevent this from happening by comparing acked feature
bits with the mask supported by the device.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Dave Airlie b3c3f123f7 vmware_vga: add rom file so that it boots.
This just adds the rom file to the vmware SVGA chipset so it boots.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:37 -06:00
Edgar E. Iglesias 7029a83bd6 microblaze: Make boot_info static.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-10 14:46:18 +01:00
Edgar E. Iglesias be5e834986 microblaze: Add missing cpu_reset.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-10 14:43:13 +01:00
Edgar E. Iglesias b4d34d5e9b microblaze: Boot and reset fixes.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-10 14:40:35 +01:00
Michael S. Tsirkin b6981cb57b pci: interrupt disable bit support
Interrupt disable bit is mandatory in PCI spec.
Implement it to make devices spec compliant.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-12-07 21:50:53 +02:00
Michael S. Tsirkin f9bf77dd1f pci: interrupt status bit implementation
interrupt status is a mandatory feature in PCI spec,
so devices must implement it to be spec compliant.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-12-07 21:50:53 +02:00
Michael S. Tsirkin d036bb215e pci: prepare irq code for interrupt state
This rearranges code in preparation for interrupt state
implementation.
Changes:
	- split up bus walk away from interrupt handling
          into a subroutine
	- change irq_state from an array to bitmask
	- verify that irq_state values are 0 or 1 on load

There are no functional changes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-12-07 21:50:53 +02:00
Michael S. Tsirkin 5b5cb08683 msix: function mask support
Function mask is a mandatory feature in MSIX
spec so not implementing it is a spec violation.
Implement.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-07 21:50:53 +02:00
Michael S. Tsirkin 2760952ba9 msix: macro rename for function mask support
rename ENABLE_OFFSET -> CONTROL_OFFSET, since
same byte includes function mask.
This is in preparation for function mask support.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-07 21:50:52 +02:00
Alexander Graf 8cb310e130 Add S390x virtio machine description
In order to use the new S390x virtio bus we just introduced, we also
need a machine description that sets up the machine according to our
PV specification.

Let's add that machine description and be happy!

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-05 17:36:05 +01:00
Alexander Graf f3304eea93 Add S390x virtio machine bus
On S390x we don't want to go through the hassle of emulating real existing
hardware, because we don't need to for running Linux.

So let's instead implement a machine that is 100% based on VirtIO which we
fortunately implement already.

This patch implements the bus that is the groundwork for such an S390x
virtio machine.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-05 17:36:05 +01:00
Blue Swirl d05ac8faf5 Add "static" to please Sparse
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-04 20:44:44 +00:00
Blue Swirl 407f879abb scsi: fix incorrect ?: use
Fixes OpenBSD build.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-04 18:08:59 +00:00
Thadeu Lima de Souza Cascardo fe0d61231e ide: implement stub for audio control/volume read
This implements the audio control or volume read support as needed by
some systems. A Conectiva Parolin system required this to detect an IDE
device as CD-ROM, through the CDVOLREAD ioctl.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:26:01 -06:00
Thadeu Lima de Souza Cascardo a70089ceeb ide: Use some already defined page macros instead of constants
Some PAGE constants were used instead of the macros we already have
defined in internal.h.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:26:01 -06:00
Stefan Weil b8f6ba0d0c eepro100: Improve debug messages
* buf was too small for longer register names.
* Use consistent upper case for nouns in register names.
* Use better name for array with e100 register names.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:26:01 -06:00
David Benjamin ec16928806 eepro100: Allocate a larger buffer for regname()
This should avoid truncating the register name when debugging.

Signed-off-by: David Benjamin <davidben@mit.edu>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:26:01 -06:00
Kevin Wolf 5f370b1463 multiboot: Use signed type for negative error numbers
In mb_mod_length a return value is stored that is negative in error case. With
an unsigned type the check goes wrong.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:26:00 -06:00
Ryan Harper b4b2f05403 Fix compile error when LSI_DEBUG is defined
This patch fixes the follow error when LSI_DEBUG is set.

  CC    libhw64/lsi53c895a.o
cc1: warnings being treated as errors
qemu/hw/lsi53c895a.c: In function 'lsi_io_mapfunc':
qemu/hw/lsi53c895a.c:1932: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t'
qemu/hw/lsi53c895a.c: In function 'lsi_ram_mapfunc':
/qemu/hw/lsi53c895a.c:1947: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t'
qemu/hw/lsi53c895a.c: In function 'lsi_mmio_mapfunc':
qemu/hw/lsi53c895a.c:1957: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t'
make[1]: *** [lsi53c895a.o] Error 1
make: *** [subdir-libhw64] Error 2

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:26:00 -06:00
Stefan Weil b10fec9bfa e1000: Fix warning from code review
A code review run by Steve Grubb complained about code in e1000.c:

In hw/e1000.c at line 89, vlan is declared to be 4 bytes.
At line 382 is an attempt to do a memmove over it with a size of 12.

This was fixed by splitting the memmove in two calls and
adding a comment to the declaration of vlan and data.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:25:58 -06:00
Adam Lackorzynski 53ea95de52 multiboot: Fix module loading and setting of mmap.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:25:58 -06:00
Laszlo Ast 550fe6c6fc SCSI: Fix Standard INQUIRY data
Vendor identification, product identification and product revision level
should be padded with spaces without a terminating NULL character, see
SCSI-2 standard, 8.2.5.1 Standard INQUIRY data.

Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:25:57 -06:00
Alexander Graf dc702288a3 targe-ppc: Sync CPU state for KVM
Some recent change made PPC guests always start at address 0x0 because env
isn't synced to kvm_state on first bootup.

I'm not sure if this is the correct bugfix, but at least it makes PPC boot
again with KVM enabled.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-03 20:20:43 +01:00
Michael S. Tsirkin feb9e61285 qemu: cleanup unused macros in cirrus
Cirrus vga has a copy of many PCI macros,
and it doesn't even use them. Clean up.
We also don't need to override header type
as it is NORMAL by default.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 11:45:50 -06:00
Michael S. Tsirkin f74ab486d5 qemu: make cirrus init value pci spec compliant
PCI memory should be disabled at reset, otherwise
we might claim transactions at address 0.
I/O should also be disabled, although for cirrus
it is harmless to enable it as we do not
have I/O bar.

Note: bios fix needed for this patch to work
was already applied:
previously bios incorrently assumed that it does not
need to enable i/o unless device has i/o bar.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 11:45:50 -06:00
Kevin Wolf f35d68f0e7 virtio-blk: Implement rerror option
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 11:45:49 -06:00
Kevin Wolf ce4b6522f7 ide: Implement rerror option
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 11:45:49 -06:00
Kevin Wolf f785009961 Rename DriveInfo.onerror to on_write_error
Either rename variables and functions to refer to write errors (which is what
they actually do) or introduce a parameter to distinguish reads and writes.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 11:45:49 -06:00
Jan Kiszka f327aa0c60 live migration: Propagate output monitor to callback handler
In order to allow proper progress reporting to the monitor that
initiated the migration, forward the monitor reference through the
migration layer down to SaveLiveStateHandler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 10:48:53 -06:00
Juan Quintela be73cfe2be savevm: Port to qdev.vmsd all devices that have qdev
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 10:05:58 -06:00
Juan Quintela 70cca6d872 qdev: enable vmstate_unregister() support
Now vmstate_unregister have the right type

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 10:04:55 -06:00
Juan Quintela 5084bca17f pci: vmstate_register() already assign consecutive numbers starting at 0
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 10:04:55 -06:00
Juan Quintela 33599e2a61 vmstate: Add support for multiplying size for a constant
When the size that we want to transmit is in another field, but in an
unit different that bytes

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 10:04:54 -06:00
Juan Quintela bfb811ade5 vmstate: remove usused VMSTATE_STRUCT_ARRAY_SIZE_UINT8
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 10:04:54 -06:00
Juan Quintela 2fee40782c vmstate: Introduce UINT16_TEST support
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 10:04:54 -06:00