sdk/emulator/qemu.git
15 years agokvm: de-register mem region for MMIO (Glauber Costa)
aliguori [Wed, 19 Nov 2008 15:09:54 +0000 (15:09 +0000)]
kvm: de-register mem region for MMIO (Glauber Costa)

Besides unassigned memory, we also don't care about MMIO.
So if we're giving an MMIO area that is already registered,
wipe it out.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5753 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix media detection on emulated CDROM (Gary Grebus)
aliguori [Wed, 19 Nov 2008 15:03:36 +0000 (15:03 +0000)]
Fix media detection on emulated CDROM (Gary Grebus)

This patch tweaks the ATAPI CDROM emulation to fix an annoyance seen
when running a variety of Linux guests: the desktop GUI shows a CDROM
device as present, but is unable to automount the media and display its
contents.

The patch adds the PLAY_AUDIO capability bit to the data returned by
MODE_SENSE commands.  That convinces the guest kernel to determine what
kind of media is present.

Arguably Linux could be smarter about this, but it's my guess there are
few (if any) hardware CDROM drives that don't set the bit, and there are
a large number of Linux distros that exhibit this problem.

Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5752 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoOnly force inlining when optimizing.
pbrook [Wed, 19 Nov 2008 01:31:52 +0000 (01:31 +0000)]
Only force inlining when optimizing.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5751 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd 40-bit DMA support to LSI scsi emulation (Ryan Harper)
aliguori [Tue, 18 Nov 2008 22:00:43 +0000 (22:00 +0000)]
Add 40-bit DMA support to LSI scsi emulation (Ryan Harper)

This patch fixes Linux machines configured with > 4G of ram and using a
SCSI device.

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@5750 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix Windows build
aliguori [Tue, 18 Nov 2008 21:52:54 +0000 (21:52 +0000)]
Fix Windows build

ENOBUFS is not defined on Win32.  Use ENOMEM instead which is more portable.

This was reported by HervĂ© Poussineau.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5749 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agox86: Dump debug registers (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 21:09:47 +0000 (21:09 +0000)]
x86: Dump debug registers (Jan Kiszka)

As the debug registers are no longer dummies, let's include their
current state into the 'info registers' output and other register dumps.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5748 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agox86: Debug register emulation (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 21:08:15 +0000 (21:08 +0000)]
x86: Debug register emulation (Jan Kiszka)

Built on top of previously enhanced breakpoint/watchpoint support, this
patch adds full debug register emulation for the x86 architecture.

Many corner cases were considered, and the result was successfully
tested inside a Linux guest with gdb, but I won't be surprised if one
or two scenarios still behave differently in reality.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5747 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoIntroduce BP_CPU as a breakpoint type (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 20:56:59 +0000 (20:56 +0000)]
Introduce BP_CPU as a breakpoint type (Jan Kiszka)

Add another breakpoint/watchpoint type to BP_GDB: BP_CPU. This type is
intended for hardware-assisted break/watchpoint emulations like the x86
architecture requires.

To keep the highest priority for BP_GDB breakpoints, this type is
always inserted at the head of break/watchpoint lists, thus is found
first when looking up the origin of a debug interruption.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5746 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd debug exception hook (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 20:50:36 +0000 (20:50 +0000)]
Add debug exception hook (Jan Kiszka)

This patch allows to hook into the delivery of EXCP_DEBUG so that other
use beyond guest debugging becomes possible.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5745 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoIntroduce BP_WATCHPOINT_HIT flag (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 20:37:55 +0000 (20:37 +0000)]
Introduce BP_WATCHPOINT_HIT flag (Jan Kiszka)

When one watchpoint is hit, others might have triggered as well. To
support users of the watchpoint API which need to detect such cases,
the BP_WATCHPOINT_HIT flag is introduced and maintained.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5744 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agogdbstub: manage CPUs as threads (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 20:30:24 +0000 (20:30 +0000)]
gdbstub: manage CPUs as threads (Jan Kiszka)

This patch enhances QEMU's built-in debugger for SMP guest debugging.
Using the thread support of the gdb remote protocol, each VCPU is mapped
on a pseudo thread and exposed to the gdb frontend. This way you can
easy switch the focus of gdb between the VCPUs and observe their states.
On breakpoint hit, the focus is automatically adjusted just as for
normal multi-threaded application under gdb control.

Furthermore, the patch propagates breakpoint and watchpoint insertions
or removals to all CPUs, not just the current one as it was the case so
far. Without this, SMP guest debugging was practically unfeasible.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5743 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove premature memop TB terminations (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 20:26:41 +0000 (20:26 +0000)]
Remove premature memop TB terminations (Jan Kiszka)

Now that we can properly restore the pc on watchpoint hits, there is no
more need for prematurely terminating TBs if watchpoints are present.
Remove all related bits.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5742 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRestore pc on watchpoint hits (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 20:24:06 +0000 (20:24 +0000)]
Restore pc on watchpoint hits (Jan Kiszka)

In order to provide accurate information about the triggering
instruction, this patch adds the required bits to restore the pc if the
access happened inside a TB. With the BP_STOP_BEFORE_ACCESS flag, the
watchpoint user can control if the debug trap should be issued on or
after the accessing instruction.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5741 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRespect length of watchpoints (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 20:14:20 +0000 (20:14 +0000)]
Respect length of watchpoints (Jan Kiszka)

This adds length support for watchpoints. To keep things simple, only
aligned watchpoints are accepted.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5740 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSet mem_io_vaddr on io_read (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 20:09:43 +0000 (20:09 +0000)]
Set mem_io_vaddr on io_read (Jan Kiszka)

Analogously to write accesses, we have to save the memory address also
on read accesses in order to support read watchpoints.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5739 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRefactor and enhance break/watchpoint API (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 20:07:32 +0000 (20:07 +0000)]
Refactor and enhance break/watchpoint API (Jan Kiszka)

This patch prepares the QEMU cpu_watchpoint/breakpoint API to allow the
succeeding enhancements this series comes with.

First of all, it overcomes MAX_BREAKPOINTS/MAX_WATCHPOINTS by switching
to dynamically allocated data structures that are kept in linked lists.
This also allows to return a stable reference to the related objects,
required for later introduced x86 debug register support.

Breakpoints and watchpoints are stored with their full information set
and an additional flag field that makes them easily extensible for use
beyond pure guest debugging.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5738 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agogdbstub: Return appropriate watch message to gdb (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 19:55:44 +0000 (19:55 +0000)]
gdbstub: Return appropriate watch message to gdb (Jan Kiszka)

Return the appropriate type prefix (r, a, none) when reporting
watchpoint hits to the gdb front-end.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5737 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRefactor translation block CPU state handling (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 19:46:41 +0000 (19:46 +0000)]
Refactor translation block CPU state handling (Jan Kiszka)

This patch refactors the way the CPU state is handled that is associated
with a TB. The basic motivation is to move more arch specific code out
of generic files. Specifically the long #ifdef clutter in tb_find_fast()
has to be overcome in order to avoid duplicating it for the gdb
watchpoint fixes (patch "Restore pc on watchpoint hits").

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5736 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoConvert CPU_PC_FROM_TB to static inline (Jan Kiszka)
aliguori [Tue, 18 Nov 2008 19:36:03 +0000 (19:36 +0000)]
Convert CPU_PC_FROM_TB to static inline (Jan Kiszka)

as macros should be avoided when possible.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5735 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMake KVM slot management more robust
aliguori [Tue, 18 Nov 2008 15:41:18 +0000 (15:41 +0000)]
Make KVM slot management more robust

KVM keeps track of physical memory based on slots in the kernel.  The current
code that translates QEMU memory mappings to slots work but is not robust
in the fact of reregistering partial regions of memory.

This patch does the right thing for reregistering partial regions of memory.  It
also prevents QEMU from using KVM private slots.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5734 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: fix regression introduced by commit 5729
aurel32 [Tue, 18 Nov 2008 09:32:01 +0000 (09:32 +0000)]
target-ppc: fix regression introduced by commit 5729

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5733 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoPreliminary AIX support
malc [Tue, 18 Nov 2008 01:42:22 +0000 (01:42 +0000)]
Preliminary AIX support

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5732 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAIX's assembler does not support local labels, use relative addressing instead
malc [Tue, 18 Nov 2008 01:42:17 +0000 (01:42 +0000)]
AIX's assembler does not support local labels, use relative addressing instead

(Laurent Vivier)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5731 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUse qemu_memalign instead of memalign in qemu_vmalloc
malc [Tue, 18 Nov 2008 01:42:15 +0000 (01:42 +0000)]
Use qemu_memalign instead of memalign in qemu_vmalloc

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5730 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoTCG variable type checking.
pbrook [Mon, 17 Nov 2008 14:43:54 +0000 (14:43 +0000)]
TCG variable type checking.

Signed-off-by: Paul Brook <paul@codesourcery.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5729 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-i386: fix helper_pmovmskb_mmx helper
aurel32 [Sun, 16 Nov 2008 19:15:15 +0000 (19:15 +0000)]
target-i386: fix helper_pmovmskb_mmx helper

(malc)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5728 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAttached patch fixes a series of this warning
blueswir1 [Sun, 16 Nov 2008 13:53:32 +0000 (13:53 +0000)]
Attached patch fixes a series of this warning
when compiling on NetBSD:

warning: array subscript has type 'char'

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5727 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUse correct trap for syscalls on Sparc32
blueswir1 [Sun, 16 Nov 2008 11:38:43 +0000 (11:38 +0000)]
Use correct trap for syscalls on Sparc32

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5726 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix warnings caused by timer_t, it is 32 bits on Sparc64
blueswir1 [Sun, 16 Nov 2008 11:37:18 +0000 (11:37 +0000)]
Fix warnings caused by timer_t, it is 32 bits on Sparc64

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5725 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix no_frame unused warning when SDL is disabled
blueswir1 [Sun, 16 Nov 2008 11:34:07 +0000 (11:34 +0000)]
Fix no_frame unused warning when SDL is disabled

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5724 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: avoid tcg internal error in mfc0/dmfc0
aurel32 [Sat, 15 Nov 2008 12:12:08 +0000 (12:12 +0000)]
target-mips: avoid tcg internal error in mfc0/dmfc0

Set t0 to 0 for unimplemented mfc0/dmfc0 instructions. This fixes a tcg
internal error while booting mips linux.

Noticed by Julia Longtin.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5723 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-alpha: implement getxuid and getxgid syscalls
aurel32 [Fri, 14 Nov 2008 17:20:15 +0000 (17:20 +0000)]
target-alpha: implement getxuid and getxgid syscalls

This patch implemented the setxuid and setxgid syscalls for Alpha.
These syscalls return two values, both uid/euid and gid/egid.
In addition to returning the first value in $v0, the additional
value is returned in the $a4 register.

The syscalls are used instead of the separate syscalls for those values
used on other architectures (this is probably because Alpha Linux started
out syscall compatible with DEC/OSF/Tru64).

With this patch, the perlbmk benchmarks from Spec2000 run properly.

(Vince Weaver)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5722 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoppc-linux-user: handle EXCP_DEBUG
aurel32 [Fri, 14 Nov 2008 17:05:54 +0000 (17:05 +0000)]
ppc-linux-user: handle EXCP_DEBUG

Replace POWERPC_EXCP_DEBUG by EXCP_DEBUG as the former can not happen in
user mode emulation, while the later can happen and should be handled.

Noticed by Andrew Stubbs.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5721 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoETRAX-FS: Don't schedule DMA processing without active channels.
edgar_igl [Thu, 13 Nov 2008 21:33:08 +0000 (21:33 +0000)]
ETRAX-FS: Don't schedule DMA processing without active channels.

Avoid scheduling DMA processing when all channels are stopped or at
end-of-list.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5720 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoETRAX-FS: Fix a segfault if pflash drive not found.
edgar_igl [Thu, 13 Nov 2008 21:10:25 +0000 (21:10 +0000)]
ETRAX-FS: Fix a segfault if pflash drive not found.

drive_get_index() returns -1 if a drive isn't found; don't
use -1 to index drives_table.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5719 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agox86: fix warning without CONFIG_KVM (Mark McLoughlin)
aliguori [Thu, 13 Nov 2008 19:37:46 +0000 (19:37 +0000)]
x86: fix warning without CONFIG_KVM (Mark McLoughlin)

Warning is:

 target-i386/helper.c: In function `cpu_x86_cpuid':
 target-i386/helper.c:1373: warning: implicit declaration of function `host_cpuid'

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5718 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix CPUID ext2 features masking (Avi Kivity)
aliguori [Thu, 13 Nov 2008 19:28:04 +0000 (19:28 +0000)]
Fix CPUID ext2 features masking (Avi Kivity)

Typo. Exposes rdtscp which kills some guests.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5717 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoblock: make raw aio signaling non-blocking (Gerd Hoffman)
aliguori [Thu, 13 Nov 2008 19:23:17 +0000 (19:23 +0000)]
block: make raw aio signaling non-blocking (Gerd Hoffman)

This patch switches the read handle of the signaling pipe into
non-blocking mode.  This avoids unwanted blocking reads and also
allows to read all bytes out of the signaling pipe in case we got
signaled more that once before the handler ran.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5716 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoDefine kvm_ioctl in the same way as ioctl
aliguori [Thu, 13 Nov 2008 19:21:00 +0000 (19:21 +0000)]
Define kvm_ioctl in the same way as ioctl

The third argument to ioctl is a ... which allows any value to be passed.  In
practice, glibc always treats the argument as a void *.

Do the same thing for the kvm ioctls to keep things consistent with a
traditional ioctl.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5715 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agocopyright & license for qemu_sockets.c (Gerd Hoffman)
aliguori [Thu, 13 Nov 2008 16:19:54 +0000 (16:19 +0000)]
copyright & license for qemu_sockets.c (Gerd Hoffman)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5714 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix brown-paper-bag bugs from live-migration patch (Charles Duffy)
aliguori [Wed, 12 Nov 2008 22:29:11 +0000 (22:29 +0000)]
Fix brown-paper-bag bugs from live-migration patch (Charles Duffy)

In TCP migration, prevent an endless loop trying to retrieve error status. In
exec migration, set the close pointer in the FdMigrationState structure.

Color me embarrassed.

Signed-off-by: Charles Duffy <charles_duffy@messageone.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5713 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRename hz to hertz to keep AIX happy
malc [Wed, 12 Nov 2008 20:36:27 +0000 (20:36 +0000)]
Rename hz to hertz to keep AIX happy

The issue was first noticed/addressed by Laurent Vivier in his QEMU on
AIX patches.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5712 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRename misnamed BACK_CHAIN_OFFSET to LR_OFFSET
malc [Wed, 12 Nov 2008 20:36:24 +0000 (20:36 +0000)]
Rename misnamed BACK_CHAIN_OFFSET to LR_OFFSET

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5711 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAvoid compiler warning
malc [Wed, 12 Nov 2008 20:36:21 +0000 (20:36 +0000)]
Avoid compiler warning

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5710 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoDon't use "hz" in identifiers to make AIX happy.
balrog [Wed, 12 Nov 2008 17:36:08 +0000 (17:36 +0000)]
Don't use "hz" in identifiers to make AIX happy.

malc found AIX headers leak "hz" and so it can't be used there.  Change
the occurences in hw/.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5709 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoInclude <strings.h> for ffs().
balrog [Wed, 12 Nov 2008 17:18:41 +0000 (17:18 +0000)]
Include <strings.h> for ffs().

ffs() is in <strings.h> although bsd compatible systems have it in
<string.h> already.  ffs() is used in omap1.c, omap2.c, omap_i2c.c,
bt-sdp.c.  These uses can be replaced with clz32() but ffs is more
available.  Problem was spotted by malc.

Make host-utils.h formatting more consistent.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5708 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agor5531 made x509 certs not loadable (original patch from Henrik Holst).
balrog [Wed, 12 Nov 2008 16:50:36 +0000 (16:50 +0000)]
r5531 made x509 certs not loadable (original patch from Henrik Holst).

The patch in r5531 which replaced a bunch of strncpy with pstrcpy causes
the x509 credentials from the -vnc parameter to be one character shorter
than entered meaning that there is currently no way to enter x509
certificates...

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5707 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoImplement LSI53C895A quirks exposed by OpenServer (Justin Chevrier).
balrog [Wed, 12 Nov 2008 16:41:32 +0000 (16:41 +0000)]
Implement LSI53C895A quirks exposed by OpenServer (Justin Chevrier).

After going through the debug log and scratching my head for quite some
time. I found the following:

The problem was with this block move:

lsi_scsi: SCRIPTS dsp=0fae8e50 opcode 01000028 arg 00f63c40
lsi_scsi: DMA addr=0x00f63c40 len=36

The number of bytes to be transferred (len) should be 40 which corresponds
to the block transfer of length 0x28 (from opcode 01000028). Instead we
have a length of 36 (0x24). The code responsible for this is (in
'lsi_do_dma'):

if (count > s->current_dma_len)
   count = s->current_dma_len;

Basically we're overwriting the length 40 with the value 36 which I
think we just left over in that variable from an earlier transfer. In my
patch below I initialize s->current_dma_len to s->dbc before we begin
the DMA transfer during Data In phase.

The attached patch gets Openserver 5.0.5 past the hardware detection
(and it lists the hard drive to boot, woohoo). It appears to stop a
little while later (doesn't seem SCSI related), but it's been so long since
I've booted Openserver I'm not sure what's supposted to happen after the HW
detection using the boot/root disks.

Props go to Craig Ringer for the initial post and the code that he posted
some of which is in this patch.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5706 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agofix some variable initizalization issues (Stefano Stabellini)
aliguori [Wed, 12 Nov 2008 15:00:36 +0000 (15:00 +0000)]
fix some variable initizalization issues (Stefano Stabellini)

this patch fixes two variable initialization issues.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5705 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-alpha: fix termbits and target IOC macros
aurel32 [Wed, 12 Nov 2008 10:01:12 +0000 (10:01 +0000)]
target-alpha: fix termbits and target IOC macros

This patch fixes the two following problems for Alpha linux-user:
   - termbits.h is incorrectly using host IOC macros and structures
   - IOC bitfields sizes are incorrectly set

This patch corrects the ioctl TCGETS done by isatty function call
on Alpha (when running SPEC crafty for instance).

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5704 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix -linux-user build by reverting r5701
aliguori [Tue, 11 Nov 2008 22:06:42 +0000 (22:06 +0000)]
Fix -linux-user build by reverting r5701

Unfortunately, -linux-user doesn't use osdep as it replaces some of those
functions with specific ones.  The code #ifdef code in exec.c needs to
remain in place so instead of introducing a qemu_getpagesize() let's just
use getpagesize() in the non-Windows implementation of qemu_vmalloc.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5703 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAllocate guest memory on host page boundaries (Hollis Blanchard)
aliguori [Tue, 11 Nov 2008 21:50:17 +0000 (21:50 +0000)]
Allocate guest memory on host page boundaries (Hollis Blanchard)

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5702 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoDefine OS-dependent qemu_getpagesize() (Hollis Blanchard)
aliguori [Tue, 11 Nov 2008 21:48:59 +0000 (21:48 +0000)]
Define OS-dependent qemu_getpagesize() (Hollis Blanchard)

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5701 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSplit savevm code into savevm.c
aliguori [Tue, 11 Nov 2008 21:33:36 +0000 (21:33 +0000)]
Split savevm code into savevm.c

This is pure code motion.  The savevm code is all common code so we can build
it once and share the object with all executables.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5700 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMove the things that aren't target specific to libqemu_common.a.
aliguori [Tue, 11 Nov 2008 21:20:14 +0000 (21:20 +0000)]
Move the things that aren't target specific to libqemu_common.a.

This will improve the build time.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5699 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agowindows cdrom cache flush (Stefano Stabellini)
aliguori [Tue, 11 Nov 2008 20:57:30 +0000 (20:57 +0000)]
windows cdrom cache flush (Stefano Stabellini)

Windows only flushes its cache of a CDROM if it gets a
SENSE_UNIT_ATTENTION CHECK_CONDITION response to a REQUEST_SENSE
command.
Make sure it does so after we change the CD.

Tab damage fixed by Anthony Liguori

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5698 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agosockets: switch over tcp/telnet/unix serial line to new helper functions (Gerd Hoffman)
aliguori [Tue, 11 Nov 2008 20:54:09 +0000 (20:54 +0000)]
sockets: switch over tcp/telnet/unix serial line to new helper functions (Gerd Hoffman)

This switches the tcp, telnet and unix socket support for character
devices (serial/parallel, ...) to the new socket helpers.  Thereby they
gain IPv6 support and also get ability to search for a free tcp port.
Syntax is the same as for vnc, using a to= option, like this:

-serial tcp:localhost:5000,to=5099,server

This will check the 5000 -> 5099 port range (inclusive) for a free tcp
port.  Likewise you can get auto-allocated unix sockets by specifying an
empty path:

-serial unix:,server

qemu will create a randomly named socket in $TMPDIR then.

tcp also got new "ipv4" and "ipv6" options to make qemu try only the
specified internet protocol version.

You can use the "info chardev" command added by the first patch in this
series to figure the tcp port / unix socket actually allocated.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5697 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agosockets: switch vnc to new code, support vnc port auto-allocation (Gerd Hoffman)
aliguori [Tue, 11 Nov 2008 20:51:59 +0000 (20:51 +0000)]
sockets: switch vnc to new code, support vnc port auto-allocation (Gerd Hoffman)

This patch switches the vnc code ofer to the new socket helper
functions.

It adds support IPv6 support and for automatically allocating an unused
vnc display port.  The latter is handled ising a to= option, specifying
the upper limit for the display number to try.  Scanning is started at
the display number given in the display specification, i.e. this command
line:

    -vnc localhost:7,to=11

will try displays 7 to 11 (inclusive).

There are also new "ipv4" and "ipv6" options to make qemu try only
the specified internet protocol version.

The display actually allocated can be queried using the "info vnc"
monitor command.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5696 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agosockets: helper functions for qemu (Gerd Hoffman)
aliguori [Tue, 11 Nov 2008 20:46:40 +0000 (20:46 +0000)]
sockets: helper functions for qemu (Gerd Hoffman)

This patch creates a new source file qemu-sockets.c with a bunch of
helper functions to create listening and connected sockets.

New features of this code are (a) support for searching for a free
port in a given range and (b) support for IPv6.

The following patches put that code into use.

Compile fixes for Windows added by Anthony Liguori

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5695 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoReintroduce migrate-to-exec: support (Charles Duffy)
aliguori [Tue, 11 Nov 2008 16:46:33 +0000 (16:46 +0000)]
Reintroduce migrate-to-exec: support (Charles Duffy)

KVM's live migration support included support for exec: URLs, allowing system
state to be written or received via an arbitrary popen()ed subprocess. This
provides a convenient way to pipe state through a compression algorithm or an
arbitrary network transport on its way to its destination, and a convenient way
to write state to disk; libvirt's qemu driver currently uses migration to exec:
targets for this latter purpose.

This version of the patch refactors now-common code from migrate-tcp.c into
migrate.c.

Signed-off-by: Charles Duffy <Charles_Duffy@messageone.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5694 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-alpha: fix decoding of CVTST /S
aurel32 [Tue, 11 Nov 2008 13:54:54 +0000 (13:54 +0000)]
target-alpha: fix decoding of CVTST /S

This patch fixes the decoding of CVTST /S which was
incorrectly being decoded as CVTTS.

This fixes SPEC2000 gcc with 200.i input.

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5693 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-alpha: fix syscall error check
aurel32 [Tue, 11 Nov 2008 13:42:22 +0000 (13:42 +0000)]
target-alpha: fix syscall error check

(re-add commit 5689)

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5692 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoRevert commits 5685 to 5688 committed by mistake
aurel32 [Tue, 11 Nov 2008 13:41:01 +0000 (13:41 +0000)]
Revert commits 5685 to 5688 committed by mistake

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5691 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-alpha: disable single stepping and TB flush by default
aurel32 [Tue, 11 Nov 2008 13:31:10 +0000 (13:31 +0000)]
target-alpha: disable single stepping and TB flush by default

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5690 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-alpha: fix syscall error check
aurel32 [Tue, 11 Nov 2008 13:31:01 +0000 (13:31 +0000)]
target-alpha: fix syscall error check

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5689 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoqemu: generate signals on tap I/O
aurel32 [Tue, 11 Nov 2008 13:30:53 +0000 (13:30 +0000)]
qemu: generate signals on tap I/O

Currently tap does not generate signals on I/O; this causes
network latency to be dependent on the timer tick (1ms without
dyntick, guest dependent with dyntick).  By generating a signal
on I/O, we can inform the guest immediately that a packet has
arrived.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5688 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoUse HOST_CC instead of CC on TCG only targets
aurel32 [Tue, 11 Nov 2008 13:30:45 +0000 (13:30 +0000)]
Use HOST_CC instead of CC on TCG only targets

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5687 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoDon't stop translation for mtc0 compare
aurel32 [Tue, 11 Nov 2008 13:30:37 +0000 (13:30 +0000)]
Don't stop translation for mtc0 compare

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5686 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoDisable debug code for production.
aurel32 [Tue, 11 Nov 2008 13:30:24 +0000 (13:30 +0000)]
Disable debug code for production.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5685 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: gen_compute_branch1()
aurel32 [Tue, 11 Nov 2008 11:50:51 +0000 (11:50 +0000)]
target-mips: gen_compute_branch1()

Optimize code generation in gen_compute_branch1():
- Directly use I32 variables instead of converting values from _tl to
  _i32 and back to _tl.
- Write the result directly to bcond instead of passing by a local
  variable.
- Temp variables are valid up to and *including* the brcond instruction.
  Use them instead of temp local variables.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5684 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: optimize movc*()
aurel32 [Tue, 11 Nov 2008 11:50:43 +0000 (11:50 +0000)]
target-mips: optimize movc*()

Optimize code generation in gen_movc*():
- Temp variables are valid up to and *including* the brcond instruction.
  Use them instead of temp local variables.
- Avoid using temporary variables to transfer values.
- Access fpu_fcr31 directly in gen_movcf_ps().

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5683 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: optimize gen_farith()
aurel32 [Tue, 11 Nov 2008 11:50:33 +0000 (11:50 +0000)]
target-mips: optimize gen_farith()

Optimize code generation in gen_farith():
- Temp variables are valid up to and *including* the brcond instruction.
  Use them instead of temp local variables.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5682 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: optimize gen_muldiv()
aurel32 [Tue, 11 Nov 2008 11:50:25 +0000 (11:50 +0000)]
target-mips: optimize gen_muldiv()

Optimize code generation in gen_muldiv():
- Don't do sign extension when the value is already guaranteed to be
  sign extended (otherwise, results are marked as UNPREDICTABLE).
- Access the LO, HI registers directly instead of writting them through
  a temporary variable.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5681 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: optimize gen_arith()/gen_arith_imm()
aurel32 [Tue, 11 Nov 2008 11:50:17 +0000 (11:50 +0000)]
target-mips: optimize gen_arith()/gen_arith_imm()

Optimize code generation in gen_arith()/gen_arith_imm():
- Don't do sign extension when the value is already guaranteed to be
  sign extended (otherwise, results are marked as UNPREDICTABLE).
- When the value is sign extended, compare the value to 0 instead of
  testing bit 31/63.
- Temp variables are valid up to and *including* the brcond instruction.
  Use them instead of temp local variables.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5680 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: convert bit shuffle ops to TCG
aurel32 [Tue, 11 Nov 2008 11:47:06 +0000 (11:47 +0000)]
target-mips: convert bit shuffle ops to TCG

Bit shuffle operations can be written with very few TCG instructions
(between 5 and 8), so it is worth converting them to TCG.

This code also move all bit shuffle generation code to a separate
function in order to have a cleaner exception code path, that is it
doesn't store back the TCG register to the target register after the
exception, as the TCG register doesn't exist anymore.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5679 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: convert bitfield ops to TCG
aurel32 [Tue, 11 Nov 2008 11:46:58 +0000 (11:46 +0000)]
target-mips: convert bitfield ops to TCG

Bitfield operations can be written with very few TCG instructions
(between 2 and 5), so it is worth converting them to TCG.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5678 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: optimize gen_op_addr_add() (2/2)
aurel32 [Tue, 11 Nov 2008 11:39:33 +0000 (11:39 +0000)]
target-mips: optimize gen_op_addr_add() (2/2)

Instead of dynamically generating different code depending on the UX
flag, add a new flag in ctx->flags to generate different code.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5677 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: optimize gen_op_addr_add() (1/2)
aurel32 [Tue, 11 Nov 2008 11:36:52 +0000 (11:36 +0000)]
target-mips: optimize gen_op_addr_add() (1/2)

The user mode can be tested at translation time using ctx->hflags.
This simplifies gen_op_addr_add().

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5676 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: optimize gen_save_pc()
aurel32 [Tue, 11 Nov 2008 11:36:04 +0000 (11:36 +0000)]
target-mips: optimize gen_save_pc()

We obviously don't need to use a temporary variable to write PC.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5675 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: fix mft* helpers/call
aurel32 [Tue, 11 Nov 2008 11:34:39 +0000 (11:34 +0000)]
target-mips: fix mft* helpers/call

This patch attempts to fix mft* helpers and the associated TCG calls.
mft* helpers do not take a register in argument, however:
- some helpers are called with an argument while they do not take one.
- some helpers are declared with an argument they don't use.

Acked-by: Thiemo Seufer <ths@networkno.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5674 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-mips: fix temporary variable freeing in op_ldst_##insn()
aurel32 [Tue, 11 Nov 2008 11:34:30 +0000 (11:34 +0000)]
target-mips: fix temporary variable freeing in op_ldst_##insn()

Move tcg_temp_free() out of the conditional part to make sure
the TCG temporary variable is freed in all cases.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Thiemo Seufer <ths@networkno.de>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5673 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-alpha: add proper fcntl definitions
aurel32 [Tue, 11 Nov 2008 11:30:48 +0000 (11:30 +0000)]
target-alpha: add proper fcntl definitions

On Alpha the target to native fcntl definitions were missing.  Because of
this, programs trying to open files with the O_CREAT option were getting
O_APPEND instead, etc.

This was keeping gcc from the spec benchmarks from running, among other
things.

(Vince Weaver)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5672 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-alpha: fix double TCG variable allocation
aurel32 [Tue, 11 Nov 2008 11:30:04 +0000 (11:30 +0000)]
target-alpha: fix double TCG variable allocation

Noticed by Chris Krumme.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5671 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoFix alignment problem with some 64bit load/store instructions
malc [Tue, 11 Nov 2008 03:04:57 +0000 (03:04 +0000)]
Fix alignment problem with some 64bit load/store instructions

LD/STD/LWA require displacement to be multiple of 4, provide
tcg_out_ldsta which checks the supplied displacement and falls
back on indexed variant when the check fails. All uses of
LD/STD/LWA outside of tcg_out_ldst appear to be safe.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5670 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoKVM: simplify kvm_cpu_exec hook
aliguori [Mon, 10 Nov 2008 15:55:14 +0000 (15:55 +0000)]
KVM: simplify kvm_cpu_exec hook

We don't need to use cpu_loop_exit() because we never use the
condition codes so everything can be folded into a single case.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5669 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-ppc: convert most SPE integer instructions to TCG
aurel32 [Mon, 10 Nov 2008 11:10:23 +0000 (11:10 +0000)]
target-ppc: convert most SPE integer instructions to TCG

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5668 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-alpha: fix cmpbge instruction
aurel32 [Mon, 10 Nov 2008 11:10:14 +0000 (11:10 +0000)]
target-alpha: fix cmpbge instruction

The cmpbge instruction should compare all 8 bytes of one 64-bit value with
another.  However, we were looping with a < 7 condition which was skipping
the top byte.  So if we were doing a compare where the top byte was
important, we could get the wrong result (this notably breaks the strlen()
function with certain sized strings).

(Vince Weaver)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5667 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agouse target_mmap() to allocate idt, gdt and ldt (Kirill A. Shutemov).
balrog [Mon, 10 Nov 2008 02:55:33 +0000 (02:55 +0000)]
use target_mmap() to allocate idt, gdt and ldt (Kirill A. Shutemov).

env->*dt.base should fit target address space, so we should use
target_mmap to allocate them.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5666 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoCurrently trying to turn an oversized directory into a VVFAT image will
balrog [Mon, 10 Nov 2008 01:34:27 +0000 (01:34 +0000)]
Currently trying to turn an oversized directory into a VVFAT image will
result in a cryptic error (and an abort):
  qemu: block-vvfat.c:97: array_get: Assertion `index < array->next' failed.
  Aborted

Turn this into an actually useful error message:
  Directory does not fit in FAT16 (capacity 504MB)
  qemu: could not open disk image fat:$DIR/

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5665 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agox86 CPUID extended family/model (Andre Przywara).
balrog [Mon, 10 Nov 2008 01:05:01 +0000 (01:05 +0000)]
x86 CPUID extended family/model (Andre Przywara).

x86 CPUs feature extended family/model bits in CPUID leaf
0000_0001|EAX. Refer to page 10 in:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25481.pdf

Those bits are necessary to model newer AMD CPUs:
-cpu qemu64,family=15,model=65,stepping=3 or
-cpu qemu64,family=16,model=4,stepping=2

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5664 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoUse TCG not op
blueswir1 [Sun, 9 Nov 2008 19:52:36 +0000 (19:52 +0000)]
Use TCG not op

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5663 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoUse andc, orc, nor and nand
blueswir1 [Sun, 9 Nov 2008 19:50:37 +0000 (19:50 +0000)]
Use andc, orc, nor and nand
Also fix which argument gets negated in fandnot[12] and fornot[12]

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5662 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-ppc: fix TCG argument
aurel32 [Sun, 9 Nov 2008 18:27:28 +0000 (18:27 +0000)]
target-ppc: fix TCG argument

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5661 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-ppc: Remove a few TCG temp variable leaks
aurel32 [Sun, 9 Nov 2008 17:27:36 +0000 (17:27 +0000)]
target-ppc: Remove a few TCG temp variable leaks

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5660 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-ppc: fixes for gen_op_neg()
aurel32 [Sun, 9 Nov 2008 17:27:27 +0000 (17:27 +0000)]
target-ppc: fixes for gen_op_neg()

- Rename to gen_op_arith_neg for consistency with other functions.
- Correctly free TCG temp variable.
- Fix the return value in 64-bit mode in case of overflow.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5659 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-ppc: gen_op_arith_divw() & gen_op_arith_divd fixes
aurel32 [Sun, 9 Nov 2008 17:27:19 +0000 (17:27 +0000)]
target-ppc: gen_op_arith_divw() & gen_op_arith_divd fixes

gen_op_arith_divw():
- "deoptimize" gen_op_arith_divw to make it more readable.
- Correctly free TCG temp variable

gen_op_arith_divd():
- Call the right function.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5658 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-ppc: optimize mullw and make the code more readable
aurel32 [Sun, 9 Nov 2008 17:27:11 +0000 (17:27 +0000)]
target-ppc: optimize mullw and make the code more readable

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5657 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agotarget-ppc: indentation fixes
aurel32 [Sun, 9 Nov 2008 17:27:03 +0000 (17:27 +0000)]
target-ppc: indentation fixes

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5656 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoSparc32 BSD user support
blueswir1 [Sun, 9 Nov 2008 09:31:37 +0000 (09:31 +0000)]
Sparc32 BSD user support

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5655 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoDocument bluetooth support in qemu-doc.
balrog [Sun, 9 Nov 2008 02:24:54 +0000 (02:24 +0000)]
Document bluetooth support in qemu-doc.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5654 c046a42c-6fe2-441c-8c8c-71466251a162