Commit graph

5974 commits

Author SHA1 Message Date
blueswir1 3990d09adf sys-queue.h defines _SYS_QUEUE_H_ which is also defined by
the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
on NetBSD, which doesn't exist in sys-queue.h. Therefore,
include <sys/queue.h> before including sys-queue.h.

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


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5885 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-05 17:53:21 +00:00
aurel32 4dd8c13803 Fix PPC PREP platform, broken by commit 5849
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5884 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-05 16:05:41 +00:00
aurel32 3476f891cc hw/ppc4xx_pci.c: kill two warnings
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5883 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-05 16:05:32 +00:00
aurel32 7487953d70 target-ppc: convert POWER shift instructions to TCG
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5882 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-05 07:21:44 +00:00
aurel32 54cdcae646 target-ppc: add functions to load/store SPR
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5881 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-05 07:21:31 +00:00
aliguori b2b183c270 do boundary check based on absolute value (Glauber Costa)
For backward operations, dstpitch and srcpitch can
be negative. This leads BLTUNSAFE macro into an
overflow, and as a result, it avoids performing
operations that are perfectly valid.

The visible effect that led to that patch was the gnome-panel
bar in Fedora10. Before this patch, you could see garbage
clobbering a big portion of the bar.

After this patch, this garbage is gone.

Signed-off-by: Glauber Costa <glommer@redhat.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5880 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 22:36:38 +00:00
aliguori 4dc822d726 Use writeback caching by default with qcow2
qcow2 writes a cluster reference count on every cluster update.  This causes
performance to crater when using anything but cache=writeback.  This is most
noticeable when using savevm.  Right now, qcow2 isn't a reliable format
regardless of the type of cache your using because metadata is not updated in
the correct order.  Considering this, I think it's somewhat reasonable to use
writeback caching by default with qcow2 files.

It at least avoids the massive performance regression for users until we sort
out the issues in qcow2. 

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5879 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 21:39:21 +00:00
aurel32 0cd2df75a2 Fix RTC initial date computation
qemu_get_clock() returns a structure containing the time the user wants
to be set (either UTC time, a local time, or a given date). Use mktimegm()
instead of mktime() to convert it into POSIX time without taking the host
timezone into account.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5878 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 21:34:52 +00:00
aliguori bb6834cfae Fix windows build after virtio changes
Windows does not have sys/uio.h and does not have err.h.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5877 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 21:28:28 +00:00
aurel32 d34ca59016 hw/apic.c: use fls() from host-utils
...and fix a bug, the implementation in hw/apic.c was wrong.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5876 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 20:57:02 +00:00
aliguori d096ab91c9 Add missing file from previous commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5875 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 20:35:16 +00:00
aliguori bd3220870f Add virtio-balloon support
This adds a VirtIO based balloon driver.  It uses madvise() to actually balloon
the memory when possible.

Until 2.6.27, KVM forced memory pinning so we must disable ballooning unless the
kernel actually supports it when using KVM.  It's always safe when using TCG.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5874 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 20:33:06 +00:00
aliguori df751fa8bf Add ballooning infrastructure.
Balloon devices allow you to ask the guest to allocate memory.  This allows you
to release that memory.  It's mostly useful for freeing up large chunks of
memory from cooperative guests.

Ballooning is supported by both Xen and VirtIO.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5873 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 20:19:35 +00:00
aliguori 8d371d4bce Define fls() in terms of clz32().
As suggested by Laurent Desnogues.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5872 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 20:08:06 +00:00
aliguori f46f15bca7 Remove TARGET_PAGE_SIZE from virtio interface (Hollis Blanchard)
TARGET_PAGE_SIZE should only be used internal to qemu, not in guest/host
interfaces. The virtio frontend code in Linux uses two constants (PFN shift
and vring alignment) for the interface, so update qemu to match.

I've tested this with PowerPC KVM and confirmed that it fixes virtio problems
when using non-TARGET_PAGE_SIZE pages in the guest.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5871 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 19:58:45 +00:00
aliguori 6e02c38dad Add virtio-blk support
Virtio-blk is a paravirtual block device based on VirtIO.  It can be used by
specifying the if=virtio parameter to the -drive parameter.

When using -enable-kvm, it can achieve very good performance compared to IDE or
SCSI.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5870 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 19:52:44 +00:00
aliguori 967f97fa00 Virtio core support
This patch adds core support for VirtIO.  VirtIO is a paravirtualization
framework that has been in Linux since 2.6.21.  A PCI transport has been
available since 2.6.25.  Network drivers are also available for Windows.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5869 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 19:38:57 +00:00
aliguori b39ade83c2 Introduce fls() helper
This is needed for virtio.  The implementation is originally from 
Marcelo Tosatti.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5868 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 19:19:45 +00:00
malc 9b3469cc9a Clarify -soundhw documentation as to avoid hda confusion
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5867 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 18:01:26 +00:00
malc d08c4d34a0 Update
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5866 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-04 11:29:42 +00:00
malc cee83d9135 Silence warnings generated due to `#if BUILD_Y8950'
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5865 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-03 23:00:35 +00:00
malc 1ea879e558 Make audio violate POSIX less
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5864 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-03 22:48:44 +00:00
blueswir1 8b0de438d4 More consistent PAGE_xxx defines, avoid conflicting with system PAGE_xxx
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5863 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-03 16:29:47 +00:00
aurel32 825bb581b4 IBM PowerPC 4xx 32-bit PCI controller emulation
This PCI controller can be found on a number of 4xx SoCs, including the 440EP.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5862 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 23:53:50 +00:00
aliguori e976c6a1e4 Change order of metadata update to prevent loosing guest data because of unexpected exit (Gleb Natapov)
Currently the order is this (during cow since it's the interesting case):
1. Decrement refcount of old clusters
2. Increment refcount for newly allocated clusters
3. Copy content of old sectors that will not be rewritten
4. Update L2 table with pointers to new clusters
5. Write guest data into new clusters (asynchronously)

There are several problems with this order. The first one is that if qemu
crashes (or killed or host reboots) after new clusters are linked into L2
table but before user data is written there, then on the next reboot guest
will find neither old data nor new one in those sectors and this is not
what gust expects even when journaling file system is in use.  The other
problem is that if qemu is killed between steps 1 and 4 then refcount
of old cluster will be incorrect and may cause snapshot corruption.

The patch change the order to be like this:
1. Increment refcount for newly allocated clusters
2. Write guest data into new clusters (asynchronously)
3. Copy content of old sectors that were not rewritten
4. Update L2 table with pointers to new clusters
5. Decrement refcount of old clusters

Unexpected crash may cause cluster leakage, but guest data should be safe.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5861 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 20:14:05 +00:00
aliguori 6db6c63826 Cleanup {alloc|get}_cluster_offset() (Gleb Natapov)
Move duplicated code into helper functions.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5860 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 20:11:27 +00:00
aliguori 643e5399bb Write table offset and size in one syscall (Gleb Natapov)
Otherwise if VM is killed between two writes data may be lost.
But if offset and size fields are at the same disk block one
write should update them both simultaneously.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5859 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 20:10:14 +00:00
aliguori a32ef786f4 Introduce new helper function qcow_shedule_bh() (Gleb Natapov)
Use it to remove code duplications from qcow_aio_read_cb().

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5858 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 20:08:04 +00:00
aliguori ac67488746 Remove tabs from qcow_aio_read_cb(). (Gleb Natapov)
Fix indentation.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5857 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 20:06:51 +00:00
aliguori 4a55bfdfcf Exclude unix: from vnc call to unix_listen() (Ryan Harper)
When using an existing unix socket like:

 -vnc unix:/tmp/file1Y2nY2

qemu fails to bind a unix socket because the vnc call to unix_listen includes
the unix: prefix and stores that in the unix.sun_path.  The fix is to not pass
in unix: for the filename (same way qemu-char.c does it).

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5856 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 20:02:14 +00:00
aliguori d4b55be509 Fix register name typo in dumping debug registers (Jan Kiszka)
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5855 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 19:40:26 +00:00
blueswir1 a8f48dcc7c Remove address masking after some rearranging
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5854 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 17:51:19 +00:00
blueswir1 e64d7d595f Remove address masking
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5853 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 17:47:02 +00:00
pbrook 0e8f096751 Cosmetic cleanups to previous patch.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5852 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-02 09:02:15 +00:00
malc 53762ddb27 Reset the key modifiers upon client connect
VNC should not maintain modifer state upon reconnects With some window
managers/vnc clients it will only see a key down event for a modifier
followed by immediate disconnect(think Alt-F4), with a net effect of
subsequently connected clients operating as if the modifier was never
released.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5851 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 20:57:52 +00:00
malc 429a8ed384 Add basic audio functionality to vnc.c
This allows among other things to capturing A/V of running
guests. Ad-hoc client that does this (via script that invokes ffmpeg)
can be found at:
http://repo.or.cz/w/qemu/malc.git?a=tree;f=vcap;hb=capture3

Thanks to Anthony Liguori for comments and review.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5850 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 20:57:48 +00:00
pbrook 8da3ff1809 Change MMIO callbacks to use offsets, not absolute addresses.
Signed-off-by: Paul Brook <paul@codesourcery.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5849 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 18:59:50 +00:00
pbrook 6ad1d22b15 Allocate cleared memory for cpu state.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5848 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 14:29:13 +00:00
balrog 0c9c3a9e3a arm: Don't potentially overwrite input registers in add2, sub2.
According to malc TCG will often genereate an add2/sub2/mul2 with low
half of the output in the same register as high half of one of the
inputs, so account for that.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5847 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 11:57:21 +00:00
balrog 63d412465b Fix the comment added in r5844.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5846 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 02:19:41 +00:00
balrog fe33867b0d Don't rely on ARM tcg_out_goto() generating just a single insn.
Otherwise when tb_exit generates a jump beyond the pc-relative range,
tcg_out_goto() spans two/three instructions and we load the tb return
value from a wrong address.  This is #ifdefed out currently because
we take care for the jumps to be local.
Problem spotted by Steffen Liebergeld.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5845 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 02:17:12 +00:00
balrog 1cb0661e00 arm: Reserve code buffer in memory range reachable for pc-relative branch.
Unfortunately this range is so narrow that I'm not sure if it makes more
sense to always use memory load to pc kind of branch instead.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5844 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 02:10:17 +00:00
balrog 3233f0d463 Use libgcc __clear_cache to clean icache, when available.
Calling the clear cache syscall directly generates an illegal instruction 
on some (armv4) kernels.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5843 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 02:02:37 +00:00
balrog 80fe30ed34 Fix a typo preventing GNUC builtins usage.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5842 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 01:53:55 +00:00
balrog dcfd12b83e Fix pmovsx* / pmovzx* SSE instructions (original fix by Frank Mehnert).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5841 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 01:52:37 +00:00
balrog d0513623ae Don't try to select on an invalid VNC socket when init fails.
Otherwise we get a segfault.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5840 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-01 01:48:36 +00:00
aurel32 137519ce2e qemu-img: open files with cache=writeback
Data integrity is not important in qemu-img, so open the files with
cache=writeback. This fixes the performance regression seen with qemu-img
since revision 5485, and most particularly with the qcow2 format.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5839 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-30 19:12:49 +00:00
aurel32 b8dbdddc9e target-ppc: remove unused file op_mem_access.h
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5838 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-30 17:54:28 +00:00
aurel32 dcc532c809 target-ppc: use ldl/ldub/stl/stub for load/store in op_helper.c
Should not give any performance penality given cpu_mmu_index() is
an inline function returning a value from env.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5837 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-30 17:54:21 +00:00
aurel32 ef0d51af1e target-ppc: convert PPC 440 instructions to TCG
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5836 c046a42c-6fe2-441c-8c8c-71466251a162
2008-11-30 17:26:29 +00:00