]> git.proxmox.com Git - qemu.git/log
qemu.git
13 years agoUpdate version for 0.13.0-rc2 v0.13.0-rc2
Anthony Liguori [Mon, 11 Oct 2010 21:37:35 +0000 (16:37 -0500)]
Update version for 0.13.0-rc2

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoFix ivshmem build on 32-bit hosts
Avi Kivity [Sun, 29 Aug 2010 09:43:15 +0000 (12:43 +0300)]
Fix ivshmem build on 32-bit hosts

stat() fields can be more or less anything depending on configuration, cast
explicitly to uint64_t to avoid printf() format mismatches.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
(cherry picked from commit ad0a4ac1c0e1859eb0c67900dba696cc459b42a7)

13 years agohw/ivshmem.c don't check for negative values on unsigned data types
Jes Sorensen [Mon, 30 Aug 2010 10:31:33 +0000 (12:31 +0200)]
hw/ivshmem.c don't check for negative values on unsigned data types

There is no need to check for dest < 0 or vector >= 0 as both are
uint16_t.

This should fix problems with broken build with aggressive compiler
flags. Reported by Xudong Hao <xudong.hao@intel.com>

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
(cherry picked from commit 1b27d7a1e8609b2eeb6238f2c629eb82217523f6)

13 years agoDisable build of ivshmem on non-KVM systems
Cam Macdonell [Sat, 14 Aug 2010 23:47:31 +0000 (17:47 -0600)]
Disable build of ivshmem on non-KVM systems

Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
(cherry picked from commit 3dcbf8f9ca5f361a38bf1b699080daeb40d5185e)

13 years agoAdd kvm_set_ioeventfd_mmio_long definition for non-KVM systems
Cam Macdonell [Sat, 14 Aug 2010 23:47:30 +0000 (17:47 -0600)]
Add kvm_set_ioeventfd_mmio_long definition for non-KVM systems

Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
(cherry picked from commit 1fd74012750dcd8542708bdcc10becb8780f7493)

13 years agoRESEND: Inter-VM shared memory PCI device
Cam Macdonell [Tue, 27 Jul 2010 16:54:13 +0000 (10:54 -0600)]
RESEND: Inter-VM shared memory PCI device

resend for bug fix related to removal of irqfd

Support an inter-vm shared memory device that maps a shared-memory object as a
PCI device in the guest.  This patch also supports interrupts between guest by
communicating over a unix domain socket.  This patch applies to the qemu-kvm
repository.

    -device ivshmem,size=<size in format accepted by -m>[,shm=<shm name>]

Interrupts are supported between multiple VMs by using a shared memory server
by using a chardev socket.

    -device ivshmem,size=<size in format accepted by -m>[,shm=<shm name>]
           [,chardev=<id>][,msi=on][,ioeventfd=on][,vectors=n][,role=peer|master]
    -chardev socket,path=<path>,id=<id>

The shared memory server, sample programs and init scripts are in a git repo here:

    www.gitorious.org/nahanni

Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 6cbf4c8c6416237e9c323661b87d60792a9d51af)

13 years agoSupport marking a device as non-migratable
Cam Macdonell [Tue, 27 Jul 2010 00:11:00 +0000 (18:11 -0600)]
Support marking a device as non-migratable

A non-migratable device should be removed before migration and re-added after.

Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 2431296806bc7a40c29b7775e16f36dc1cda4d06)

13 years agoAdd function to assign ioeventfd to MMIO.
Cam Macdonell [Tue, 27 Jul 2010 00:10:59 +0000 (18:10 -0600)]
Add function to assign ioeventfd to MMIO.

Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 44f1a3d8765b19ee88ca493e8e13cefb6ee50cbe)

13 years agoDevice specification for shared memory PCI device
Cam Macdonell [Tue, 27 Jul 2010 00:10:58 +0000 (18:10 -0600)]
Device specification for shared memory PCI device

Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit b6828931ebac027b869e40ec9518a291078dafe5)

13 years agoAdd qemu_ram_alloc_from_ptr function
Cam Macdonell [Tue, 27 Jul 2010 00:10:57 +0000 (18:10 -0600)]
Add qemu_ram_alloc_from_ptr function

Provide a function to add an allocated region of memory to the qemu RAM.

This patch is copied from Marcelo's qemu_ram_map() in qemu-kvm and given the
clearer name qemu_ram_alloc_from_ptr().

Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 84b89d782f03b99770759f1d9d6e4e95a2641c35)

13 years agoUpdate version for 0.13.0-rc1 v0.13.0-rc1
Anthony Liguori [Tue, 31 Aug 2010 13:19:23 +0000 (08:19 -0500)]
Update version for 0.13.0-rc1

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoposix-aio-compat: Fix async_conmtext for ioctl
Andrew de Quincey [Sun, 8 Aug 2010 20:04:50 +0000 (21:04 +0100)]
posix-aio-compat: Fix async_conmtext for ioctl

Set the async_context_id field when queuing an async ioctl call

Signed-off-by: Andrew de Quincey <adq@lidskialf.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 34cf0081294513bc734896c9051c20ca6c19c3db)

13 years agovvfat: fat_chksum(): fix access above array bounds
Loïc Minier [Sat, 21 Aug 2010 22:47:23 +0000 (00:47 +0200)]
vvfat: fat_chksum(): fix access above array bounds

Signed-off-by: Loïc Minier <loic.minier@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 2aa326be0d2039f51192707bdb2fc935d0e87c21)

13 years agoqemu-img rebase: Open new backing file read-only
Kevin Wolf [Tue, 17 Aug 2010 16:58:55 +0000 (18:58 +0200)]
qemu-img rebase: Open new backing file read-only

We never write to a backing file, so opening rw is useless. It just means that
you can't rebase on top of a file for which you don't have write permissions.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit cdbae85169c384d1641aa1ae86cdeefe16285745)

13 years agoblock: Fix image re-open in bdrv_commit
Kevin Wolf [Mon, 30 Aug 2010 16:42:15 +0000 (18:42 +0200)]
block: Fix image re-open in bdrv_commit

Arguably we should re-open the backing file with the backing file format and
not with the format of the snapshot image.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit ee1811965fd15e0b41f8d508b951a8ab826ae3a7)

Conflicts:

block.c

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agovirtio-blk: Fix migration of queued requests
Kevin Wolf [Tue, 3 Aug 2010 14:57:02 +0000 (16:57 +0200)]
virtio-blk: Fix migration of queued requests

in_sg[].iovec and out_sg[].ioved are pointer to (source) host memory and
therefore invalid after migration. When loading the device state we must
create a new mapping on the destination host.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit b6a4805b55b409134dc712677fdc4f6a8795e965)

13 years agovirtio: Factor virtqueue_map_sg out
Kevin Wolf [Tue, 3 Aug 2010 14:54:38 +0000 (16:54 +0200)]
virtio: Factor virtqueue_map_sg out

Separate the mapping of requests to host memory from the descriptor iteration.
The next patch will make use of it in a different context.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 42fb2e0720511fa1da2f8e751be393f851b71d80)

13 years agoide: Avoid canceling IDE DMA
Andrea Arcangeli [Tue, 27 Jul 2010 19:04:36 +0000 (21:04 +0200)]
ide: Avoid canceling IDE DMA

The reason for not actually canceling the I/O is because with
virtualization and lots of VM running, a guest fs may mistake a
overload of the host, as an IDE timeout. So rather than canceling the
I/O, it's safer to wait I/O completion and simulate that the I/O has
completed just before the io cancellation was requested by the
guest. This way if ntfs or an app writes data without checking for
-EIO retval, and it thinks the write has succeeded, it's less likely
to run into troubles. Similar issues for reads.

Furthermore because the DMA operation is splitted into many synchronous
aio_read/write if there's more than one entry in the SG table, without this
patch the DMA would be cancelled in the middle, something we've no idea if it
happens on real hardware too or not. Overall this seems a great risk for zero
gain.

This approach is sure safer than previous code given we can't pretend all guest
fs code out there to check for errors and reply the DMA if it was completed
partially, given a timeout would never materialize on a real harddisk unless
there are defective blocks (and defective blocks are practically only an issue
for reads never for writes in any recent hardware as writing to blocks is the
way to fix them) or the harddisk breaks as a whole.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 953844d102f5b682f0835f021f2ed2ad9fb7734c)

13 years agoblock: Change bdrv_eject() not to drop the image
Markus Armbruster [Tue, 27 Jul 2010 12:02:01 +0000 (14:02 +0200)]
block: Change bdrv_eject() not to drop the image

bdrv_eject() gets called when a device model opens or closes the tray.

If the block driver implements method bdrv_eject(), that method gets
called.  Drivers host_cdrom implements it, and it opens and closes the
physical tray, and nothing else.  When a device model opens, then
closes the tray, media changes only if the user actively changes the
physical media while the tray is open.  This is matches how physical
hardware behaves.

If the block driver doesn't implement method bdrv_eject(), we do
something quite different: opening the tray severs the connection to
the image by calling bdrv_close(), and closing the tray does nothing.
When the device model opens, then closes the tray, media is gone,
unless the user actively inserts another one while the tray is open,
with a suitable change command in the monitor.  This isn't how
physical hardware behaves.  Rather inconvenient when programs
"helpfully" eject media to give you a chance to change it.  The way
bdrv_eject() behaves here turns that chance into a must, which is not
what these programs or their users expect.

Change the default action not to call bdrv_close().  Instead, note the
tray status in new BlockDriverState member tray_open.  Use it in
bdrv_is_inserted().

Arguably, the device models should keep track of tray status
themselves.  But this is less invasive.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 4be9762adb0947a353e6efef2fed354f69218bfb)

13 years agoblock: Fix bdrv_has_zero_init
Kevin Wolf [Wed, 28 Jul 2010 09:26:29 +0000 (11:26 +0200)]
block: Fix bdrv_has_zero_init

Assuming that any image on a block device is not properly zero-initialized is
actually wrong: Only raw images have this problem. Any other image format
shouldn't care about it, they initialize everything properly themselves.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 336c1c12551ff0a6e1a2af226d6cbdbadd2e02b5)

13 years agosavevm: Fix memory leak of compat struct
Alex Williamson [Wed, 21 Jul 2010 14:35:31 +0000 (08:35 -0600)]
savevm: Fix memory leak of compat struct

Forgot to check for and free these.

Found-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 69e58af92cf90a1a0551c73880928afa6753fa5f)

13 years agolinux-user: fix build on hosts not using guest base
Aurelien Jarno [Fri, 30 Jul 2010 19:09:10 +0000 (21:09 +0200)]
linux-user: fix build on hosts not using guest base

Commit 68a1c816868b3e35a1da698af412b29e61b1948a broke qemu on hosts not
using guest base. It uses reserved_va unconditionally in mmap.c. To
avoid to many #ifdef #endif blocks, define RESERVED_VA as either
reserved_va or 0ul, and use it instead of reserved_va, similarly to what
has been done with guest_base/GUEST_BASE.
(cherry picked from commit 18e9ea8a3f36b0a3845e1ac6d8acd180063bed8f)

13 years agoFix -snapshot deleting images on disk change
Blue Swirl [Sun, 25 Jul 2010 20:49:34 +0000 (20:49 +0000)]
Fix -snapshot deleting images on disk change

Block device change command did not copy BDRV_O_SNAPSHOT flag. Thus
the new image did not have this flag and the file got deleted during
opening.

Fix by copying BDRV_O_SNAPSHOT flag.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 199630b62ec7cc5efd6f860ff545b449c7b5cdb8)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoblock: Use error codes from lower levels for error message
Stefan Weil [Wed, 21 Jul 2010 19:51:51 +0000 (21:51 +0200)]
block: Use error codes from lower levels for error message

"No such file or directory" is a misleading error message
when a user tries to open a file with wrong permissions.

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit c98ac35d87fbd41618c1f02c64bcd4019e42513e)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoblock: default to 0 minimal / optiomal I/O size
Christoph Hellwig [Fri, 23 Jul 2010 07:35:04 +0000 (09:35 +0200)]
block: default to 0 minimal / optiomal I/O size

Currently we set them to 512 bytes unless manually specified.  Unforuntaly
some brain-dead partitioning tools create unaligned partitions if they
get low enough optiomal I/O size values, so don't report any at all
unless explicitly set.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 55459498b226ab3314c463b2d5766f3650949e80)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomove 'unsafe' to end of caching modes in help
Bruce Rogers [Wed, 21 Jul 2010 20:32:28 +0000 (14:32 -0600)]
move 'unsafe' to end of caching modes in help

Libvirt parses qemu help output to determine qemu features. In particular
it probes for the following: "cache=writethrough|writeback|none". The
addition of the unsafe cache mode was inserted within this string, as
opposed to being added to the end, which impacted libvirt's probe.
Unbreak libvirt by keeping the existing cache modes intact and add
unsafe to the end.

This problem only manifests itself if a caching mode is explicitly
specified in the libvirt xml, in which case older syntax for caching is
passed to qemu, which it  no longer understands.

Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 6c6b6ba20a167a89f85606125ee1e10eafef5b33)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio-blk: Create exit function to unregister savevm
Alex Williamson [Tue, 20 Jul 2010 17:14:22 +0000 (11:14 -0600)]
virtio-blk: Create exit function to unregister savevm

Otherwise we can't migrate after we've removed a virtio block device.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 9d0d3138590c26cee1b1c440db6bcdd1986a5a20)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoblock migration: propagate return value when bdrv_write() returns < 0
Yoshiaki Tamura [Tue, 20 Jul 2010 09:19:00 +0000 (18:19 +0900)]
block migration: propagate return value when bdrv_write() returns < 0

Currently block_load() doesn't check return value of bdrv_write(), and
even the destination weren't prepared to execute block migration, it
proceeds and guest boots on the target.  This patch fix this issue.

Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit b02bea3a85cc939f09aa674a3f1e4f36d418c007)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoide/atapi: add support for GET EVENT STATUS NOTIFICATION
Aurelien Jarno [Mon, 19 Jul 2010 13:53:35 +0000 (15:53 +0200)]
ide/atapi: add support for GET EVENT STATUS NOTIFICATION

The GET EVENT STATUS NOTIFICATION is a mandatory command according
to MMC-3, even if event status notification is not supported.

This patch adds support for this command. It returns NEA ("No Event
Available") with an empty "Supported Event Classes" to show that it
doesn't event support status notification. If asychronous operation is
requested, which requires NCQ support, it returns an error according
to the specifications.

This fixes HAL support on FreeBSD and derivatives, which fill up the
logs every second with:

  acd0: FAILURE - unknown CMD (0x03) ILLEGAL REQUEST asc=0x20 ascq=0x00

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 253cb7b9909806b83d73269afb9cf0ab3fa2ce2c)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoUpdate version for 0.13.0-rc0 v0.13.0-rc0
Anthony Liguori [Tue, 27 Jul 2010 12:39:42 +0000 (07:39 -0500)]
Update version for 0.13.0-rc0

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: better default values for VNC options
Corentin Chary [Wed, 7 Jul 2010 18:58:06 +0000 (20:58 +0200)]
vnc: better default values for VNC options

vnc_jpeg and vnc_png are now "auto" by default, this means that
if the dependencies are installed (libjpeg or libpng), then they
will be enabled.

vnc_thread is disabled by default. It should be enabled by default
as soon as it's stable enougth.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight: split send_sub_rect
Corentin Chary [Wed, 7 Jul 2010 18:58:05 +0000 (20:58 +0200)]
vnc: tight: split send_sub_rect

Split send_sub_rect in send_sub_rect_jpeg and send_sub_rect_nojpeg to
remove all these #ifdef CONFIG_JPEG.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight: fix rgb_prepare_row
Corentin Chary [Wed, 7 Jul 2010 18:58:04 +0000 (20:58 +0200)]
vnc: tight: fix rgb_prepare_row

rgb_prepare_row bpp depends on the server display surface, not
the client.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: add missing lock for vnc_cursor_define()
Corentin Chary [Wed, 7 Jul 2010 18:58:03 +0000 (20:58 +0200)]
vnc: add missing lock for vnc_cursor_define()

All vnc_write() calls must be locked (except the ones present before
the protocol initialization).

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: threaded VNC server
Corentin Chary [Wed, 7 Jul 2010 18:58:02 +0000 (20:58 +0200)]
vnc: threaded VNC server

Implement a threaded VNC server using the producer-consumer model.
The main thread will push encoding jobs (a list a rectangles to update)
in a queue, and the VNC worker thread will consume that queue and send
framebuffer updates to the output buffer.

The threaded VNC server can be enabled with ./configure --enable-vnc-thread.

If you don't want it, just use ./configure --disable-vnc-thread and a syncrhonous
queue of job will be used (which as exactly the same behavior as the old queue).
If you disable the VNC thread, all thread related code will not be built and there will
be no overhead.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit
Corentin Chary [Wed, 7 Jul 2010 18:58:01 +0000 (20:58 +0200)]
qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit

Add some missing functions in qemu-thread. Currently qemu-thread
is only used for io-thread but it will used by the vnc server soon
and we need those functions instead of calling pthread directly.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: fix tight png memory leak
Corentin Chary [Wed, 7 Jul 2010 18:58:00 +0000 (20:58 +0200)]
vnc: fix tight png memory leak

The tight.png buffer was never released.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: encapsulate encoding members
Corentin Chary [Wed, 7 Jul 2010 18:57:59 +0000 (20:57 +0200)]
vnc: encapsulate encoding members

This will allow to implement the threaded VNC server in a
more cleaner way.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight: stop using qdict for palette stuff
Corentin Chary [Wed, 7 Jul 2010 18:57:58 +0000 (20:57 +0200)]
vnc: tight: stop using qdict for palette stuff

Profiling with callgrind seems to show that a lot of time is spent
in the palette code (mostly due to memory allocation and qdict to int
conversion).

This patch adds a VncPalette implementation. The palette is stored
in a hash table, like qdict, but which does way less memory allocations,
and doesn't suffer from the QObject overhead.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight: specific zlib level and filters for each compression level
Corentin Chary [Wed, 7 Jul 2010 18:57:57 +0000 (20:57 +0200)]
vnc: tight: specific zlib level and filters for each compression level

Disable png filters for lower compression levels. This should lower
the CPU consumption and reduce encoding time.

This isn't in tight_conf because:
* tight_conf structure must not change, because it's shared with other
  tight implementations (libvncserver, etc..).
* it'd exceed the 80 col limit.
* PNG_ macros are only defined if CONFIG_VNC_PNG is defined

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight add PNG encoding
Corentin Chary [Wed, 7 Jul 2010 18:57:56 +0000 (20:57 +0200)]
vnc: tight add PNG encoding

Introduce a new encoding: VNC_ENCODING_TIGHT_PNG [1] (-269) with a new
tight filter VNC_TIGHT_PNG (0x0A). When the client tells it supports the Tight PNG
encoding, the server will use tight, but will always send encoding pixels using
PNG instead of zlib. If the client also told it support JPEG, then the server can
send JPEG, because PNG will only be used in the cases zlib was used in normal tight.

This encoding was introduced to speed up HTML5 based VNC clients like noVNC [2], but
can also be used on devices like iPhone where PNG can be rendered in hardware.

[1] http://wiki.qemu.org/VNC_Tight_PNG
[2] http://github.com/kanaka/noVNC/

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight: remove a memleak in send_jpeg_rect()
Corentin Chary [Wed, 7 Jul 2010 18:57:55 +0000 (20:57 +0200)]
vnc: tight: remove a memleak in send_jpeg_rect()

buf was never freed.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight: don't forget do at the last color
Corentin Chary [Wed, 7 Jul 2010 18:57:54 +0000 (20:57 +0200)]
vnc: tight: don't forget do at the last color

While using indexed colors, the last color was never added to the palette.
Triggered with ubuntu livecd.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: rename vnc-encoding-* vnc-enc-*
Corentin Chary [Wed, 7 Jul 2010 18:57:53 +0000 (20:57 +0200)]
vnc: rename vnc-encoding-* vnc-enc-*

For the same reason that we don't use vnc-authentication-sasl.c but
vnc-auth-sals.c. Because it's tooooo long.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoui: move all ui components in ui/
Corentin Chary [Wed, 7 Jul 2010 18:57:52 +0000 (20:57 +0200)]
ui: move all ui components in ui/

Move sdl, vnc, curses and cocoa UI into ui/ to cleanup
the root directory. Also remove some unnecessary explicit
targets from Makefile.

aliguori: fix build when srcdir != objdir

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: add lossy option
Corentin Chary [Wed, 7 Jul 2010 18:57:51 +0000 (20:57 +0200)]
vnc: add lossy option

The lossy option can be used to enable lossy compression
methods like gradient or jpeg. This patch disable them by
default.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: JPEG should be disabled if the client don't set tight quality
Corentin Chary [Wed, 7 Jul 2010 18:57:50 +0000 (20:57 +0200)]
vnc: JPEG should be disabled if the client don't set tight quality

Disable JPEG compression by default and only enable it if the
VNC client has sent the requested quality.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight: add JPEG and gradient subencoding with smooth image detection
Corentin Chary [Wed, 7 Jul 2010 18:57:49 +0000 (20:57 +0200)]
vnc: tight: add JPEG and gradient subencoding with smooth image detection

Add gradient filter and JPEG compression with an heuristic to detect how
lossy the comppression will be. This code has been adapted from
libvncserver/tight.c.

JPEG support can be enabled/disabled at compile time with --enable-vnc-jpeg
and --disable-vnc-jpeg.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoInitial documentation for migration
Juan Quintela [Mon, 26 Jul 2010 19:38:46 +0000 (21:38 +0200)]
Initial documentation for migration

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoide: fix migration in the middle of a bmdma transfer
Juan Quintela [Mon, 26 Jul 2010 19:38:45 +0000 (21:38 +0200)]
ide: fix migration in the middle of a bmdma transfer

It reintroduces
    Revert "ide save/restore pio/atapi cmd transfer fields and io buffer"

but using subsections.  Added bonus is the addition of ide_dummy_transfer_stop
to transfer_end_table, that was missing.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoide: fix migration in the middle of pio operation
Juan Quintela [Mon, 26 Jul 2010 19:38:44 +0000 (21:38 +0200)]
ide: fix migration in the middle of pio operation

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovmstate: add subsections code
Juan Quintela [Mon, 26 Jul 2010 19:38:43 +0000 (21:38 +0200)]
vmstate: add subsections code

This commit adds subsections for each device section.
Subsections is the way to handle information that don't need to be sent
to de destination of a migration because its values are not needed.  It is
the way to handle optional information.  Notice that only the source can
decide if the information is optional or not.  The destination needs to
understand all subsections that it receives to have a sucessful load.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRevert "ide save/restore current transfer fields"
Juan Quintela [Mon, 26 Jul 2010 19:38:42 +0000 (21:38 +0200)]
Revert "ide save/restore current transfer fields"

This reverts commit 42ee76fe82093ba914f0dc83d2decbcf68866144.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRevert "ide save/restore pio/atapi cmd transfer fields and io buffer"
Juan Quintela [Mon, 26 Jul 2010 19:38:41 +0000 (21:38 +0200)]
Revert "ide save/restore pio/atapi cmd transfer fields and io buffer"

This reverts commit ed487bb1d69040b9dac64a4fc076d8dd82b131d6.

The conflicts are due to commit 4fc8d6711aff7a9c11e402c3d77b481609f9f486
that is a fix to the ide_drive_pre_save() function.  It reverts both
(and both are reinstantiated later in the series)

Conflicts:

hw/ide/core.c

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoMerge remote branch 'mst/for_anthony' into staging
Anthony Liguori [Mon, 26 Jul 2010 13:05:27 +0000 (08:05 -0500)]
Merge remote branch 'mst/for_anthony' into staging

13 years agoetrax: Update ethernet mgm-ctrl reg on writes
Edgar E. Iglesias [Sun, 25 Jul 2010 19:03:56 +0000 (21:03 +0200)]
etrax: Update ethernet mgm-ctrl reg on writes

Some SW drivers dont keep track of what they've written and
depend on the HW latching write contents for later
read+modify+write sequences.

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agotarget-i386: use gen_update_cc_op()
Jun Koi [Sun, 25 Jul 2010 03:30:03 +0000 (12:30 +0900)]
target-i386: use gen_update_cc_op()

This patch simplifies target-i386/translate.c a bit by replacing some
code with gen_update_cc_op()

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoClose socket file descriptor when qemu_accept fails
Shahar Havivi [Sat, 24 Jul 2010 10:03:07 +0000 (13:03 +0300)]
Close socket file descriptor when qemu_accept fails

Signed-off-by: Shahar Havivi <shaharh@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoadd cscope.* to .gitignore
Jun Koi [Fri, 23 Jul 2010 05:59:52 +0000 (14:59 +0900)]
add cscope.* to .gitignore

we have "make cscope", therefore that makes sense to have cscope.* in
.gitignore.

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoslirp: Remove declarations which are no longer needed
Stefan Weil [Thu, 22 Jul 2010 20:15:24 +0000 (22:15 +0200)]
slirp: Remove declarations which are no longer needed

The previous patches replaced u_int8_t, u_int16_t, u_int32_t, u_int64_t
by standard int types from stdint.h,
so we can now remove their declarations which are no longer needed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoslirp: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types
Stefan Weil [Thu, 22 Jul 2010 20:15:23 +0000 (22:15 +0200)]
slirp: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types

There is no need to have a second set of integral types.
Replace them by the standard types from stdint.h.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotests: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types
Stefan Weil [Thu, 22 Jul 2010 20:15:22 +0000 (22:15 +0200)]
tests: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types

There is no need to have a second set of integral types.
Replace them by the standard types from stdint.h.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoblock: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types
Stefan Weil [Thu, 22 Jul 2010 20:15:21 +0000 (22:15 +0200)]
block: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types

There is no need to have a second set of integral types.
Replace them by the standard types from stdint.h.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agomips: more fixes to the MIPS interrupt glue logic
Aurelien Jarno [Sun, 25 Jul 2010 14:51:29 +0000 (16:51 +0200)]
mips: more fixes to the MIPS interrupt glue logic

Commit 36388314febad3d7675ab919287f03733a560ff6 moved most of the
interrupt logic to cpu-exec.c. Remove the remaining useless code
and fix software interrupts.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Edgar E. Iglesias <edgar@axis.com>
Tested-by: Edgar E. Iglesias <edgar@axis.com>
13 years agomicroblaze: Remove unused members from the disas context
Edgar E. Iglesias [Sat, 24 Jul 2010 22:09:41 +0000 (00:09 +0200)]
microblaze: Remove unused members from the disas context

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
13 years agomicroblaze: Speed up base + index addressing mode
Edgar E. Iglesias [Sat, 24 Jul 2010 21:25:49 +0000 (23:25 +0200)]
microblaze: Speed up base + index addressing mode

Speed up reg + reg addressing mode when any of the regs is r0.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
13 years agomicroblaze: Use setcond for conditional branches
Edgar E. Iglesias [Sat, 24 Jul 2010 19:51:51 +0000 (21:51 +0200)]
microblaze: Use setcond for conditional branches

Use setcond for evaluating the condition for branches.
In the future, we could do better for branches without
delay slots.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
13 years agomicroblaze: Improve branch with small immediates
Edgar E. Iglesias [Sat, 24 Jul 2010 19:24:59 +0000 (21:24 +0200)]
microblaze: Improve branch with small immediates

Slight improvements of conditional branches with small
immediate offsets.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
13 years agoremove dead code
Jun Koi [Fri, 23 Jul 2010 05:57:40 +0000 (14:57 +0900)]
remove dead code

this patch removes unused function cpu_restore_state_copy().

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agouse symbol for DisasContext->is_jmp
Jun Koi [Fri, 23 Jul 2010 15:17:00 +0000 (00:17 +0900)]
use symbol for DisasContext->is_jmp

This patch replaces constant value assigned for (DisasContext
*)->is_jmp with DISAS_TB_JUMP.

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agomips: Correct MIPS interrupt glue logic for icount
Edgar E. Iglesias [Sat, 24 Jul 2010 11:40:05 +0000 (13:40 +0200)]
mips: Correct MIPS interrupt glue logic for icount

When hw interrupt pending bits in CP0_Cause are set, the CPU should
see the hw interrupt line as active. The CPU may or may not take the
interrupt based on internal state (global irq mask etc) but the glue
logic shouldn't care.

This fixes MIPS external hw interrupts in combination with -icount.

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agomicroblaze: Pass a ucontext * as 3rd sighandler arg
Edgar E. Iglesias [Fri, 23 Jul 2010 07:30:37 +0000 (09:30 +0200)]
microblaze: Pass a ucontext * as 3rd sighandler arg

There is disagreement between microblaze glibc and the kernel
to what the third arg of signal handlers should point to.

Change QEMU linux-user to match the kernel port. glibc patches
are pending.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
13 years agoDeclare code_gen_ptr, code_gen_max_blocks 'static'
Stefan Weil [Mon, 19 Jul 2010 16:23:17 +0000 (18:23 +0200)]
Declare code_gen_ptr, code_gen_max_blocks 'static'

Both values are only used in exec.c, so there is no need
to make them globally available.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoscsi: Dequeue requests before invoking completion callback
Jan Kiszka [Tue, 13 Jul 2010 12:13:45 +0000 (14:13 +0200)]
scsi: Dequeue requests before invoking completion callback

The request completion callback of the LSI controller may start the next
request that can use the same tag as the completed one. As the latter is
still enqueued at that point, scsi_send_command will complain about the
tag reuse and cancel the completed request. That will cause a double
free later on when the completion path cleans up as well.

Fix this by dequeuing the request before invoking the callback.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoe1000: Fix wrong microwire EEPROM state initialization
Izumi Tsutsui [Sat, 10 Jul 2010 14:03:45 +0000 (23:03 +0900)]
e1000: Fix wrong microwire EEPROM state initialization

This change fixes initialization of e1000's microwire EEPROM internal
state values so that qemu's e1000 emulation works on NetBSD,
which doesn't use Intel's em driver but has its own wm driver
for the Intel i8254x Gigabit Ethernet.

Previously set_eecd() function in e1000.c clears EEPROM internal state
values on SK rising edge during CS==L, but according to FM93C06 EEPROM
(which is MicroWire compatible) data sheet, EEPROM internal status
should be cleared on CS rise edge regardless of SK input:
 "... a rising edge on this (CS) signal is required to reset the internal
  state-machine to accept a new cycle .."
and nothing should be changed during CS (chip select) is inactive.

Intel's em driver seems to explicitly raise SK output after CS is negated
in em_standby_eeprom() so many other OSes that use Intel's driver
don't have this problem even on the previous e1000.c implementation,
but I can't find any articles that say the MICROWIRE or EEPROM spec
requires such sequence, and actually hardware works fine without it
(i.e. real i82540EM has been working on NetBSD).

This fix also changes initialization to clear each state value in
struct eecd_state individually rather than using memset() against
the whole structre. The old_eecd member stores the last SK and CS
signal levels and it should be preserved even after reset of internal
EEPROM state to detect next signal edges for proper EEPROM emulation.

Signed-off-by: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoRework debug exception processing for gdb use
Jan Kiszka [Fri, 25 Jun 2010 14:56:56 +0000 (16:56 +0200)]
Rework debug exception processing for gdb use

Guest debugging is currently broken under CONFIG_IOTHREAD. The reason is
inconsistent or even lacking signaling the debug events from the source
VCPU to the main loop and the gdbstub.

This patch addresses the issue by pushing this signaling into a
CPUDebugExcpHandler: cpu_debug_handler is registered as first handler,
thus will be executed last after potential breakpoint emulation
handlers. It sets informs the gdbstub about the debug event source,
requests a debug exit of the main loop and stops the current VCPU. This
mechanism works both for TCG and KVM, with and without IO-thread.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoRename tcg_cpu_exec and tcg_has_work
Jan Kiszka [Fri, 25 Jun 2010 14:56:55 +0000 (16:56 +0200)]
Rename tcg_cpu_exec and tcg_has_work

These functions are also used for kvm under !CONFIG_IOTHREAD, having
'tcg' in their name is just misleading.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoDrop redundant global cur_cpu variable
Jan Kiszka [Fri, 25 Jun 2010 14:56:54 +0000 (16:56 +0200)]
Drop redundant global cur_cpu variable

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoFix qemu_wait_io_event processing in io-thread mode
Jan Kiszka [Fri, 25 Jun 2010 14:56:53 +0000 (16:56 +0200)]
Fix qemu_wait_io_event processing in io-thread mode

When checking for I/O events in the tcg CPU loop, make sure that we
call qemu_wait_io_event_common for all CPUs, not only the current one.
Otherwise pause_all_vcpus may lock up or run_on_cpu requests may starve.

Rename qemu_wait_io_event to qemu_tcg_wait_io_event at this chance and
purge its argument list as it has no use for it.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoFix cpu_exit for tcp_cpu_exec
Jan Kiszka [Fri, 25 Jun 2010 14:56:52 +0000 (16:56 +0200)]
Fix cpu_exit for tcp_cpu_exec

If a cpu_exit request is pending, ensure that we leave the CPU loop
quickly. For this purpose, keep the global exit_request pending until
we are about to leave tcg_cpu_exec. Also, immediately break out of the
SMP loop if the request is set, do not run till the end of the chain.
This preserves the VCPU scheduling order in SMP mode.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoInit qemu_system_cond
Jan Kiszka [Fri, 25 Jun 2010 14:56:51 +0000 (16:56 +0200)]
Init qemu_system_cond

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoFix cpu_unlink_tb race
Jan Kiszka [Fri, 25 Jun 2010 14:56:50 +0000 (16:56 +0200)]
Fix cpu_unlink_tb race

If a signal hit after the env->exit_request check but before cpu_exec
updated env->current_tb, cpu_unlink_tb called from the signal hander
will not unlink the current TB. This may leave us stuck in a guest loop
if no further unlink is invoked.

Fix this by reordering current_tb update and exit_request check,
additionally enforcing the correct order via a compiler barrier.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoIntroduce proper compiler barrier
Jan Kiszka [Fri, 25 Jun 2010 14:56:49 +0000 (16:56 +0200)]
Introduce proper compiler barrier

Define barrier() as optimization barrier and replace (potentially
unreliable) asm("") fences.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agovirtio-serial: Fix compat property name
Amit Shah [Wed, 23 Jun 2010 17:19:20 +0000 (22:49 +0530)]
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>
13 years agolinux-user: display cpu list.
Laurent Vivier [Sun, 23 May 2010 22:35:20 +0000 (00:35 +0200)]
linux-user: display cpu list.

As it is done for qemu-system with "-cpu ?", when cpu_list_id() is missing
for a target, call cpu_list() instead.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoSparc32: reserve addresses for unimplemented devices on SS-20
Bob Breuer [Tue, 13 Jul 2010 16:05:24 +0000 (11:05 -0500)]
Sparc32: reserve addresses for unimplemented devices on SS-20

Use empty_slot to reserve addresses for several unimplemented devices so they won't fault.
 - BPP (parallel port), DBRI (audio), SX (pixel processor), and vsimms (framebuffer)
OBP for SS-20 either assumes these devices exist or probes without expecting faults.

Signed-off-by: Bob Breuer <breuerr@mc.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agovhost: fix miration during device start
Michael S. Tsirkin [Fri, 16 Jul 2010 14:11:46 +0000 (17:11 +0300)]
vhost: fix miration during device start

We need to know ring layout to allocate log buffer.
So init rings first.

Also fixes a theoretical memory-leak-on-error.

https://bugzilla.redhat.com/show_bug.cgi?id=615228

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoe1000: secrc support
Michael S. Tsirkin [Mon, 12 Jul 2010 17:41:02 +0000 (20:41 +0300)]
e1000: secrc support

Add support for secrc field. Reportedly needed by old RHEL guests.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoe1000: fix access 4 bytes beyond buffer end
Michael S. Tsirkin [Mon, 12 Jul 2010 17:24:59 +0000 (20:24 +0300)]
e1000: fix access 4 bytes beyond buffer end

We do range check for size, and get size as buffer,
but copy size + 4 bytes (4 is for FCS).
Let's copy size bytes but put size + 4 in length.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agotarget-ppc: fix power mode checking on 7400/7410
Aurelien Jarno [Sun, 18 Jul 2010 22:33:29 +0000 (00:33 +0200)]
target-ppc: fix power mode checking on 7400/7410

Only the PowerPC 7440/7450 family don't support DOZE mode. PowerPC
7400 and 7410 support it.

13 years agotarget-mips: fix xtlb exception for loongson
Aurelien Jarno [Thu, 15 Jul 2010 21:13:11 +0000 (23:13 +0200)]
target-mips: fix xtlb exception for loongson

Loongson 2E and 2F use the same entry for xtlb and tlb exception, at
offset 0x000.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoMerge remote branch 'origin/master' into staging
Anthony Liguori [Fri, 16 Jul 2010 13:01:16 +0000 (08:01 -0500)]
Merge remote branch 'origin/master' into staging

13 years agomicroblaze: Correct signal frame setup.
Edgar E. Iglesias [Thu, 15 Jul 2010 13:32:51 +0000 (15:32 +0200)]
microblaze: Correct signal frame setup.

Pass the context in r7.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agoMerge remote branch 'origin/master' into staging
Anthony Liguori [Thu, 15 Jul 2010 13:19:53 +0000 (08:19 -0500)]
Merge remote branch 'origin/master' into staging

13 years agoMerge remote branch 'kwolf/for-anthony' into staging
Anthony Liguori [Thu, 15 Jul 2010 13:17:57 +0000 (08:17 -0500)]
Merge remote branch 'kwolf/for-anthony' into staging

13 years agoMake default invocation of block drivers safer (v3)
Anthony Liguori [Wed, 14 Jul 2010 15:58:00 +0000 (10:58 -0500)]
Make default invocation of block drivers safer (v3)

CVE-2008-2004 described a vulnerability in QEMU whereas a malicious user could
trick the block probing code into accessing arbitrary files in a guest.  To
mitigate this, we added an explicit format parameter to -drive which disabling
block probing.

Fast forward to today, and the vast majority of users do not use this parameter.
libvirt does not use this by default nor does virt-manager.

Most users want block probing so we should try to make it safer.

This patch adds some logic to the raw device which attempts to detect a write
operation to the beginning of a raw device.  If the first 4 bytes happen to
match an image file that has a backing file that we support, it scrubs the
signature to all zeros.  If a user specifies an explicit format parameter, this
behavior is disabled.

I contend that while a legitimate guest could write such a signature to the
header, we would behave incorrectly anyway upon the next invocation of QEMU.
This simply changes the incorrect behavior to not involve a security
vulnerability.

I've tested this pretty extensively both in the positive and negative case.  I'm
not 100% confident in the block layer's ability to deal with zero sized writes
particularly with respect to the aio functions so some additional eyes would be
appreciated.

Even in the case of a single sector write, we have to make sure to invoked the
completion from a bottom half so just removing the zero sized write is not an
option.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agohw/bonito: remove incorrect pci_mem_base setting
Huacai Chen [Wed, 14 Jul 2010 11:51:49 +0000 (19:51 +0800)]
hw/bonito: remove incorrect pci_mem_base setting

This mistake makes PCI devices can't work correctly.

Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoqemu-options: add documentation for stdio signal=on|off
Aurelien Jarno [Tue, 13 Jul 2010 19:13:12 +0000 (21:13 +0200)]
qemu-options: add documentation for stdio signal=on|off

Commit 5989020bc11f8ba448d6fb79f4562f882a693d89 introduced a chardev
option to disable signals on stdio. Add the corresponding documentation.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoUpdate OpenBIOS images
Aurelien Jarno [Tue, 13 Jul 2010 18:09:24 +0000 (20:09 +0200)]
Update OpenBIOS images

Update PPC, Sparc32 and Sparc64 OpenBIOS images to r821.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-ppc: add vexptefp instruction
Aurelien Jarno [Mon, 9 Feb 2009 11:20:50 +0000 (12:20 +0100)]
target-ppc: add vexptefp instruction

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>