Commit Graph

4871 Commits

Author SHA1 Message Date
Anthony PERARD 29d3ccde82 xen: Add xenfv machine
Introduce the Xen FV (Fully Virtualized) machine to Qemu, some more Xen
specific call will be added in further patches.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08 10:10:00 +02:00
Anthony PERARD e0e7e67b45 pc_memory_init: Move memory calculation to the caller.
This patch moves above_4g_mem_size and below_4g_mem_size calculation in
the caller of pc_memory_init (pc_init1). And the prototype of
pc_memory_init is changed because there is no need anymore to have
variable pointer and the ram_size parameter.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08 10:10:00 +02:00
Anthony PERARD 3285cf4fe7 xen: Add initialisation of Xen
The xenpv machine use the common init function.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08 10:10:00 +02:00
Anthony PERARD d5b93ddfef xen: Support new libxc calls from xen unstable.
This patch updates the libxenctrl calls in Qemu to use the new interface,
otherwise Qemu wouldn't be able to build against new versions of the
library.

We check libxenctrl version in configure, from Xen 3.3.0 to Xen
unstable.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08 10:09:59 +02:00
Anthony PERARD 209cd7abe2 xen: Replace some tab-indents with spaces (clean-up).
And put braces for blocks with a single statement.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08 10:09:59 +02:00
Anthony PERARD 67b724e69e machine, Add default_machine_opts to QEMUMachine.
With this new field, we can specified which accelerator use to run the
machine, if the accelerator is not already specified by either a
configuration file or the command line options.

Currently, the only use will be made in the xenfv machine.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-05-08 10:09:59 +02:00
Stefan Weil ebabb67a17 Fix typo in code and comments
Replace writeable -> writable

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-05-06 08:19:25 +01:00
Anthony Liguori 3964f535c3 Merge remote-tracking branch 'mst/for_anthony' into staging 2011-05-05 13:05:32 -05:00
Anthony Liguori a69fb35079 Merge remote-tracking branch 'kraxel/usb.7.pull' into staging 2011-05-05 13:04:57 -05:00
Michael S. Tsirkin 5300f1a548 Merge remote branch 'origin/master' into pci
Conflicts:
	exec.c
2011-05-05 16:39:47 +03:00
Jan Kiszka 602ef4d917 pci: Add class 0x403 as 'audio controller'
Used by HD audio controllers like our intel-hda.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 16:11:20 +03:00
Jan Kiszka 45fe15c25a MSI: Robust resource release
msi_init may fail, so we need to check on uninit if the cap was
actually installed. This also avoids that the users need to check.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 16:10:08 +03:00
Stefan Weil 072476ea08 eepro100: Support 32 bit read/write access to flash register
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 16:05:43 +03:00
Stefan Weil a39bd01713 eepro100: Support byte read access to general control register
The general control register is a byte register.
Add support for byte reads.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 16:05:43 +03:00
Stefan Weil 0113f48df6 eepro100: Support byte/word read/write access to MDI control register
MDI control is a 32 bit register, but may be read or written using
8 or 16 bit access. Data is latched when the MSB is written.

Add support for byte/word read/write access.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 16:05:43 +03:00
Stefan Weil 27a05006e0 eepro100: Support byte/word writes to pointer register
pointer is a 32 bit register, but may be written using 8 or 16 bit writes.
Add support for byte/word writes.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 16:05:43 +03:00
Stefan Weil 3fd3d0b463 eepro100: Support byte/word writes to port address
port is a 32 bit register, but may be written using 8 or 16 bit writes.
Add support for byte/word writes.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 16:05:42 +03:00
Stefan Weil e5e23ab83b eepro100: Fix endianness issues
Like other Intel devices, e100 (eepro100) uses little endian byte order.

This patch was tested with these combinations:

i386 host, i386 + mipsel guests (le-le)
mipsel host, i386 guest (le-le)
i386 host, mips + ppc guests (le-be)
mips host, i386 guest (be-le)

mips and mipsel hosts were emulated machines.

v2:
Use prefix for new functions. Add the same prefix to stl_le_phys.
Fix alignment of mem (needed for word/dword reads/writes).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 16:05:42 +03:00
Stefan Weil 792f1d6394 eepro100: Pad received short frames
QEMU sends frames smaller than 60 bytes to ethernet nics.
Such frames are rejected by real NICs and their emulations.
To avoid this behaviour, other NIC emulations pad received
frames. This patch enables this workaround for eepro100, too.

All related code is marked with CONFIG_PAD_RECEIVED_FRAMES,
so we can drop this in case QEMU's networking code is
ever changed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 16:04:45 +03:00
Stefan Weil 27112f18f9 eepro100: Remove unused structure element
cppcheck reports that 'packet' is unused.

It was only used to calculate the size of the preceding data.
Removing it saves a lot of stack space (local variable rx).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 15:50:04 +03:00
Stefan Weil 77bee84e6a eepro100: Remove type casts which are no longer needed
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 15:50:01 +03:00
Stefan Weil 1b4f97d62e eepro100: Avoid duplicate debug messages
When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice.
Now logging in eepro100_write1 and eepro100_write2 is similar to the
logging in eepro100_write4 (which already was correct).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05 15:49:58 +03:00
Gerd Hoffmann ef0bdf77d7 usb: mass storage fix
Initialize scsi_len with zero when starting a new request, so any
stuff leftover from the previous request is cleared out.  This may
happen in case the data returned by the scsi command doesn't fit
into the buffer provided by the guest.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-04 16:55:15 +02:00
Gerd Hoffmann 13a9a0d3e2 usb: move complete callback to port ops 2011-05-04 14:11:08 +02:00
Gerd Hoffmann 5dc1672b27 musb: get musb state via container_of() 2011-05-04 14:11:08 +02:00
Gerd Hoffmann 9066df13a3 ohci: get ohci state via container_of()
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-04 14:11:08 +02:00
Gerd Hoffmann 7b5a44c546 uhci: keep uhci state pointer in async packet struct.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-04 14:11:08 +02:00
Gerd Hoffmann ddf6583f88 uhci: switch to QTAILQ 2011-05-04 14:11:08 +02:00
Hans de Goede 19f3322379 usb: control buffer fixes
Windows allows control transfers to pass up to 4k of data, so raise our
control buffer size to 4k. For control out transfers the usb core code copies
the control request data to a buffer before calling the device's handle_control
callback. Add a check for overflowing the buffer before copying the data.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-05-04 12:25:52 +02:00
Gerd Hoffmann 196a778428 spice: drop obsolete iothread locking
We don't use qemu internals from spice server context any more.
Thus we don't also need to grab the iothread mutex from spice
server context.  And we don't have to temporarely release the
lock to avoid deadlocks.  Drop all the calls.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03 15:35:48 +02:00
Gerd Hoffmann 0753609458 spice: don't call displaystate callbacks from spice server context.
This patch moves the displaystate callback calls for setting the cursor
and the mouse pointer from spice server to qemu (iothread) context.
This allows us to simplify locking.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03 15:35:48 +02:00
Gerd Hoffmann e0c64d08d1 spice: don't create updates in spice server context.
This patch moves the creation of spice screen updates from the spice
server context to qemu iothread context (display refresh timer to be
exact).  This way we avoid accessing qemu internals (display surface)
from spice thread context which in turn allows us to simplify locking.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03 15:35:48 +02:00
Alon Levy ab71982716 ide/atapi: fix set but unused
Signed-off-by: Alon Levy <alevy@redhat.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-05-03 11:29:21 +02:00
Amit Shah 4a737d14d0 atapi: Explain why we need a 'media not present' state
After the re-org of the atapi code, it might not be intuitive for a
reader of the code to understand why we're inserting a 'media not
present' state between cd changes.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-05-03 11:29:21 +02:00
Amit Shah a7acf552e2 atapi: Move comment to proper place
Move misplaced comment for media_is_dvd()

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-05-03 11:29:21 +02:00
Michael Walle 57aa265d46 lm32: add Milkymist Minimac2 support
This patch adds support for Milkymist's minimal Ethernet MAC v2. It
superseds minimac1.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-05-03 10:48:40 +02:00
Michael Walle f3172a0e2e milkymist-sysctl: fix timers
Prevent timers from firing right after starting.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-05-03 10:48:40 +02:00
Michael Walle c07050ddb9 milkymist-vgafb: fix console resizing
After enabling the framebuffer, ensure that the console is resized.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-05-03 10:48:40 +02:00
Glauber Costa 450fb75c47 kvm: create kvmclock when one of the flags are present
kvmclock presence can be signalled by two different flags. So for
device creation, we have to test for both.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-05-02 09:38:35 -03:00
Anthony Liguori 71ef18e1f2 Merge remote-tracking branch 'amitshah/for-anthony' into staging 2011-04-28 08:37:54 -05:00
Anthony Liguori e77976a247 Merge remote-tracking branch 'jvrao/for-anthony' into staging 2011-04-28 08:25:45 -05:00
Alexey Kardashevskiy 5c1c9bb24b virtio-serial: Fix endianness bug in the config space
The virtio serial specification requres that the values in the config
space are encoded in native endian of the guest.

The qemu virtio-serial code did not do conversion to the guest endian
format what caused problems when host and guest use different format.

This patch corrects the qemu side, correctly doing host-native <->
guest-native conversions when accessing the config space. This won't
break any setups that aren't already broken, and fixes the case
of different host and guest endianness.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-04-28 12:35:49 +05:30
Kusanagi Kouichi d5b27167e1 char: Allow devices to use a single multiplexed chardev.
This fixes regression caused by commit
2d6c1ef40f
("char: Prevent multiple devices opening same chardev"):

-nodefaults -nographic -chardev stdio,id=stdio,mux=on,signal=off \
 -mon stdio -device virtio-serial-pci \
 -device virtconsole,chardev=stdio -device isa-serial,chardev=stdio

fails with:

qemu-system-x86_64: -device isa-serial,chardev=stdio: Property 'isa-serial.chardev' can't take value 'stdio', it's in use

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-04-28 11:03:07 +05:30
Hans de Goede 0b6d2266e3 virtio-console: notify backend of guest open / close
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-04-28 11:02:28 +05:30
Jan Kiszka 47f7be394a ioapic: Do not set irr for masked edge IRQs
So far we set IRR for edge IRQs even if the pin is masked. If the guest
later on unmasks and switches the pin to level-triggered mode, irr will
remain set, causing an IRQ storm. The point is that setting IRR is not
correct in this case according to the spec, and avoiding this resolves
the issue.

Reported-and-tested-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-27 20:04:51 +02:00
Harsh Prateek Bora 4f8dee2dec v9fs_walk: As per 9p2000 RFC, MAXWELEM >= nwnames >= 0.
The nwnames field in TWALK message is assumed to be >=0 and <= MAXWELEM
which is defined as macro P9_MAXWELEM (16) in virtio-9p.h as per 9p2000
RFC. Appropriate changes are required in V9fsWalkState and v9fs_walk.

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
2011-04-27 08:27:25 -07:00
Harsh Prateek Bora f35bde2f8f hw/virtio-9p-local.c: Remove unnecessary null char in symlink file
This patch removes the addition of null char in symlink file
which is being appended to file in case of mapped security model.
Without this patch, the extra null char causes LTP testcase lstat03
to fail and hence this fix is required.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
2011-04-27 08:27:01 -07:00
M. Mohan Kumar 1d810aeb4e virtio-9p: Bugfix to send correct iounit
LCREATE function packs address of iounit in the pdu, fix that to send
actual iounit itself.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
2011-04-27 08:26:29 -07:00
Aneesh Kumar K.V a09947617c virtio-9p: removexattr on default acl should return 0
If we don't have default acl, removexattr on default acl
should return 0

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
2011-04-27 08:26:05 -07:00
Aneesh Kumar K.V 3979251518 virtio-9p: Print the pdu details on return
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
2011-04-27 08:25:35 -07:00
Aneesh Kumar K.V 353ac78d49 virtio-9p: move 9p files around
Now that we start adding more files related to 9pfs
it make sense to move them to a separate directory

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
2011-04-27 08:24:37 -07:00
Jan Kiszka 661bfc80e8 pflash: Restore & fix lazy ROMD switching
Commit 5145b3d1cc revealed a bug in the lazy ROMD switch-back logic, but
resolved it by breaking that feature. This approach addresses the issue
by switching back to ROMD after a certain amount of read accesses
without further unlock sequences.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-27 16:31:12 +02:00
Aurelien Jarno aa348082d8 Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
* 'for-anthony' of git://repo.or.cz/qemu/kevin:
  Remove obsolete 'enabled' variable from progress state
  Add dd-style SIGUSR1 progress reporting
  qed: Fix consistency check on 32-bit hosts
  ide/atapi: Introduce CHECK_READY flag for commands
  ide/atapi: Replace bdrv_get_geometry calls by s->nb_sectors
  ide/atapi: Use table instead of switch for commands
  ide/atapi: Factor commands out
  ide: Split atapi.c out
  Improve accuracy of block migration bandwidth calculation
  atapi: Add 'medium ready' to 'medium not ready' transition on cd change
  qemu-img: allow rebase to a NULL backing file when unsafe
2011-04-27 16:26:18 +02:00
Stefan Weil c6a0487b1f rtl8139: Fix compilation for w32/w64
Compilation for Windows needs a different declaration for the
printf format attribute, so use the macro which was defined for
this purpose.

Cc: Benjamin Poirier <benjamin.poirier@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-27 16:22:37 +02:00
Kevin Wolf 7a2c4b8234 ide/atapi: Introduce CHECK_READY flag for commands
Some commands are supposed to report a Not Ready Condition (i.e. they require
a medium to be present in order to execute successfully). Instead of
duplicating the check in each command implementation, let's add a flag and
check it before calling the command.

This patch only converts existing checks, it does not introduce new checks for
any of the other commands that can/should report a Not Ready Condition.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-27 16:21:00 +02:00
Kevin Wolf e119bcaceb ide/atapi: Replace bdrv_get_geometry calls by s->nb_sectors
The disk size can only change when the medium is changed, and the change
callback takes care of updating s->nb_sectors in this case.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-27 16:20:59 +02:00
Kevin Wolf e1a064f982 ide/atapi: Use table instead of switch for commands
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-27 16:20:59 +02:00
Kevin Wolf a60cf7e7eb ide/atapi: Factor commands out
In preparation for a table of function pointers, factor each command out from
ide_atapi_cmd() into its own function.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-27 16:20:59 +02:00
Kevin Wolf 33231e0e22 ide: Split atapi.c out
Besides moving code, this patch only fixes some whitespace issues in the moved
code and makes all functions in atapi.c static which can be static.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-27 16:20:27 +02:00
Amit Shah 4b9b7092b4 atapi: Add 'medium ready' to 'medium not ready' transition on cd change
MMC-5 Table F.1 lists errors that can be thrown for the TEST_UNIT_READY
command.  Going from medium not ready to medium ready states is
communicated by throwing an error.

This adds the missing 'tray opened' event that we fail to report to
guests.  After doing this, older Linux guests properly revalidate a disc
on the change command.  HSM violation errors, which caused Linux guests
to do a soft-reset of the link, also go away:

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
sr 1:0:0:0: CDB: Test Unit Ready: 00 00 00 00 00 00
ata2.00: cmd a0/00:00:00:00:00/00:00:00:00:00/a0 tag 0
         res 01/60:00:00:00:00/00:00:00:00:00/a0 Emask 0x3 (HSM violation)
ata2.00: status: { ERR }
ata2: soft resetting link
ata2.00: configured for MWDMA2
ata2: EH complete

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-27 14:36:57 +02:00
Stefan Hajnoczi b4548fcc03 trace: Remove %s in grlib trace events
Trace events cannot use %s in their format strings because trace
backends vary in how they can deference pointers (if at all).  Recording
const char * values is not meaningful if their contents are not recorded
too.

Change grlib trace events that rely on strings so that they communicate
similar information without using strings.

A follow-up patch explains this limitation and updates docs/tracing.txt.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-26 13:14:49 +01:00
Benjamin Poirier ec48c7747a rtl8139: add format attribute to DPRINTF
gcc can check the format string for correctness even when debugging output is
not enabled.
Have to make sure arguments are always available. They are optimized out if
unneeded.

Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25 22:17:56 +02:00
Benjamin Poirier 7cdeb319e4 rtl8139: use variadic macro for debug statements
Removes double (( )) to make DEBUG_PRINT compatible with real function calls.
Change the name to DPRINTF to be consistent with other DPRINTF macros
throughout qemu.
Include the "RTL8139: " prefix in the macro. This changes some debug output
slightly since the prefix wasn't present on all lines.

Part of the change was done using the "coccinelle" tool with the following
small semantic match:
    @@ expression E; @@

    - DEBUG_PRINT((E))
    + DPRINTF(E)

Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25 22:17:52 +02:00
Benjamin Poirier afcd9c0dcd rtl8139: use TARGET_FMT_plx in debug messages
Prevents a compilation failure when DEBUG_RTL8139 is defined:

CC    libhw32/rtl8139.o
cc1: warnings being treated as errors
hw/rtl8139.c: In function ‘rtl8139_cplus_transmit_one’:
hw/rtl8139.c:1960: error: format ‘%8lx’ expects type ‘long unsigned int’, but argument 5 has type ‘target_phys_addr_t’
make[1]: *** [rtl8139.o] Error 1

Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-25 22:17:47 +02:00
Anthony Liguori dbf352ad6e Merge remote-tracking branch 'awilliam/ipxe' into staging 2011-04-25 10:26:10 -05:00
Juan Quintela da26fdc314 vmstate: port mac_dbdma
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela c20df14b13 mac_dbdma: create DBDMAState instead of passing one array around
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 9039d78e64 vmstate: port piix4
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 1fc7cee0b4 piix4: create PIIX4State
It only contains a PCIDevice by know, but it makes easy to use migration code

Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 8e470f8a77 vmstate: port mac_nvram
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 8a11f43bd5 mac_nvram: size is a size, no need to be a target dependent type
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 7b9a3d86c1 vmstate: port nand
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 51db57f7e8 nand: pin values are uint8_t
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 38cb3aa9b4 vmstate: port max111x
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 54d970d134 max111x: input field is only used as uint8_t
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 99838363ba vmstate: port pxa2xx_lcd
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 469954090f pxa2xx_lcd: up field is used as a bool and migrated as an uint8_t
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela 2b7251e0f2 pxa2xx_lcd: name anonymous struct
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:43 -05:00
Juan Quintela dd8a4dcda4 vmstate: stellaris use unused for placeholder entries
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:42 -05:00
Juan Quintela 4483c7ac31 vmstate: port stellaris gamepad
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:42 -05:00
Juan Quintela 0c067bbb26 vmstate: port syborg_keyboard
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:42 -05:00
Juan Quintela 8dc5907090 vmstate: port syborg_serial
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:42 -05:00
Juan Quintela cf1d31dc5c vmstate: port stellaris_adc
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:42 -05:00
Juan Quintela 80a526802c vmstate: port syborg_pointer
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:42 -05:00
Juan Quintela b605f22212 vmstate: port ppc4xx_pci
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:42 -05:00
Juan Quintela e0433ecc6e vmstate: port ppce500_pci
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela f0ab24ce69 vmstate: port pxa2xx_pm
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela d102d49545 vmstate: port pxa2xx_mm
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela ae1f90de06 vmstate: port pxa2xx_cm
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela 9f5dfe298b vmstate: port pxa2xx_i2s
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela 10f85a2934 vmstate: port stellaris gptm
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela c0a93a9efa vmstate: port cuda
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela 4acd38cef0 vmstate: port heathrow_pic
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela 075790c2c2 vmstate: port pl022 ssp
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela 293c16aa37 vmstate: port stellaris sys
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela a4dec1d0d4 vmstate: port stellaris ssi bus
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela ff269cd041 vmstate: port stellaris i2c
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela 0797226c56 vmstate: port armv7m nvic
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela 02b6875795 vmstate: port pl011
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:41 -05:00
Juan Quintela 25f5a1b7df vmstate: port pxa2xx_keypad
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela 4ba673ce62 vmstate: port syborg_rtc
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela 852f771ec9 vmstate: port pmtimer
It was a half conversion.  Finish it.
enabled can only get values of 0, 1 or 2, was declared as an int but
sent as an unint8_t, change its type.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela 22a3faf507 vmstate: port sysborg_timer
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela eecd33a578 vmstate: port arm_timer
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela 81986ac4b6 vmstate: port arm sp804
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela c7298ab251 vmstate: port mipsnet
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela fd484ae494 vmstate: port m48t59
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela aefe212931 vmstate: port ads7846
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela 2b2cd5928d vmstate: port adb_mouse
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Juan Quintela 1f1f0600aa vmstate: port adb_kbd
Signed-off-by: Juan Quintela <quintela@redhat.com>
2011-04-22 14:41:40 -05:00
Peter Maydell 756ba3b012 hw/arm_boot.c: move initrd load address up to accommodate large kernels
Newer kernels are large enough that they can overlap the address
where qemu places the initrd. Move the initrd up so that there is
enough space for the kernel again.

Unfortunately it's not possible to automatically determine the
size of the kernel if it is compressed, so this is the best we
can do.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-20 13:01:04 +02:00
Dmitry Eremin-Solenikov c64b21d519 Basic implementation of Sharp Zaurus SL-5500 collie PDA
Add very basic implementation of collie PDA emulation. The system lacks
LoCoMo and graphics/sound emulation. Linux kernel boots up to mounting
rootfs (theoretically it can be provided in pflash images).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-20 12:59:15 +02:00
Dmitry Eremin-Solenikov 5bc95aa246 Implement basic part of SA-1110/SA-1100
Basic implementation of DEC/Intel SA-1100/SA-1110 chips emulation.
Implemented:
 - IRQs
 - GPIO
 - PPC
 - RTC
 - UARTs (no IrDA/etc.)
 - OST reused from pxa25x

Everything else is TODO (esp. PM/idle/sleep!) - see the todo in the
hw/strongarm.c

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-20 12:59:15 +02:00
Alexander Graf 8d5192ee15 s390x: virtio machine storage keys
For emulation (and migration) we need to know about the guest's storage keys.
These are separate from actual RAM contents, so we need to allocate them in
parallel to RAM.

While touching the file, this patch also adjusts the hypercall function
to a new syntax that aligns better with tcg emulated code.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-18 21:01:54 +02:00
Alexander Graf 8103b4d161 s390x: Dispatch interrupts to KVM or the real CPU
The KVM interrupt injection path is non-generic for now. So we need to push
knowledge of how to inject a device interrupt using KVM into the actual device
code.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-18 21:00:27 +02:00
Alexander Graf bcec36eaa0 s390x: Prepare cpu.h for emulation
We need to add some more logic to the CPU description to leverage emulation
of an s390x CPU. This patch adds all the required helpers, fields in CPUState
and constant definitions required for user and system emulation.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-18 20:51:55 +02:00
Alex Williamson 5ee8ad71e1 PXE: Use consistent naming for PXE ROMs
And add missing ROMs to tarbin build target.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2011-04-18 11:46:01 -06:00
Brad Hards 94843f66ab usb: trivial spelling fixes
Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-16 12:24:28 +01:00
Blue Swirl d8dfad9c41 Use qemu-common.h or qemu-timer.h in place of sysemu.h
In some cases qemu-common.h or qemu-timer.h can be used in place
of sysemu.h.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-04-15 18:25:44 +00: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
Stefan Weil 1a00282a73 sparc: Fix assertion caused by empty memory slot with 0 byte
If the memory size given on the command line is equal to the
maximum size of memory defined by the hardware, there is no
"empty slot" after physical memory.

The following command

		qemu-system-sparc -m 256

raised an assertion:
exec.c:2614: cpu_register_physical_memory_offset: Assertion `size' failed

This can be fixed either at the caller side (don't call empty_slot_init)
or in empty_slot_init (do nothing) when size == 0. The second solution
was choosen here because it is more robust.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
2011-04-15 18:16:34 +00:00
Anthony Liguori 7f7454ec29 lm32: fix build breakage due to uninitialized variable 'r'
gcc 4.5.2 correctly complains that r is potentially uninitialized in this
function.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-04-13 07:41:19 -05:00
Amit Shah 996faf1ad4 atapi: GESN: implement 'media' subcommand
Implement the 'media' sub-command of the GET_EVENT_STATUS_NOTIFICATION
command.  This helps us report tray open, tray closed, no media, media
present states to the guest.

Newer Linux kernels (2.6.38+) rely on this command to revalidate discs
after media change.

This patch also sends out tray open/closed status to the guest driver
when requested e.g. via the CDROM_DRIVE_STATUS ioctl (thanks Markus).
Without such notification, the guest and qemu's tray open/close status
was frequently out of sync, causing installers like Anaconda detecting
no disc instead of tray open, confusing them terribly.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13 12:20:42 +02:00
Amit Shah 0af63ba362 atapi: GESN: Standardise event response handling for future additions
Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available response in a
generic way so that future additions to the code to handle other
response types is easier.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13 12:20:39 +02:00
Amit Shah 8f8e834d70 atapi: GESN: Use structs for commonly-used field types
Instead of using magic numbers, use structs that are more descriptive of
the fields being used.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13 12:20:36 +02:00
Amit Shah 493accd624 atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function
This makes the code more readable.

Also, there's a block like:

if () {
  ...
} else {
  ...
}

Split that into

if () {
  ...
  return;
}
...

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13 12:20:31 +02:00
Amit Shah 0c370a3549 atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change
After a media change, the only commands allowed from the guest were
REQUEST_SENSE and INQUIRY.  The guest may also issue
GET_EVENT_STATUS_NOTIFICATION commands to get media
changed notification.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13 12:19:52 +02:00
Amit Shah 88f2bb58ef atapi: Report correct errors on guest eject request
Table 629 of the MMC-5 spec mentions two different error conditions when
a CDROM eject is requested: a) while a disc is inserted and b) while a
disc is not inserted.

Ensure we return the appropriate error for the present condition of the
drive and disc status.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13 12:06:41 +02:00
Amit Shah 8aa71917f7 atapi: Drives can be locked without media present
Drivers are free to lock drives without any media present.  Such a
condition should not result in an error condition.

See Table 341 in MMC-5 spec for details.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-13 12:06:41 +02:00
Wen Congyang 54f8e61d5b fix acpi regression
This bug is introduced by commit 23910d3f.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-12 21:51:51 +02:00
Stefan Weil 54f7b4a396 Replace cpu_physical_memory_rw were possible
Using cpu_physical_memory_read, cpu_physical_memory_write and ldub_phys
improves readability and allows removing some type casts.

lduw_phys and ldl_phys were not used because both require aligned
addresses. Therefore it is not possible to simply replace existing
calls by one of these functions.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-12 21:51:50 +02:00
Blue Swirl 8b2715a01e ppc: remove a write-only variable
Remove a write-only variable, spotted by GCC 4.6.0:
/src/qemu/hw/ppc.c: In function 'power7_set_irq':
/src/qemu/hw/ppc.c:255:9: error: variable 'cur_level' set but not used [-Werror=unused-but-set-variable]

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-04-11 17:21:42 +00:00
Alexander Graf 8f16753fd6 s390x: fix virtio feature bitmap
The feature bitmap in the s390 virtio machine is little endian. To
address for that, we need to bswap the values after reading them out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-10 22:25:41 +02:00
Jan Kiszka d04fba948f musicpal: Fix registration of MMIO-less sysbus devices
The proper way to signal that a sysbus devices need no MMIO region is to
pass -1 to sysbus_create_simple.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-10 14:30:39 +02:00
Isaku Yamahata 23910d3f66 acpi, acpi_piix: factor out GPE logic
factor out ACPI GPE logic. Later it will be used by ICH9 ACPI.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-10 14:00:14 +02:00
Isaku Yamahata a88df0b9b5 smbus_eeprom: consolidate smbus eeprom creation oc pc_piix, mips_mapta, mips_fulong
consolidate smbus initialization for pc_piix, mips_malta and mips_fulong.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09 23:52:16 +02:00
Atsushi Nemoto a0313c00fc lan9118: Ignore write to MAC_VLAN1 register
On Mon, 4 Apr 2011 20:15:30 +0200, Aurelien Jarno <aurelien@aurel32.net> wrote:
> Is it really safe ignoring write to this register? If yes, it's probably
> a good idea to explain why in a comment. In any case, if supporting this
> register is easy to do, it would be the best option.

I think it is safe.  Please see an updated comment below.

And though implementing this register might be possible, I suppose it
is not worth to supporting FrameTooLong detection, for now at least.

Thank you for comments.

>8---------------------------------------------------------------------
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Tue, 5 Apr 2011 23:12:07 +0900
Subject: [PATCH] lan9118: Ignore write to MAC_VLAN1 register

Since linux 2.6.38, smsc911x driver writes to VLAN1 registger.
Since this register only affects FrameTooLong detection, ignoring
write to this register should be safe.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09 18:52:42 +02:00
Isaku Yamahata eaba51c573 acpi, acpi_piix, vt82c686: factor out PM1_CNT logic
factor out ACPI PM1_CNT logic. This will be used by ich9 acpi.

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Huacai Chen <zltjiangshi@gmail.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09 18:39:06 +02:00
Isaku Yamahata 04dc308f68 acpi, acpi_piix, vt82c686: factor out PM1a EVT logic
factor out ACPI PM1a EVT logic.
Later this will be used by ich9 acpi.

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Huacai Chen <zltjiangshi@gmail.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09 18:39:05 +02:00
Isaku Yamahata a54d41a8b9 acpi, acpi_piix, vt82c686: factor out PM_TMR logic
factor out PM_TMR logic. Later This will be used by ich9 acpi.
Also fixes the same bug in vt82c686.c that was fixed by the following
commits.

> commit 055479feab
> Author: aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
> Date:   Wed Jan 21 16:31:20 2009 +0000
>
>     Always return latest pmsts instead of the old one (Xiantao Zhang)
>
>     It may lead to the issue when booting windows guests with acpi=1
>     if return the old pmsts.
>
>     Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
>     Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Huacai Chen <zltjiangshi@gmail.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09 18:39:05 +02:00
Jordan Justen 5145b3d1cc hw/pflash_cfi02: Fix lazy reset of ROMD mode
When checking pfl->rom_mode for when to lazily reenter ROMD mode,
the value was check was the opposite of what it should have been.
This prevent the part from returning to ROMD mode after a write
was made to the CFI rom region.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-09 18:32:13 +02:00
Scott Wood 72b310e99a mpc85xx_pci_map_irq: change "unknow" to "unknown"
Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-09 10:57:03 +01:00
Adam Lackorzynski f95857b34d multiboot: Quote filename in error message
Quote filename in error message to spot possible whitespace character in
the filename and make error message more meaningful.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-09 10:40:46 +01:00
David Gibson a3467baa88 Delay creation of pseries device tree until reset
At present, the 'pseries' machine creates a flattened device tree in the
machine->init function to pass to either the guest kernel or to firmware.

However, the machine->init function runs before processing of -device
command line options, which means that the device tree so created will
be (incorrectly) missing devices specified that way.

Supplying a correct device tree is, in any case, part of the required
platform entry conditions.  Therefore, this patch moves the creation and
loading of the device tree from machine->init to a reset callback.  The
setup of entry point address and initial register state moves with it,
which leads to a slight cleanup.

This is not, alas, quite enough to make a fully working reset for pseries.
For that we would need to reload the firmware images, which on this
machine are loaded into RAM.  It's a step in the right direction, though.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-08 11:32:21 +02:00
David Gibson c7a5c0c928 pseries: Abolish envs array
Currently the pseries machine init code builds up an array, envs, of
CPUState pointers for all the cpus in the system.  This is kind of
pointless, given the generic code already has a perfectly good linked list
of the cpus.

In addition, there are a number of places which assume that the cpu's
cpu_index field is equal to its index in this array.  This is true in
practice, because cpu_index values are just assigned sequentially, but
it's conceptually incorrect and may not always be true.

Therefore, this patch abolishes the envs array, and explicitly uses the
generic cpu linked list and cpu_index values throughout.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-08 11:32:21 +02:00
Stefan Weil 8804f57b53 spapr_vscsi: Set uninitialized variable
cppcheck reports this error:

hw/spapr_vscsi.c:274: error: Uninitialized variable: rc

If llen == 0, rc was indeed used without being initialized.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-08 11:32:20 +02: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
Anthony Liguori f124a410ea Merge remote branch 'kwolf/for-anthony' into staging 2011-04-07 09:56:09 -05:00
Christoph Hellwig 52c050236e virtio-blk: fail unaligned requests
Like all block drivers virtio-blk should not allow small than block size
granularity access.  But given that the protocol specifies a
byte unit length field we currently accept such requests, which cause
qemu to abort() in lower layers.  Add checks to the main read and
write handlers to catch them early.

Reported-by: Conor Murphy <conor_murphy_virt@hotmail.com>
Tested-by: Conor Murphy <conor_murphy_virt@hotmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-04-07 15:55:06 +02:00
Alexey Kardashevskiy e54f17713f virtio-balloon: fixed endianness bug in the config space
The specification for the virtio balloon device requres that the values
in the config space be encoded little-endian.  This differs from most
virtio things, where guest-native endian is the norm.

Currently, the qemu virtio-balloon code correctly makes the conversion
on get_config(), but doesn't on set_config for the 'actual' field.  The
kernel driver, on the other hand, correctly converts when setting the
actual field, but does not convert when reading the config space.  The
upshot is that virtio-balloon will only work correctly if both host and
guest are LE, making all the conversions nops.

This patch corrects the qemu side, correctly doing host-native <-> LE
conversions when accessing the config space.  This won't break any setups
that aren't already broken, and fixes the case of BE host, LE guest.
Fixing the BE guest case will require kernel fixes as well.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-07 14:25:53 +01:00