Commit Graph

2267 Commits

Author SHA1 Message Date
Beth Kon ce536cfd1c HPET fixes for reg writes
This patch addresses the problems found by Andriy Gapon:

- The code was incorrectly overwriting the high order 32
  bits of the timer and hpet config registers. This didn't show up
  in testing because linux and windows use hpet in legacy mode,
  where the high order 32 bits (advertising available interrupts)
  of the timer config register are ignored, and the high order 32
  bits of the hpet config register are reserved and unused.

- The mask for level-triggered interrupts was off by a bit. (hpet
  doesn't currently support level-triggered interrupts).

In addition, I removed some unused #defines, and corrected the ioapic
interrupt values advertised. I'd set this up early in hpet development
and never went back to correct it, and no bugs resulted since linux and
windows use hpet in legacy mode where available interrupts are ignored.

Signed-off-by: Beth Kon <eak@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:08:23 -05:00
Gerd Hoffmann 9dfd7c7a00 switch -drive to QemuOpts.
Demo QemuOpts in action ;)

Implementing a alternative way to specify the filename should be
just a few lines of code now once we decided how the cmd line syntax
should look like.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:08:23 -05:00
Gerd Hoffmann 3b0ba92793 kill drives_opt
cleanup pretty simliar to the drives_table removal patch:
 - drop the table and make a linked list out of it.
 - pass around struct pointers instead of table indices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:08:23 -05:00
Gerd Hoffmann 751c6a1704 kill drives_table
First step cleaning up the drives handling.  This one does nothing but
removing drives_table[], still it became seriously big.

drive_get_index() is gone and is replaced by drives_get() which hands
out DriveInfo pointers instead of a table index.  This needs adaption in
*tons* of places all over.

The drives are now maintained as linked list.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:08:23 -05:00
Gerd Hoffmann 8a14daa5a1 qdev/pci: hook up i440fx.
Hook i44fx pcihost into sysbus.
Convert Host bridge and ISA bridge pci devices to qdev.
Tag as no-user.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:08:13 -05:00
Gerd Hoffmann 8ffb1bcf56 qdev: bus walker + qdev_device_add()
This patch implements a parser and qdev tree walker for bus paths and
adds qdev_device_add on top of this.

A bus path can be:
  (1) full path, i.e. /i440FX-pcihost/pci.0/lsi/scsi.0
  (2) bus name, i.e. "scsi.0".  Best used together with id= to make
      sure this is unique.
  (3) relative path starting with a bus name, i.e. "pci.0/lsi/scsi.0"

For the (common) case of a single child bus being attached to a device
it is enougth to specify the device only, i.e. "pci.0/lsi" will be
accepted too.

qdev_device_add() adds devices and accepts bus= parameters to find the
bus the device should be attached to.  Without bus= being specified it
takes the first bus it finds where the device can be attached to (i.e.
first pci bus for pci devices, ...).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 08:39:29 -05:00
Gerd Hoffmann d271de9f1b qdev: create default bus names.
Create a default bus name if none is passed to qbus_create().

If the parent device has DeviceState->id set it will be used to create
the bus name,. i.e. -device lsi,id=foo will give you a scsi bus named
"foo.0".

If there is no id BusInfo->name (lowercased) will be used instead, i.e.
-device lsi will give you a scsi bus named "scsi.0".

A scsi adapter with two scsi busses would have "scsi.0" and "scsi.1" or
"$id.0" and "$id.1" busses.  The numbers of the child busses are per
device, i.e. when adding two lsi adapters both will have a "*.0" child
bus.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 08:39:29 -05:00
Gerd Hoffmann a6307b086b qdev/pci: use qdev_prop_pci_devfn
Put the new property into use.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 08:39:29 -05:00
Gerd Hoffmann 05cb5fe442 qdev/prop: add pci devfn property
So we can parse "$slot.$fn" strings into devfn numbers.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 08:39:29 -05:00
Mark McLoughlin 9574758134 Add a pc-0.11 machine type and make the pc type an alias
The pc-0.11 type allows users of qemu-0.11 to use a machine type which
they know will remain compatible when the upgrade to qemu-0.12.

Management tools may choose to canonicalize the 'pc' machine type to
'pc-0.11' so that if the 'pc' alias changes target in future versions
of qemu, the machine type used will remain compatible.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 08:39:28 -05:00
Mark McLoughlin 3f6599e675 Add machine type aliases
Add an 'alias' field to QEMUMachine and display it in the output of
'qemu -M ?' with an '(aliased to foo)' suffix.

Aliases can change targets in newer versions of qemu, so management tools
may choose canonicalize machine types to ensure that if a user chooses an
alias, that the actual machine type used will remain compatible in
future.

This is intended to mimic a symlink to a machine description file.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 08:39:28 -05:00
Alexander Graf 33b544ba5c Give the kernel more room
My self-built PPC kernel doesn't fit in the region reserved for
the kernel, so I can't use -kernel with it.

Let's just extend the region.

Signed-off-by: Alexander Graf <agraf@suse.de>
2009-07-26 06:31:32 +00:00
Alexander Graf a7b022e083 PPC: Round VGA BIOS size to page boundary
When giving KVM a slot of a size not on page boundary, it chokes. So let's
just round up the VGA BIOS size so nobody complains anymore and we don't need
to implement sub-page slots.

Required for booting a PPC guest in KVM.

Signed-off-by: Alexander Graf <agraf@suse.de>
2009-07-26 06:31:15 +00:00
Glauber Costa a61d1f6701 notify io_thread at the end of rx handling
This is a backport from qemu-kvm. Just instead of using kvm's specific
notification mechanism, we use qemu_notify_event()

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22 10:58:49 -05:00
Nolan 777aec7ac9 Add save/restore support to the LSI logic SCSI device model.
This patch requires "Handle BH's queued by AIO completions in
qemu_aio_flush()" to work reliably.  The combination of those two
patches survived 300+ migrations with heavy IO load running in the
guest.

Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22 10:58:47 -05:00
Blue Swirl e32cba29be Sparc32: convert Sun4c interrupt controller to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 19:57:32 +00:00
Blue Swirl 7fc067350c Sparc32: convert SBI to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 19:25:59 +00:00
Blue Swirl 0484362698 Sparc32/64: use 64 bit type for memory size
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 11:20:11 +00:00
Blue Swirl 5a053d1f2e qdev: add 64 bit type
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 11:10:41 +00:00
Blue Swirl 636aa70ade Sparc64: refactor kernel init
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 10:49:47 +00:00
Blue Swirl 7b833f5b21 Sparc64: refactor CPU init
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 10:46:23 +00:00
Blue Swirl bda4203325 Sparc64: convert memory to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 10:04:47 +00:00
Blue Swirl 1baffa46ed Sparc64: convert boot prom to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 09:58:02 +00:00
Blue Swirl daa6549120 Sparc32: Fix lance
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 08:53:39 +00:00
Blue Swirl 72f44c8cc7 Sparc64: convert APB to qdev
Thanks to Igor Kovalenko for a bugfix.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21 08:53:35 +00:00
Blue Swirl 0bf9e31af1 Fix most warnings (errors with -Werror) when debugging is enabled
I used the following command to enable debugging:
perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * */* */*/*

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-20 17:19:25 +00:00
Blue Swirl c0a2a096a0 Fix build with DEBUG_PCI in pci_host.h enabled
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-20 10:37:51 +00:00
Blue Swirl 12a71a027c Clean up fdc qdev conversion
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-20 06:56:23 +00:00
Christoph Egger 88e150a569 isxdigit -> qemu_isxdigit
Hi!

Attached patch uses qemu_isxdigit() instead of isxdigit().
Fixes build warning on NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
2009-07-17 17:48:02 +00:00
Blue Swirl a9ff9df188 Suppress a Sparse warning
Move the export to a file used by both qdev.c and sysbus.c.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-17 11:18:53 +00:00
Blue Swirl 109819e0c0 Sparc32: use hex for version numbers
0x10000000 looks better than 268435456.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-17 11:01:50 +00:00
Blue Swirl e2106fe69d Sparc32: fix escc devices broken by ee6847d19b
The logic of Zilog makes channel B the first device and channel A the
second one.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-17 11:01:49 +00:00
Blue Swirl e81337624e Sparc32: fix fdc io_base
On some Sparc32 machines, fdc is located above 4G limit, so uint32_t is not
appropriate type for io_base.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-17 11:01:48 +00:00
Blue Swirl f6e097e71e Fix sparc-softmmu breakage by ee6847d19b
Move the qdev_init(dev); call after the setting of d->size.
Thanks to Filip Navara.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-17 11:01:47 +00:00
Naphtali Sprei 356c7ff4b6 fix for bad macaddr of e1000 in Windows 2003 server with original MS driver
The sequence of reading from eeprom is "offset by one" moved because of a false
detection of a clock cycle after an eeprom reset. Keeping the last clock value
after a reset keeps it in sync.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:54 -05:00
Gerd Hoffmann f35199864c qdev: es1370+ac97 description
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:53 -05:00
Gerd Hoffmann a1e0fea587 qdev/compat: virtio-net-pci 0.10 compatibility.
Add vectors property, allowing to turn off msi by setting vectors=0.
Add compat property to pc-0.10 disabling msi.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:53 -05:00
Gerd Hoffmann 8ad1251470 qdev: print device id in "info pci".
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:53 -05:00
Gerd Hoffmann d6beee9938 qdev/compat: virtio-console-pci 0.10 compatibility.
Add class property to virtio-console-pci allowing to specify the PCI class.
Add compat property to pc-0.10 to set the old PCI class.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:53 -05:00
Gerd Hoffmann eb54b6dcb8 qdev: add id= support for pci nics.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:53 -05:00
Gerd Hoffmann ab73ff29ce qdev/compat: virtio-blk-pci 0.10 compatibility.
Add class property to virtio-blk-pci allowing to specify the PCI class.
Add compat property to pc-0.10 to set the old PCI class.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:53 -05:00
Gerd Hoffmann ccb63de38e qdev: add user-specified identifier to devices.
Add id field to DeviceState.  Make "info qtree" print it.

This helps users and management apps identifying devices in monitor
output, which is especially useful with otherwise identical devices
such as two virtio disks.

This patch doesn't add a way to set the id, followup patches will do.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:53 -05:00
Gerd Hoffmann 96cc181089 qdev/compat: add pc-0.10 machine type.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:52 -05:00
Gerd Hoffmann 3320e56e54 qdev: add no_user, alias and desc
no_user: prevent users from adding certain devices.
desc: description of the device.
alias: to allow user friendly shortcuts on the command line, i.e.
  -device usbmouse  instead of  -device "QEMU USB Mouse"  or
  -device lsi       instead of  -device lsi53c895a

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:52 -05:00
Gerd Hoffmann b6b6114460 qdev/compat: compat property infrastructure.
This add support for switching devices into a compatibility mode
using device properties.  Machine types can have a list of properties
for specific devices attached to allow the easy creation of machine
types compatible to older qemu versions.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:52 -05:00
Gerd Hoffmann 81ebb98b24 qdev: factor out driver search to qdev_find_info()
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:52 -05:00
Gerd Hoffmann 15239b2e52 cleanup: drop unused struct elements from VirtIOPCIProxy.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:51 -05:00
Gerd Hoffmann ee6847d19b qdev: rework device properties.
This patch is a major overhaul of the device properties.  The properties
are saved directly in the device state struct now, the linked list of
property values is gone.

Advantages:
  * We don't have to maintain the list with the property values.
  * The value in the property list and the value actually used by
    the device can't go out of sync any more (used to happen for
    the pci.devfn == -1 case) because there is only one place where
    the value is stored.
  * A record describing the property is required now, you can't set
    random properties any more.

There are bus-specific and device-specific properties.  The former
should be used for properties common to all bus drivers.  Typical
use case is bus addressing, i.e. pci.devfn and i2c.address.

Properties have a PropertyInfo struct attached with name, size and
function pointers to parse and print properties.  A few common property
types have PropertyInfos defined in qdev-properties.c.  Drivers are free
to implement their own very special property parsers if needed.

Properties can have default values.  If unset they are zero-filled.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:51 -05:00
Dinesh Subhraveti ef74679a81 Initialize PS2 keyboard / mouse state on reset
Currently only common PS2 state is initialized, leaving keyboard and
mouse specific state to contain stale values.

Signed-off-by: Dinesh Subhraveti <dineshs@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:51 -05:00
Beth Kon 7d93b1fa18 Reset HPET config register on hpet_reset
Without this, after system reset, hpet does not detect transition from
non-legacy to legacy mode.

Signed-off-by: Beth Kon <eak@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:50 -05:00
Pascal Terjan bf4e5d9297 Handle vga= in -append
Here is a patch I had sent twice to the list 2 years ago.
Hopefuly this time someone will be interested

It adds support for passing vga mode to linux kernel through
vga= option in -append

Signed-off-by: Pascal Terjan <pterjan@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 17:28:50 -05:00
Blue Swirl 8167ee8839 Update to a hopefully more future proof FSF address
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16 20:47:01 +00:00
Blue Swirl a1961a4b31 Sparc32: convert slavio interrupt controller to qdev
Also increase QDEV_MAX_IRQ.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16 14:15:34 +00:00
Blue Swirl 666713c071 Sparc32: refactor CPU init
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16 13:48:20 +00:00
Blue Swirl a350db853f Sparc32: convert memory to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16 13:48:14 +00:00
Blue Swirl f48f656949 Sparc32: convert boot prom to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16 13:48:10 +00:00
Blue Swirl 5f750b2ea0 Sparc32: convert iommu to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16 13:47:55 +00:00
Blue Swirl fa28ec521b Sparc32: convert cs4231 to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16 13:47:45 +00:00
Blue Swirl d3ffcafe25 Sparc32: fix SDL zooming with TCX
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16 13:45:57 +00:00
Isaku Yamahata d8d2e079fa pci.c: remove unnecessary #ifdef DEBUG_PCI.
remove unnecessary #ifdef DEBUG_PCI.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 08:28:13 -05:00
Jan Kiszka 9538749118 Add boot menu control via command line switch
Disable the lengthy BIOS prompt for selecting a boot device by default,
but let the user reenable it via '-boot menu=on'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 08:28:12 -05:00
Jan Kiszka dda9b29f61 Add qemu_unregister_reset
Will be used by '-boot once=...', and should also help in other use
cases.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 08:28:12 -05:00
Jan Kiszka 76e30d0f13 Move boot_set callback backend
Move registration function for the boot_set callback handler and provide
qemu_boot_set so that it can also be used outside the monitor code.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 08:28:12 -05:00
Mark McLoughlin e8b2a1c648 Add a pc-0-10 machine type for compatibility with 0.10.x
Add a pc-0-10 machine type to allow a pc machine to be created with
virtio block and console devices compatibility with qemu-0.10.x.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 08:28:11 -05:00
Mark McLoughlin 21d58b575e Change default PCI class of virtio-console to PCI_CLASS_SERIAL_OTHER
We're using PCI_CLASS_DISPLAY_OTHER now, but qemu-kvm.git is using
PCI_CLASS_OTHERS because:

  "As a PCI_CLASS_DISPLAY_OTHER, it reduces primary display somehow on
   Windows XP (possibly Windows disables acceleration since it fails
   to find a driver)."

While this is valid, many versions of X will get confused by it.
Class major number of 0 gets treated as a possibly prehistoric VGA
device, and then the autoconfig logic gets confused trying to figure
out whether the virtio console or the pv vga device are the real VGA.

We should really set a proper class ID. 0x0780 (serial / other) seems
most appropriate. This shouldn't require any kernel changes, the
modalias for virtio looks like:

  alias:          pci:v00001AF4d*sv*sd*bc*sc*i*

so won't care what the base class or subclass are.

It shows up in the guest as:

  00:05.0 Communication controller: Qumranet, Inc. Virtio console

A new qdev type is introduced to allow devices using the old class
to be created for compatibility with qemu-0.10.x.

Reported-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 08:28:10 -05:00
Mark McLoughlin 5c634ef30d Change default PCI class of virtio-blk to PCI_CLASS_STORAGE_SCSI
Windows virtio driver cannot pass DTM (certification) tests while the
storage class is PCI_CLASS_STORAGE_UNKNOWN.

A new qdev type is introduced to allow devices using the old class
to be created for compatibility with qemu-0.10.x.

Reported-by: Dor Laor <dlaor@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16 08:28:10 -05:00
Blue Swirl 6f6260c7d6 Sparc32: convert sparc32_dma to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-15 20:45:19 +00:00
Blue Swirl f64ab228b8 Convert fdc to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-15 14:41:54 +00:00
Blue Swirl c70c59eeec Sparc32: convert slavio timers to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-15 08:53:09 +00:00
Blue Swirl 6c319c8222 Sparc32/PPC: convert escc to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-15 08:51:32 +00:00
Blue Swirl 2582cfa0cb Sparc32: convert slavio_misc to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-13 16:51:27 +00:00
Blue Swirl 325f27475d Sparc32: convert idreg to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-13 16:11:08 +00:00
Tristan Gingold f55e9d9a40 target-ppc: fix typo in _cpu_ppc_load_decr
Use parameter 'next' to fix the hdecr case.
Also pass 'next' by value instead of pointer (more easy to read and no
performance issue for an always_inline function).

Signed-off-by: Tristan Gingold <gingold@adacore.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-07-12 23:32:11 +02:00
Blue Swirl d27cf0ae6d Sparc32/Sparc64/PPC: convert m48txx to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 20:07:07 +00:00
Blue Swirl f40070c36c Sparc32: convert tcx to qdev
Also increase QDEV_MAX_MMIO.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 19:28:37 +00:00
Blue Swirl 798b721ec3 Sparc32: use the OpenFirmware name for ecc
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 21:43:24 +03:00
Blue Swirl 53e3c4f918 Sparc64: convert ebus to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 08:54:49 +00:00
Blue Swirl 49e6637386 Sparc32: convert eccmemctl to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 08:16:55 +00:00
Igor Kovalenko 7d55273fcd sparc64: really initialize irq
Allocate irq just before passing it to pci bridge initialization
and actually use it to initialize pci bridge.

Signed-off-by: igor.v.kovalenko@gmail.com

--
Kind regards,
Igor V. Kovalenko
2009-07-12 07:43:00 +00:00
Paul Brook 616cbc78a5 Fix PCI IRQ breakage
Zero initialize the PCI bus irq count.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-11 22:46:51 +01:00
Blue Swirl 110c50fd31 Revert "Fix the PCI header type of APB"
This reverts commit e8d2a88755.
2009-07-11 08:38:39 +00:00
Blue Swirl ac47a60b3f Fix APB by reverting 16eaedf266 partially
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-11 08:20:24 +00:00
Anthony Liguori 0c3271c558 Indent ac97 and es1370 according to audio formatting
For the sake of consistency.  I pulled in the wrong patches from Gerd when
he did the qdev conversion.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 15:32:03 -05:00
Michael S. Tsirkin e6da768000 qemu/virtio: mark msi vectors used on load
Usage of msi vectors is controlled by the guest and so needs to be
restored on load. Do this for msi vectors used by the virtio device.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 13:44:30 -05:00
Michael S. Tsirkin 72755a7096 qemu/msi: missing braces
MSIX present bit is tested incorrectly, and only happens to work because
the bit we are testing is 0x1.  Add braces to fix this.

Reported-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 13:44:30 -05:00
Michael S. Tsirkin 4bfd1712d7 qemu/msi: clean used vectors state on load
Clean up msix vector usage state on load. Since guest might have control
over it through the device, the device will have to load this state from
file.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 13:44:30 -05:00
Michael Buesch 1fa63e43e6 usb-ohci: Fix endianness issue
This fixes a possible endianness issue in the usb-ohci hw module.
hcca.frame and ohci->frame_number are 16bit, so use cpu_to_le16().

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 13:41:20 -05:00
Michael S. Tsirkin dca61621f8 qemu: remove control vector save
control vector is saved/restored by virtio-pci,
it does not belong in virtio.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:58:08 -05:00
Michael S. Tsirkin 9a3e12c8a4 fix segfault in msix_save
This fixes segfault reported by Kevin Wolf,
and simplifies the code in msix_save.

Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:58:08 -05:00
Mark McLoughlin 391354f126 Unregister savevm callback in eeprom93xx_free()
Otherwise if you hot remove an eepro100 NIC and then migrate,
you get:

  Unknown savevm section or instance 'eeprom' 0

on the destination side.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:58:08 -05:00
Mark McLoughlin ae50b2747f Don't leak VLANClientState on PCI hot remove
destroy_nic() requires that NICInfo::private by a PCIDevice pointer,
but then goes on to require that the same pointer matches
VLANClientState::opaque.

That is no longer the case for virtio-net since qdev and wasn't
previously the case for rtl8139, ne2k_pci or eepro100.

Make the situation a lot more clear by maintaining a VLANClientState
pointer in NICInfo.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:58:07 -05:00
Isaku Yamahata d56dd6cf03 use constant IOPORTS_MASK instead of 0xffff.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:06:39 -05:00
Isaku Yamahata 3299397760 split out ioport related stuffs from vl.c into ioport.c.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:06:38 -05:00
Gerd Hoffmann d88a76d1d3 qdev: convert ac97.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 6806e59567 qdev: convert es1370.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 16eaedf266 qdev/pci: misc fixes.
* fix secondary bus setup.
 * use base->name instead of "FIXME" for device name.
   Yes, the device name is redundant.  Only for drivers converted
   to qdev already though.  Once all drivers are converted we can
   and should kill it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 042f84d0af qdev: remove DeviceType
The only purpose DeviceType serves is creating a linked list of
DeviceInfo structs.  This removes DeviceType and add a next field to
DeviceInfo instead, so the DeviceInfo structs can be changed that way.
Elimitates a pointless extra level of indirection.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 10c4c98ab7 qdev: replace bus_type enum with bus_info struct.
BusInfo is filled with name and size (pretty much like I did for
DeviceInfo as well).  There is also a function pointer to print
bus-specific device information to the monitor.  sysbus is hooked
up there, I've also added a print function for PCI.

Device creation is slightly modified as well:  The device type search
loop now also checks the bus type while scanning the list instead of
complaining thereafter in case of a mismatch.  This effectively gives
each bus a private namespace for device names.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 0aab0d3a4a qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunch
of parameters.  Also adds config_read and config_write callbacks to
PCIDeviceInfo, so drivers needing these can be converted to the qdev
device API too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:02 +01:00
Blue Swirl e8d2a88755 Fix the PCI header type of APB
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-05 20:33:02 +00:00