Commit Graph

9595 Commits

Author SHA1 Message Date
Magnus Damm b4e1f07747 sh4 disasm fixes
Add the sh4 target to the monitor disassembly function,
and remove a duplicate "0x" printout from the sh4 dis-
assembly code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 01:19:12 +01:00
Magnus Damm b785e4768b tcg/i386: remove duplicate sar opcode
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 01:17:47 +01:00
Stefan Weil 91011d4f3b pci: Fix function pci_default_write_config
Change 260c0cd3d9
(pci: use range helper functions) introduced a
bug which made pci cirrus vga on mips malta
(and maybe other pci devices) fail.

Don't change addr - its original value is needed
by ranges_overlap() and range_covers().

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 01:14:26 +01:00
Aurelien Jarno e16ad5b044 mips: fix CPU reset
Don't load the kernel twice during reset.
See f2d7497876.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 01:11:27 +01:00
Blue Swirl bc90ff7742 Fix PPC crash
Because of a typo, structure field vga_bios_size was not initialized
properly and a bogus BAR6 for the nonexistent VGA BIOS appeared.

The bug was uncovered by c169998802.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-13 19:00:11 +00:00
Paul Brook c988bfadc9 ARM MPCore tweaks
Allow the user to specify the number of cores present on the
RealView EB + ARM11MPCore board.  Also split into its own config
rather than guessing from the CPU name.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-13 04:31:22 +00:00
Paul Brook 26e92f6552 Realview/EB procid hacks
Guess core tile ID based on CPU type.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-13 04:04:18 +00:00
Juan Quintela dbe73d7f3b pci: fix the conversion of config field from array to pointer
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:57 -06:00
Juan Quintela 504c2948d3 qemu_system_reset: we need to call it before loadvm/migration
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
Juan Quintela 2966b390d0 fdc: fix vmstate variable passed
When code was transformed to use qdev_reset/vmstate registration, vmstate
was passed a variable of the wrong type

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
Gerd Hoffmann 6b1325029d vnc: improve capslock handling.
When capslock is toggled while the vnc window hasn't the focus qemu
will miss the state change.  Add sanity checks for the capslock state
and toggle it if needed, so hosts and guests idea of capslock state
stay in sync.  Simliar logic for numlock is present in qemu already.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
Kay Ackermann a00b233528 e1000 fix: read access to some registers is missing.
While writing working on an e1000 driver for my university's OS I
noticed that some registers aren't readable in QEMU, but they should
be readable as stated in Intels Driver Developer Manual (and also
verified on real hardware).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
David Woodhouse c34d2451ed Fix 32-bit overflow in parallels image support
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
Hollis Blanchard 812151f290 kvm ppc: Remove unused label
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Hollis Blanchard 9bdbe550f0 kvm: Move KVM mp_state accessors to i386-specific code
Unbreaks PowerPC and S390 KVM builds.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Kevin Wolf 49c3c8dca7 virtio-blk: Pass read errors to the guest
We need to signal not only write errors, but also read errors to the guest
driver. This fixes a regression introduced by 869a5c6d.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Kevin Wolf cb499fb295 savevm: Delete existing snapshots in all images
When creating a snapshot we can run into the situation that the first disk
doesn't have a snapshot, but the second one does have one with the same name as
the new snapshot.

In this case, qemu doesn't recognize that there is a snapshot to be
overwritten, so it starts to save the new snapshot and errors out later when it
tries to snapshot the second image. With this patch, snapshots on secondary
images are overwritten just like on the first image.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Juan Quintela 14f26b00d1 Fix incoming migration
commit b04c4134d6
broke incoming migration.  After talking with Gleb, code was intended
to be the way is in this fix.  This fixes migration here.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Juan Quintela ef2fad6592 fix type in CFLAGS name
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Juan Quintela f527c57935 fix parallel build
Based on a ideas of Daniel Jacobowitz + Stefan Weil

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:54 -06:00
Amit Shah 593831de5d qdev: Check if unplug handler exists before calling it
A bus may have hotplugging enabled but not have the 'unplug'
callback defined, which would lead to a crash on trying to
unplug a device on the bus.

Fix by introducing an assert to check if the callback is valid.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:54 -06:00
Stefan Weil 88e2b0a5fd Makefile: Fix definition of pxe-*.bin blobs
* Remove 2nd entry for pxe-pcnet.bin.
  This kind of error can be avoided by sorting
  entries. So all pxe-*.bin entries are now sorted
  alphabetically.
* Rename pxe-eepro100.bin -> pxe-i82559er.bin.
  This change completes another patch which did
  the rename on the pxe image for i82559er.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:54 -06:00
Stefan Weil 6a90e30800 eepro100: Add missing .exit initialisation
Some devices did not have an initialisation value
for entry ".exit". This is fixed here.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:54 -06:00
Stefan Weil 4e9df06acc eepro100: Fix boot ROM support
* Rename pxe-eepro100.bin to pxe-i82559er.bin.
  The other devices supported by eepro100.c need
  additional pxe boot ROM images.
* Call rom_add_option during initialisation.
  The code won't work with two or more different
  eepro100 devices, because it only adds one option
  ROM, but this use case is perhaps never needed.

Using this patch, model=i82559er at least works partially.
For full support, more eepro100 patches are needed
(will follow later, can be fetched from ar7 branch
of QEMU).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:54 -06:00
Stefan Weil 1bb62099bf Makefile: Prettify logging
Replace
	GEN  config-all-devices.mak
by
	GEN   config-all-devices.mak

Like this, the logging output is column aligned.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:53 -06:00
Stefan Weil 038eaf82c8 serial: Add interface to set reference oscillator frequency
Many (most?) serial interfaces have a programmable
clock which provides the reference frequency ("baudbase").
So a fixed baudbase which is only set once can be wrong.

omap1.c is an example which could use the new interface
to change baudbase when the programmable clock changes.
ar7 system emulation (still not part of standard QEMU)
is similar to omap and already uses serial_set_frequency.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:53 -06:00
Edgar E. Iglesias ba6d048aad microblaze: Move the kcmdline out of the way.
Avoids rom overlap conflicts.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-11-12 02:15:20 +01:00
Edgar E. Iglesias 95b279de95 microblaze: Restore env when raising unmapped bus access.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-11-12 02:14:45 +01:00
Edgar E. Iglesias 4898427ec8 microblaze: Unbreak reset.
Initialize synthesis config registers at reset to cope with the new
cpu_reset sequences.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-11-12 02:12:44 +01:00
Paul Brook be0f204aa0 Fix ARM MCore secondary cpu boot
Make MPCore secondary cpu initialization work with the new reset
handling.  Also change the inital FLAG value from 3 to zero to match
recent kenrels.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-11 19:59:29 +00:00
Paul Brook 97fe84f5ef Reject late rom loading
rom_+add_file/rom_add_blob only work correctly if called before
load_all_roms.  Enforce this rather than silently accepting and putting
the rom in the wrong place at reset.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-11 18:21:20 +00:00
Paul Brook f2d7497876 Fix ARM system emulation
Since 45a50b1 load_image_targphys should only be called once.
ARM boards incorrectly call it every time the system is reset.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-11 18:07:53 +00:00
Gerd Hoffmann 715a664ac4 QemuOpts: command line switches for the config file.
Adds -readconfig and -writeconfig command line switches to read/write
QemuOpts from config file.

In theory you should be able to do:

  qemu < machine config cmd line switches here > -writeconfig vm.cfg
  qemu -readconfig vm.cfg

In practice it will not work.  Not all command line switches are
converted to QemuOpts, so you'll have to keep the not-yet converted ones
on the second line.  Also there might be bugs lurking which prevent even
the converted ones from working correctly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:13 -06:00
Gerd Hoffmann 42262ba860 QemuOpts: parse config from file.
Add functions to parse QemuOpts from a git-style config file.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:13 -06:00
Gerd Hoffmann 9d993394a1 QemuOpts: dump config.
Add a function to write the QemuOpts configuration to a git-style
config file.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:13 -06:00
Gerd Hoffmann ddc978550d QemuOpts: add find_list()
Factor out the QemuOptsList search code for upcoming users.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:12 -06:00
Kevin Wolf 3e03236438 Documentation: Add options to image format descriptions
Explain the existing format specific options that can be used with qemu-img
create/convert -o ...

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:12 -06:00
Kevin Wolf 8063d0fe3b Documentation: Don't mention old qemu-img options
The old options are still supported for compatibility, but they are
inconsistent (for example create -b vs. convert -B for backing files) and
incomplete (-F only exists for create) which tends to confuse people. Remove
all references to the old options from the documentation to guide users to the
more consistent -o options.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:12 -06:00
Kevin Wolf f932c04039 Documentation: Move image format descriptions to own section
The description of the image formats is too long to be a subitem of a parameter
description. It will become even longer when we include the options provided by
the respective format.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:12 -06:00
Matthew Booth 7273a2dbcc Documentation: Add documentation for -chardev
Adds documentation for all -chardev backends.

Signed-off-by: Matthew Booth <mbooth@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:12 -06:00
Naphtali Sprei eeb4a3bae0 Added imlpementation for qemu_error for non-qemu executables
Now qemu_error can be called also from shared files, e.g. block.c.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:12 -06:00
Stefan Weil ba42b6467b eepro100: Improve support for different devices
* Add device properties (size of statistical data,
  extended tcb support) to EEPRO100State and set
  these values for the different devices.

* Fix PCI configuration for existing devices.

* Add initialisation code for missing devices.

* Remove function device_supports_eTxCB.
  It is no longer needed.

* Fix dump of statistical data. It now respects
  the real size of the statistical data.
  An endianess issue was fixed here, too.

* CU_SHOWSTATS, CU_DUMPSTATS now write a
  completion value after the statistical data.
  There is no need to keep this value in
  eepro100_stats_t, so member "complete"
  could be removed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:11 -06:00
Isaku Yamahata b4dccd8db4 pci/monitor: print out bridge's filtering values and so on.
make pci_info_device() print out bridge's filtering value like
io base/limit, subbus and subordinate bus.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:10 -06:00
Isaku Yamahata a0c7a97ea7 pci: implement pci bridge filtering.
This patch implements pci bridge filtering.

TODO: currently almost all the map funcions assumes
filtered_size == size and addr & ~(size - 1) == addr.
However with bridge filtering, they aren't always true.
Teach them such cases, such that filtered_size < size and
addr & (size - 1) != 0.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:10 -06:00
Isaku Yamahata 1074df4f29 pci: factor out pci_for_each_device().
split out device iteration logic from pci_for_each_device().
factored out function, pci_for_each_device_under_bus() will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:10 -06:00
Isaku Yamahata a968857067 pci: cosmetic on pci_upadte_mappings()
Remove one indentation of pci_update_mappings.
Just for cosmetics, no logic change.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:10 -06:00
Isaku Yamahata fb23162885 pci: initialize pci config headers depending it pci header type.
- Only sets default subsystem id for header type 00.(normal header type)
  because header type 01 doesn't have subsystem id, and uses the register
  for other purpose. So setting default subsystem id doesn't make sense.

- initialize wmask more for header type 01.(bridge header type)
  Without those wmasks, linux was confused not boot,
  and lspci was confused not to print out expected IO/memory range.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:10 -06:00
Isaku Yamahata edb000350d pci: teach pci_default_config_write() ROM bar for normal/bridge device .
When updated ROM expantion address of header type 0, it missed
to update mappings.
Add PCI_ROM_ADDRESS check whether to call pci_update_mappings()
Also update pci mapping when PCI_ROM_ADDRESS1 is written for header type 1.

pci_update_mapping() path isn't performance critical,
so call it even independent of header type.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:10 -06:00
Isaku Yamahata 260c0cd3d9 pci: use range helper functions.
clean up pci_default_write_config() by the range helper functions.

Suggested by Michael S. Tsirkin <mst@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:10 -06:00
Isaku Yamahata f49db805a9 pci: add helper functions to check ranges overlap.
add helper function to check ranges overlap suggested by
Michael S. Tsirkin <mst@redhat.com>.
His original suggestion was to use [first, last], however I chosen
to use offset, length pair, i.e. [offset, offset + length)
because pci configuration space related functions all uses offset and length
pair, so it helps to avoid to type constant twice.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:09 -06:00