Commit Graph

38 Commits

Author SHA1 Message Date
Alexander Graf a489f7f711 PPC: bamboo: Move host fdt copy to target
We have some code in generic kvm_ppc.c that is only used by 440. Move to
the 440 specific device code.

Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06 09:43:34 +02:00
Anthony Liguori 7267c0947d Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20 23:01:08 -05:00
Blue Swirl a08784dd11 Remove unused sysemu.h include directives
Remove unused sysemu.h include directives to speed up build
with the following patches.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-04-15 18:25:41 +00:00
Scott Wood 64a4d100b5 Don't call cpu_synchronize_state() from machine init.
This will deadlock when the I/O thread is used, since the
CPU thread is blocked waiting for qemu_system_ready.

The synchronization is unnecessary since this is before
cpu_synchronize_all_post_init().

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-08 11:32:20 +02:00
Hollis Blanchard ceee6da6cf ppc4xx: load Bamboo kernel, initrd, and fdt at fixed addresses
We can't use the return value of load_uimage() for the kernel because it
can't account for BSS size, and the PowerPC kernel does not relocate
blobs before zeroing BSS.

Instead, we now load at the fixed addresses chosen by u-boot (the normal
firmware for the board).

Signed-off-by: Hollis Blanchard <hollis@penguinppc.org>
2010-08-26 18:18:26 +02:00
Amit Shah 1e29a009e3 virtio-serial: Fix compat property name
Starting with qemu -M pc-0.12 -device virtio-serial

results in

-device virtio-serial: Property 'virtio-serial-pci.max_nr_ports' not found

The property name 'max_ports' is incorrectly named 'max_nr_ports'. Fix
that.

Also fix the ppc440 machine type bamboo-0.12 which has this typo.

Reported-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-22 05:52:08 +02:00
Aurelien Jarno 409dbce54b load_elf: replace the address addend by a translation function
A few machines need to translate the ELF header addresses into physical
addresses. Currently the only possibility is to add a value to the
addresses.

This patch replaces the addend argument by and a translation function
and an opaque passed to the function. A NULL function does not translate
the address.

The patch also convert all machines that have an addend, simplify the
PowerPC kernel loading and fix the MIPS kernel loading using this new
feature. Other machines may benefit from this feature.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-16 08:38:05 +01:00
Aurelien Jarno 921e169d61 ppc: don't define bamboo-0.13 as the default machine
It has been broken by commit 977b6b91ce.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-08 12:31:27 +01:00
Amit Shah 21be440c6a ppc440_bamboo: Disable new virtio-serial features for 0.12 machine type
Disable the MULTIPORT feature and MSI vectors for the 0.12 machine
types; those features are added only for 0.13 onwards.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-06 22:56:54 +01:00
Amit Shah 977b6b91ce ppc440_bamboo: Add 0.12 and 0.13 machine types for backward compat
Add a 0.12 machine type for compatibility with older versions. Mark the
default one as 0.13.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-06 22:56:53 +01:00
Aurelien Jarno dbf916d85b powerpc: fix compilation with CONFIG_FDT undefined
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-27 19:47:22 +01:00
Liu Yu 04088adbe0 powerpc/booke: move fdt loading to rom infrastructure
It's convinent to use rom to checking overlap, to reset etc.
And uImage and ramdisk loading has already moved to it.

Also, after we add fdt to rom, free it.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-27 16:30:21 +01:00
Liu Yu c49638177f target-ppc: add synchronize register for booke init
So that the following registers init could be flushed back to kvm.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Hollis Blanchard <hollis@penguinppc.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-27 16:21:04 +01: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
Markus Armbruster 07caea315a Fix pci_add nic not to exit on bad model
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() to
create the NIC.  When MODEL is unknown or "?", this prints to stderr
and terminates the program.

Change pci_nic_init() not to treat "?" specially, and to return NULL
on failure.  Switch uses during startup to new convenience wrapper
pci_nic_init_nofail(), which behaves just like pci_nic_init() used to
do.

Bonus bug fix: we now check for qdev_init() failing there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05 09:32:53 -05:00
Anthony Liguori c227f0995e Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.

The naming convention is goofy and it causes a massive merge problem.  Something
like this _must_ be presented on the list first so people can provide input
and cope with it.

This reverts commit 99a0949b72.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01 16:12:16 -05:00
malc 99a0949b72 Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the time
being.

Signed-off-by: malc <av1474@comtv.ru>
2009-10-01 22:45:02 +04:00
Blue Swirl ca20cf32ab Compile loader only once
Callers must pass ELF machine, byte swapping and symbol LSB clearing
information to ELF loader. A.out loader needs page size information, pass
that too as a parameter.

Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw.

Adjust callers. Also use target_phys_addr_t instead of target_ulong for
addresses: loader addresses aren't virtual.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-20 14:58:02 +00:00
Gerd Hoffmann d176c495b6 qdev-ify virtio-blk.
First user of the new drive property.  With this patch applied host
and guest config can be specified separately, like this:

  -drive if=none,id=disk1,file=/path/to/disk.img
  -device virtio-blk-pci,drive=disk1

You can set any property for virtio-blk-pci now.  You can set the pci
address via addr=.  You can switch the device into 0.10 compat mode
using class=0x0180.  As this is per device you can have one 0.10 and one
0.11 virtio block device in a single virtual machine.

Old syntax continues to work.  Internally it does the same as the two
lines above though.  One side effect this has is a different
initialization order, which might result in a different pci address
being assigned by default.

Long term plan here is to have this working for all block devices, i.e.
once all scsi is properly qdev-ified you will be able to do something
like this:

  -drive if=none,id=sda,file=/path/to/disk.img
  -device lsi,id=lsi,addr=<pciaddr>
  -device scsi-disk,drive=sda,bus=lsi.0,lun=<n>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:28 -05:00
Juan Quintela 3f0855b14b Rename HAVE_FDT to CONFIG_FDT and define it also in Makefile
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27 14:09:19 -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
Markus Armbruster c2cc47a449 Support addr=... in option argument of -drive if=virtio
Make drive_init() accept addr=, put the value into struct DriveInfo.
Use it in all the places that create virtio-blk-pci devices:
pc_init1(), bamboo_init(), mpc8544ds_init().

Don't support addr= in third argument of monitor command pci_add and
second argument of drive_add, because that clashes with their first
arguments.  Admittedly unelegant.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-22 10:15:29 -05:00
Markus Armbruster 5607c38820 Support addr=... in option argument of -net nic
Make net_client_init() accept addr=, put the value into struct
NICinfo.  Use it in pci_nic_init(), and remove arguments bus and
devfn.

Don't support addr= in third argument of monitor command pci_add,
because that clashes with its first argument.  Admittedly unelegant.

Machines "malta" and "r2d" have a default NIC with a well-known PCI
address.  Deal with that the same way as the NIC model: make
pci_nic_init() take an optional default to be used when the user
doesn't specify one.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-22 10:15:29 -05:00
Blue Swirl 727170b671 Allow user to specify CPU model
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-17 15:49:37 +00:00
Paul Brook 5cea8590ea Use relative path for bios
Look for bios and other support files relative to qemu binary, rather than
a hardcoded prefix.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-30 01:59:37 +01:00
Anthony Liguori f80f9ec9a6 Convert machine registration to use module init functions
This cleans up quite a lot of #ifdefs, extern variables, and other ugliness.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21 08:47:55 -05:00
Paul Brook 53c25cea7d Separate virtio PCI code
Split the PCI host bindings from the VRing transport implementation.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-18 18:26:33 +01:00
Paul Brook 0e058a8a6a Virtio-console conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-14 22:35:08 +01:00
Paul Brook 07e3af9ac3 Virtio-blk qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-14 22:35:08 +01:00
Paul Brook fbe1b5953d Remove vga_ram_size
The vga_ram_size argument to machine init functions always has the same
value, and is ignored by many machines (including SPARC32 which has an
obsolete ifdef for VGA_RAM_SIZE).

Remove it and push VGA_RAM_SIZE into vga_int.h.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-13 17:56:25 +01:00
pbrook 190cd0215b Remove redundant ram_require machine properly.
Signed-off-by: Paul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7090 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-11 17:33:00 +00:00
pbrook 7ec632b45c Wean device tree code off phys_ram_base.
Signed-off-by: Paul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7068 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-10 16:23:59 +00:00
pbrook dcac9679fe Use load_image_targphys and avoid phys_ram_base.
Signed-off-by: Paul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7056 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-09 20:05:49 +00:00
aliguori 487414f1cb hw: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-05 22:06:05 +00:00
blueswir1 a147d62bf9 Fix warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6346 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-16 19:41:04 +00:00
aliguori 5fc1503efc add virtio-console initializer for powerpc (Christian Ehrhardt)
This adds an intialization of virtio console for powerpc.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6319 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-15 20:08:19 +00:00
aliguori cb457d7679 Make pci_nic_init() use qemu_setup_nic_model() (Mark McLoughlin)
Add a table of PCI NIC models to pass to qemu_setup_nic_model().

While we're at it, also add a corresponding table of NIC init
functions.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6287 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-13 19:47:10 +00:00
aurel32 2c9fade200 target-ppc: IBM PowerPC 440EP Bamboo reference board emulation
Since most IO devices are integrated into the 440EP chip, "Bamboo support"
mostly entails implementing the -kernel, -initrd, and -append options.

These options are implemented by loading the guest as if u-boot had done it,
i.e. loading a flat device tree, updating it to hold initrd addresses, ram
size, and command line, and passing the FDT address in r3.

Since we use it with KVM, we enable the virtio block driver and include hooks
necessary for KVM support.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6067 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-16 10:44:14 +00:00