sdk/emulator/qemu.git
14 years agoslirp: remove dead nested assignment, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:45:38 +0000 (13:45 +0000)]
slirp: remove dead nested assignment, spotted by clang

Although the value stored to 'r' is used in the enclosing expression,
the value is never actually read from 'r'.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoslirp: remove dead initialization, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:45:38 +0000 (13:45 +0000)]
slirp: remove dead initialization, spotted by clang

Value stored during initialization is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoslirp: remove dead increments, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:45:37 +0000 (13:45 +0000)]
slirp: remove dead increments, spotted by clang

Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoslirp: remove dead assignments, spotted by clang
Blue Swirl [Sun, 7 Mar 2010 13:13:05 +0000 (13:13 +0000)]
slirp: remove dead assignments, spotted by clang

Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotarget-arm: Fix missing 'return' in SRS handling.
Adam Lackorzynski [Mon, 1 Mar 2010 16:19:54 +0000 (17:19 +0100)]
target-arm: Fix missing 'return' in SRS handling.

There's a return missing in the srs handling which leads to srs always being
treated an an invalid op.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix curses interaction with keymaps
Samuel Thibault [Sun, 28 Feb 2010 20:03:00 +0000 (21:03 +0100)]
Fix curses interaction with keymaps

The combination of keymap support (-k option) and curses is currently
very broken.  The patch below fixes it by first extending keymap support
to interpret the shift, ctrl, altgr and addupper keywords in keymaps,
and to fix curses into properly using keymaps.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
14 years agouse absolute URLs for .gitmodules
Paolo Bonzini [Fri, 5 Mar 2010 08:08:04 +0000 (09:08 +0100)]
use absolute URLs for .gitmodules

The relative URLs do not work when cloning a fork of qemu or when
cloning from the Savannah URL.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoDocumentation: Modify rule for html output (better looking output format)
Stefan Weil [Thu, 4 Mar 2010 21:21:02 +0000 (22:21 +0100)]
Documentation: Modify rule for html output (better looking output format)

To create html output from texi input, texi2html was used.
Output from makeinfo looks cleaner, so replace the old rule
and use makeinfo now.

For those who want to use their own variant of html output,
the macros MAKEINFO and MAKEINFOFLAGS allow customisation.
Option "-I ." is not needed (the current directory is
searched by default), so remove it.

Please note that the build requirements changed, too:
makeinfo is required for doc builds.
texi2html is no longer used.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoscsi: update comment on the standards revision
Christoph Hellwig [Thu, 4 Mar 2010 13:45:44 +0000 (14:45 +0100)]
scsi: update comment on the standards revision

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-nbd: Fix wrong description in qemu-nbd.texi
Ryota Ozaki [Wed, 3 Mar 2010 15:18:43 +0000 (00:18 +0900)]
qemu-nbd: Fix wrong description in qemu-nbd.texi

-c option needs argument <dev> but it's missing now.
This patch fixes it.

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoBuild usb-ohci for PCs
Kevin Wolf [Wed, 3 Mar 2010 15:02:25 +0000 (16:02 +0100)]
Build usb-ohci for PCs

The OHCI emulation isn't obviously broken and there are people who want to use
it. Let's build it by default so that it can be enabled via -device.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoppc440_bamboo: Disable new virtio-serial features for 0.12 machine type
Amit Shah [Thu, 25 Feb 2010 13:56:12 +0000 (19:26 +0530)]
ppc440_bamboo: Disable new virtio-serial features for 0.12 machine type

Disable the MULTIPORT feature and MSI vectors for the 0.12 machine
types; those features are added only for 0.13 onwards.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoppc440_bamboo: Add 0.12 and 0.13 machine types for backward compat
Amit Shah [Thu, 25 Feb 2010 13:56:11 +0000 (19:26 +0530)]
ppc440_bamboo: Add 0.12 and 0.13 machine types for backward compat

Add a 0.12 machine type for compatibility with older versions. Mark the
default one as 0.13.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agos390-virtio: Fix compile error for virtio-block init
Amit Shah [Thu, 25 Feb 2010 13:45:18 +0000 (19:15 +0530)]
s390-virtio: Fix compile error for virtio-block init

Commit 428c149b0be790b440e1cbee185b152cdb22feec modified the argument
that virtio_blk_init takes. Update the s390 bus code that calls this
function.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
CC: Christoph Hellwig <hch@lst.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agojson-parser: Fix segfault on malformed input
Kevin Wolf [Wed, 24 Feb 2010 15:17:58 +0000 (16:17 +0100)]
json-parser: Fix segfault on malformed input

If the parser fails to parse the key in parse_pair, it will access a NULL
pointer. A simple way to trigger this is sending {foo} via QMP. This patch
turns the segfault into a syntax error reply.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/serial.c: fix THRE interrupt clearing
Aurelien Jarno [Sat, 6 Mar 2010 21:19:53 +0000 (22:19 +0100)]
hw/serial.c: fix THRE interrupt clearing

UART_IIR_THRI is not a mask, but a possible value for the IIR ID.
Use UART_IIR_ID to extract this value.

Broken by commit 71e605f80313a632cc6714cde7bd240042dbdd95.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/serial.c: fix indentation
Aurelien Jarno [Sat, 6 Mar 2010 19:23:09 +0000 (20:23 +0100)]
hw/serial.c: fix indentation

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: Save/restore fpu registers to signal context on sh4
takasi-y@ops.dti.ne.jp [Wed, 17 Feb 2010 15:46:45 +0000 (00:46 +0900)]
linux-user: Save/restore fpu registers to signal context on sh4

As "todo" comment in source code.
And modify restore_sigcontext() to have three args as kernel's does.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: Fix syscall pipe2() retval on sh4
takasi-y@ops.dti.ne.jp [Wed, 17 Feb 2010 15:35:03 +0000 (00:35 +0900)]
linux-user: Fix syscall pipe2() retval on sh4

On linux/sh4
 pipe() return values by r0:r1 as SH C calling convention.
 pipe2() return values on memory as traditional unix way.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-i386: Fix long jumps/calls in long mode with REX.W set
malc [Thu, 4 Mar 2010 12:09:26 +0000 (15:09 +0300)]
target-i386: Fix long jumps/calls in long mode with REX.W set

Signed-off-by: malc <av1474@comtv.ru>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-i386: fix lddqu SSE instruction
Aurelien Jarno [Sat, 6 Mar 2010 17:33:53 +0000 (18:33 +0100)]
target-i386: fix lddqu SSE instruction

This instruction load data from memory to register and not the reverse.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoUpdate to latest SeaBIOS
Anthony Liguori [Sat, 6 Mar 2010 03:42:50 +0000 (21:42 -0600)]
Update to latest SeaBIOS

 - 8f469b9 Dynamically allocate ata_channel info; introduce custom atadrive_s struct.
 - 575ffc8 Cleanup - build drive description in temp memory during init.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoMakefile: Fix names of GPXE ROM files
Stefan Weil [Thu, 4 Mar 2010 20:44:41 +0000 (14:44 -0600)]
Makefile: Fix names of GPXE ROM files

da51e79b7ff2126cc2448749d657a4f6e3b1270f added two new ROM files
and removed an old one for eepro100.c.

These changes were missing in Makefile (which resulted
in a broken "make install").

Reported by Lucas Meneghel Rodrigues, thanks.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agotarget-mips: use newer logical ops
Aurelien Jarno [Wed, 3 Mar 2010 11:22:11 +0000 (12:22 +0100)]
target-mips: use newer logical ops

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoMerge remote branch 'qemu-kvm/uq/master' into pulls
Anthony Liguori [Thu, 4 Mar 2010 15:14:24 +0000 (09:14 -0600)]
Merge remote branch 'qemu-kvm/uq/master' into pulls

14 years agox86: Extend validity of bsp_to_cpu
Jan Kiszka [Mon, 1 Mar 2010 18:10:32 +0000 (19:10 +0100)]
x86: Extend validity of bsp_to_cpu

As we hard-wire the BSP to CPU 0 anyway and cpuid_apic_id equals
cpu_index, bsp_to_cpu can also be based on the latter directly. This
will help an early user of it: KVM while initializing mp_state.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agoKVM: x86: Restrict writeback of VCPU state
Jan Kiszka [Mon, 1 Mar 2010 18:10:31 +0000 (19:10 +0100)]
KVM: x86: Restrict writeback of VCPU state

Do not write nmi_pending, sipi_vector, and mpstate unless we at least go
through a reset. And TSC as well as KVM wallclocks should only be
written on full sync, otherwise we risk to drop some time on state
read-modify-write.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agoKVM: Rework VCPU state writeback API
Jan Kiszka [Mon, 1 Mar 2010 18:10:30 +0000 (19:10 +0100)]
KVM: Rework VCPU state writeback API

This grand cleanup drops all reset and vmsave/load related
synchronization points in favor of four(!) generic hooks:

- cpu_synchronize_all_states in qemu_savevm_state_complete
  (initial sync from kernel before vmsave)
- cpu_synchronize_all_post_init in qemu_loadvm_state
  (writeback after vmload)
- cpu_synchronize_all_post_init in main after machine init
- cpu_synchronize_all_post_reset in qemu_system_reset
  (writeback after system reset)

These writeback points + the existing one of VCPU exec after
cpu_synchronize_state map on three levels of writeback:

- KVM_PUT_RUNTIME_STATE (during runtime, other VCPUs continue to run)
- KVM_PUT_RESET_STATE   (on synchronous system reset, all VCPUs stopped)
- KVM_PUT_FULL_STATE    (on init or vmload, all VCPUs stopped as well)

This level is passed to the arch-specific VCPU state writing function
that will decide which concrete substates need to be written. That way,
no writer of load, save or reset functions that interact with in-kernel
KVM states will ever have to worry about synchronization again. That
also means that a lot of reasons for races, segfaults and deadlocks are
eliminated.

cpu_synchronize_state remains untouched, just as Anthony suggested. We
continue to need it before reading or writing of VCPU states that are
also tracked by in-kernel KVM subsystems.

Consequently, this patch removes many cpu_synchronize_state calls that
are now redundant, just like remaining explicit register syncs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agoKVM: Rework of guest debug state writing
Jan Kiszka [Mon, 1 Mar 2010 18:10:29 +0000 (19:10 +0100)]
KVM: Rework of guest debug state writing

So far we synchronized any dirty VCPU state back into the kernel before
updating the guest debug state. This was a tribute to a deficite in x86
kernels before 2.6.33. But as this is an arch-dependent issue, it is
better handle in the x86 part of KVM and remove the writeback point for
generic code. This also avoids overwriting the flushed state later on if
user space decides to change some more registers before resuming the
guest.

We furthermore need to reinject guest exceptions via the appropriate
mechanism. That is KVM_SET_GUEST_DEBUG for older kernels and
KVM_SET_VCPU_EVENTS for recent ones. Using both mechanisms at the same
time will cause state corruptions.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agoAdd option to use file backed guest memory
Marcelo Tosatti [Mon, 1 Mar 2010 23:25:08 +0000 (20:25 -0300)]
Add option to use file backed guest memory

Port qemu-kvm's -mem-path and -mem-prealloc options. These are useful
for backing guest memory with huge pages via hugetlbfs.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
CC: john cooper <john.cooper@redhat.com>
14 years agoAllocate memory below 4GB as one chunk
Avi Kivity [Wed, 24 Feb 2010 21:11:19 +0000 (18:11 -0300)]
Allocate memory below 4GB as one chunk

Instead of allocating a separate chunk for the first 640KB and another
for 1MB+, allocate one large chunk.  This plays well in terms of alignment
and size with large pages.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agoeepro100: Keep includes sorted
Stefan Weil [Tue, 2 Mar 2010 21:38:00 +0000 (22:38 +0100)]
eepro100: Keep includes sorted

I always try to keep standard includes sorted
and add a comment why they are there (so they
can be removed when they are no longer needed).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Remove C++ comments
Stefan Weil [Tue, 2 Mar 2010 21:37:59 +0000 (22:37 +0100)]
eepro100: Remove C++ comments

C++ comments are unwanted, so this is fixed here.

* Replace C++ comments by C comments.
* Put code which was deactivated by a C++ comment in #if 0...#endif.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Add diagnose command
Stefan Weil [Tue, 2 Mar 2010 21:37:58 +0000 (22:37 +0100)]
eepro100: Add diagnose command

Real hardware would run an internal self-test.
The emulation just returns a passed status.

Original patch was from Reimar Döffinger, thanks.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: New function for reading command block
Stefan Weil [Tue, 2 Mar 2010 21:37:57 +0000 (22:37 +0100)]
eepro100: New function for reading command block

Move code which reads the command block to the
new function read_cb. The patch also fixes some
endianess issues related to the command block
and moves declarations of local variables to
the beginning of the block.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Use tx.status
Stefan Weil [Tue, 2 Mar 2010 21:37:56 +0000 (22:37 +0100)]
eepro100: Use tx.status

There is no need for a local variable "status".
Using tx.status makes it clearer which status
is addressed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Prettify code (no functional changes)
Stefan Weil [Tue, 2 Mar 2010 21:37:55 +0000 (22:37 +0100)]
eepro100: Prettify code (no functional changes)

* Fix indentation.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Fix CU Start command
Stefan Weil [Tue, 2 Mar 2010 21:37:54 +0000 (22:37 +0100)]
eepro100: Fix CU Start command

CU Start is allowed when the CU is in the idle or suspended state.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Support RNR interrupt
Stefan Weil [Tue, 2 Mar 2010 21:37:53 +0000 (22:37 +0100)]
eepro100: Support RNR interrupt

The RNR interrupt is triggered under these conditions:

* the RU is not ready to receive a frame due to missing resources
* the RU is ready and a RU abort command was requested

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Replace variable name to fix a compiler warning
Stefan Weil [Tue, 2 Mar 2010 21:37:52 +0000 (22:37 +0100)]
eepro100: Replace variable name to fix a compiler warning

When compiling with -Wshadow, gcc gives a warning
which is fixed by renaming stat -> status.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Use symbolic names for bits in EEPROM id
Stefan Weil [Tue, 2 Mar 2010 21:37:51 +0000 (22:37 +0100)]
eepro100: Use symbolic names for bits in EEPROM id

V2 - Use UPPER_CASE for enum values

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Remove old unused code
Stefan Weil [Tue, 2 Mar 2010 21:37:50 +0000 (22:37 +0100)]
eepro100: Remove old unused code

This code is no longer needed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Use symbolic names and BIT macros in binary operations
Stefan Weil [Tue, 2 Mar 2010 21:37:49 +0000 (22:37 +0100)]
eepro100: Use symbolic names and BIT macros in binary operations

Instead of magic numbers like 0x8000, symbolic names are used
for the SCB command and status bits.

There are too many configuration bits to use symbolic names
there, too. Using the BIT macro is a little help when comparing
code and documentation.

For the same reason, some other constants were replaced by
the BITS macro.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Add device descriptions
Stefan Weil [Tue, 2 Mar 2010 21:37:48 +0000 (22:37 +0100)]
eepro100: Add device descriptions

Add descriptions for all devices.
These descriptions are shown when users call
qemu -device ?

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Update copyright notice
Stefan Weil [Tue, 2 Mar 2010 21:37:47 +0000 (22:37 +0100)]
eepro100: Update copyright notice

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Add TODO list
Stefan Weil [Tue, 2 Mar 2010 21:37:46 +0000 (22:37 +0100)]
eepro100: Add TODO list

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Support gpxe boot for all eepro100 devices
Stefan Weil [Tue, 2 Mar 2010 21:37:44 +0000 (22:37 +0100)]
eepro100: Support gpxe boot for all eepro100 devices

Only two boot ROM files are needed for all devices.

* Add these GPXE ROM files using new naming convention
  (as discussed on qemu-devel). Both files were created
  with http://rom-o-matic.net/, PCI vendor / device ids
  as in ROM filenames and option BANNER_TIMEOUT = 0.

* Remove old PXE ROM file for i82559er.
  It was replaced by gpxe-eepro100-80861209.rom.

* Update pc-bios/README (and sort entries).

Full support still needs additional eepro100 fixes.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Fix PXE boot
Stefan Weil [Tue, 2 Mar 2010 21:37:43 +0000 (22:37 +0100)]
eepro100: Fix PXE boot

The phy handling was wrong for PXE, GPXE boot:
GPXE's eepro100 driver did not detect a valid link.

This is fixed here.

V2 - Use UPPER_CASE for enum values

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Add missing SCB register names
Stefan Weil [Tue, 2 Mar 2010 21:37:42 +0000 (22:37 +0100)]
eepro100: Add missing SCB register names

Some system control block registers were addressed
using their offset value. Use symbolic names now
and clean the documentation.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoeepro100: Fix compiler errors from debug messages
Stefan Weil [Tue, 2 Mar 2010 21:37:41 +0000 (22:37 +0100)]
eepro100: Fix compiler errors from debug messages

When debug output was enabled (by defining DEBUG_EEPRO100),
some debug messages resulted in a compiler error.

This is fixed here.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years ago(curses) Use more descriptive values
Samuel Thibault [Sun, 28 Feb 2010 17:12:01 +0000 (18:12 +0100)]
(curses) Use more descriptive values

Hello,

curses_keys.h is using obscure constant values while the curses.h header
provides fine defines, let's use the latter.

To be applied on top of my previous patch.

Samuel

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
14 years agoFix curses return key when using -k
Samuel Thibault [Sun, 28 Feb 2010 14:35:19 +0000 (15:35 +0100)]
Fix curses return key when using -k

Hello,

There is a small incoherency in curses_keys.h, which makes it fail to
emit \n when using e.g. -k fr: curses2keysym transforms \r and 0x157
into \n, but name2keysym binds \r with Return, not \n.  The patch below
fixes that.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
14 years agotarget-mips: use setcond when possible
Aurelien Jarno [Mon, 8 Feb 2010 14:50:58 +0000 (15:50 +0100)]
target-mips: use setcond when possible

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg/arm: merge the two sets of #define for optional ops
Aurelien Jarno [Tue, 2 Mar 2010 22:10:31 +0000 (23:10 +0100)]
tcg/arm: merge the two sets of #define for optional ops

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg/arm: accept immediate arguments for brcond/setcond
Aurelien Jarno [Mon, 1 Mar 2010 21:33:50 +0000 (22:33 +0100)]
tcg/arm: accept immediate arguments for brcond/setcond

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
14 years agoAdd a missing break
Andrzej Zaborowski [Tue, 2 Mar 2010 21:26:04 +0000 (22:26 +0100)]
Add a missing break

14 years agotcg/arm: implement setcond2
Aurelien Jarno [Mon, 1 Mar 2010 21:33:49 +0000 (22:33 +0100)]
tcg/arm: implement setcond2

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
14 years agotcg/arm: implement setcond
Aurelien Jarno [Mon, 1 Mar 2010 21:33:48 +0000 (22:33 +0100)]
tcg/arm: implement setcond

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
14 years agotcg/arm: fix div2/divu2
Aurelien Jarno [Tue, 2 Mar 2010 19:19:18 +0000 (20:19 +0100)]
tcg/arm: fix div2/divu2

When restoring register values, increase the stack register for skipped
values.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
14 years agoAvoid tlb_set_page in userspace emulation
Paul Brook [Mon, 1 Mar 2010 03:31:14 +0000 (03:31 +0000)]
Avoid tlb_set_page in userspace emulation

tlb_set_page isn't meaningful for userspace emulation, so remove it.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoMove subpage definitions
Paul Brook [Mon, 1 Mar 2010 03:31:14 +0000 (03:31 +0000)]
Move subpage definitions

Move definitions for subpage handling into !CONFIG_USER_ONLY code.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoDisassembler symbol lookup fix
Paul Brook [Mon, 1 Mar 2010 03:55:48 +0000 (03:55 +0000)]
Disassembler symbol lookup fix

Fix function signature for userspace disassembler symbol lookup.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoMove ioport.h out of cpu-all.h
Paul Brook [Mon, 1 Mar 2010 03:29:21 +0000 (03:29 +0000)]
Move ioport.h out of cpu-all.h

Only include ioport.h where it is actually needed.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoRemove bogus cpu_physical_memory_rw
Paul Brook [Mon, 1 Mar 2010 00:08:59 +0000 (00:08 +0000)]
Remove bogus cpu_physical_memory_rw

Userspace doesn't have physical memory, so cpu_physical_memory_rw
makes no sense.  This is only used to implement cpu_memory_rw_debug, so
just implement that directly instead.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoRemove l1_phys_map from userspace emulation
Paul Brook [Sun, 28 Feb 2010 23:55:53 +0000 (23:55 +0000)]
Remove l1_phys_map from userspace emulation

Userspace emulation doesn't have a physical address space, so
l1_phys_map makes no sense. This code is never actually used, so don't
try and build it.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoFix userspace breakpoint invalidation
Paul Brook [Sun, 28 Feb 2010 23:47:45 +0000 (23:47 +0000)]
Fix userspace breakpoint invalidation

Remove bogus virtual->physical address translation in
breakpoint_invalidate for userspace emulation.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agotarget-arm: neon vshll instruction fix
Juha Riihimäki [Fri, 5 Feb 2010 15:52:29 +0000 (15:52 +0000)]
target-arm: neon vshll instruction fix

implementation only widened the 32bit source vector elements into a
64bit destination vector but forgot to perform the actual shifting
operation.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-arm: neon - fix VRADDHN/VRSUBHN vs VADDHN/VSUBHN
Riku Voipio [Fri, 5 Feb 2010 15:52:28 +0000 (15:52 +0000)]
target-arm: neon - fix VRADDHN/VRSUBHN vs VADDHN/VSUBHN

The rounding/truncating options were inverted. truncating
was done when rounding was meant and vice verse.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-i386: fix crash on x86 32bit linux host with hw breakpoint exceptions
Jason Wessel [Tue, 26 Jan 2010 22:29:50 +0000 (16:29 -0600)]
target-i386: fix crash on x86 32bit linux host with hw breakpoint exceptions

If you make use of hw breakpoints on a 32bit x86 linux host, qemu
will segmentation fault when processing the exception.

The problem is that the value of env is stored in $ebp in the op_helper
raise_exception() function, and it can have the wrong value when
calling it from non generated code.

It is possible to work around the problem by restoring the value of
env before calling raise_exception() using a new helper function that
takes (CPUState *) as one of the arguments.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoalpha-linux-user: Implement signals.
Richard Henderson [Mon, 28 Dec 2009 02:30:03 +0000 (18:30 -0800)]
alpha-linux-user: Implement signals.

Move userland PALcode handling into linux-user main loop so that
we can send signals from there.  This also makes alpha_palcode.c
system-level only, so don't build it for userland.  Add defines
for GENTRAP PALcall mapping to signals.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-alpha: Implement IEEE FP qualifiers.
Richard Henderson [Mon, 4 Jan 2010 22:27:23 +0000 (14:27 -0800)]
target-alpha: Implement IEEE FP qualifiers.

IEEE FP instructions are split up so that the rounding mode
coming from the instruction and exceptions (both masking and
delivery) are handled external to the base FP operation.
FP exceptions are properly raised for non-finite inputs to
instructions that do not indicate software completion.

A shortcut is applied if CONFIG_SOFTFLOAT_INLINE is defined
at the top of translate.c: data is loaded and stored into
FP_STATUS directly instead of using the functional interface
defined by "softfloat.h".

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-ppc: don't print invalid opcode messages on the console
Aurelien Jarno [Sun, 28 Feb 2010 15:04:09 +0000 (16:04 +0100)]
target-ppc: don't print invalid opcode messages on the console

Invalid opcode messages can be perfectly normal, for example if this
code is never executed. Don't print an error message on the console,
but keep the message in the log for debugging purposes.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoRevert "target-ppc: stop translation after a trap instruction"
Aurelien Jarno [Sun, 28 Feb 2010 15:02:28 +0000 (16:02 +0100)]
Revert "target-ppc: stop translation after a trap instruction"

This reverts commit 6454e7be1b2504533f7ffb190d54ebe2993cb434.

14 years agoaudio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handler
malc [Sun, 28 Feb 2010 15:34:21 +0000 (18:34 +0300)]
audio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handler

Signed-off-by: malc <av1474@comtv.ru>
14 years agoaudio/alsa: Spelling typo (paramters)
Vagrant Cascadian [Fri, 26 Feb 2010 21:39:46 +0000 (13:39 -0800)]
audio/alsa: Spelling typo (paramters)

Trivial patch to fix the spelling of "parameters".

Signed-off-by: malc <av1474@comtv.ru>
14 years agotarget-ppc: stop translation after a trap instruction
Aurelien Jarno [Sun, 28 Feb 2010 13:11:06 +0000 (14:11 +0100)]
target-ppc: stop translation after a trap instruction

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-char.c: drop debug printfs from qemu_chr_parse_compat
Jan Kiszka [Mon, 18 Jan 2010 11:15:01 +0000 (12:15 +0100)]
qemu-char.c: drop debug printfs from qemu_chr_parse_compat

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agopowerpc/e500: adjust fdt and ramdisk loading addr
Liu Yu [Tue, 2 Feb 2010 08:49:03 +0000 (16:49 +0800)]
powerpc/e500: adjust fdt and ramdisk loading addr

Since kernel uimage is getting bigger,
old fixed loading bases will result in regions overlap.

Add pad for fdt and ramdisk, so that they won't overlap with uimage.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agopowerpc: fix compilation with CONFIG_FDT undefined
Aurelien Jarno [Sat, 27 Feb 2010 18:47:22 +0000 (19:47 +0100)]
powerpc: fix compilation with CONFIG_FDT undefined

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agopowerpc/booke: move fdt loading to rom infrastructure
Liu Yu [Tue, 2 Feb 2010 08:49:02 +0000 (16:49 +0800)]
powerpc/booke: move fdt loading to rom infrastructure

It's convinent to use rom to checking overlap, to reset etc.
And uImage and ramdisk loading has already moved to it.

Also, after we add fdt to rom, free it.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-ppc: add synchronize register for booke init
Liu Yu [Wed, 27 Jan 2010 06:14:09 +0000 (14:14 +0800)]
target-ppc: add synchronize register for booke init

So that the following registers init could be flushed back to kvm.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Hollis Blanchard <hollis@penguinppc.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-sh4: Fix gdb read/write register
takasi-y@ops.dti.ne.jp [Wed, 17 Feb 2010 15:53:29 +0000 (00:53 +0900)]
target-sh4: Fix gdb read/write register

cpu_gdb_read_register(): Fix n={8...15} case.
cpu_gdb_write_register(): Fix n={8...15} case and runaway "case:".

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-ppc: fix SPE evsplat* instructions
Nathan Froyd [Tue, 23 Feb 2010 20:21:31 +0000 (12:21 -0800)]
target-ppc: fix SPE evsplat* instructions

The shifts in the gen_evsplat* functions were expecting rA to be masked,
not extracted, and so used the wrong shift amounts to sign-extend or pad
with zeroes.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-ppc: fix SPE evcmp* instructions
Nathan Froyd [Tue, 23 Feb 2010 19:55:14 +0000 (11:55 -0800)]
target-ppc: fix SPE evcmp* instructions

The CRF_{CH,CL,CH_OR_CL,CH_AND_CL} constants were all off by one bit
position.  Because of this, the SPE evcmp* family of instructions would
store values in the result condition register that were also off by one
bit position.

Fixed by using the CRF_{LT,GT,EQ,SO} constants for the shift amounts.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoarm host: Fix linker warning (m68k targets)
Stefan Weil [Tue, 23 Feb 2010 21:32:23 +0000 (22:32 +0100)]
arm host: Fix linker warning (m68k targets)

Compilation of m68k-softmmu or m68k-linux-user on arm host
(or cross compilation for arm) results in a linker warning:

  LINK  m68k-softmmu/qemu-system-m68k
m68k-dis.o: warning: definition of `floatformat_ieee_single_little' overriding common
arm-dis.o: warning: common is here
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../../arm-linux-gnueabi/bin/ld: Warning: size of symbol `floatformat_ieee_single_little' changed from 4 in arm-dis.o to 48 in m68k-dis.o

floatformat_ieee_single_little is declared in arm-dis.c and m68k-dis.c,
and both declarations don't match, so this is an error.

The symbol is not needed in arm-dis.c, so I removed it there.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix 'make install' from non-srcdir build
Amit Shah [Fri, 26 Feb 2010 08:30:28 +0000 (14:00 +0530)]
Fix 'make install' from non-srcdir build

Commit b5ec5ce0 broke 'make install' from non source-dir build. Fix.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix to 'gdb detach' stub
Daniel Gutson [Fri, 26 Feb 2010 17:13:50 +0000 (14:13 -0300)]
Fix to 'gdb detach' stub

With this patch, 'gdb detach' correctly resumes the inferior execution
after detaching the debugger.
The bug was caused by qemu asking gdb to execute a syscall (isatty)
after the detach, and then waiting (forever) for the reply. I fixed this
by properly setting gdb_syscall_mode appropriately in the 'detach'
packet handling, so subsequent syscalls are solved by qemu rather than gdb.

Signed-off-by: Daniel Gutson <dgutson@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix qemu -net user,hostfwd= example
Aurelien Jarno [Sat, 27 Feb 2010 09:50:32 +0000 (10:50 +0100)]
Fix qemu -net user,hostfwd= example

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg/ppc: Fix right rotation
malc [Fri, 26 Feb 2010 22:59:47 +0000 (01:59 +0300)]
tcg/ppc: Fix right rotation

Signed-off-by: malc <av1474@comtv.ru>
14 years agotarget-sparc: fix --enable-debug build for 64 bit host
Stefan Weil [Thu, 25 Feb 2010 18:05:41 +0000 (19:05 +0100)]
target-sparc: fix --enable-debug build for 64 bit host

b551ec04ca45d1925417dd2ec7c1b7f115c84f1d fixed
the compilation for 32 bit hosts, but introduced
a new error for 64 bit hosts:

tcg_temp_new_ptr needs a matching tcg_temp_free_ptr.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix -usbdevice crash
Paul Brook [Thu, 25 Feb 2010 13:29:06 +0000 (13:29 +0000)]
Fix -usbdevice crash

If -usbdevice is used on a machine with no USB busses, usb_create
will fail and return NULL.  Patch below handles this failure gracefully
rather than crashing when we try to init the device.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoARM defconfig fix
Paul Brook [Tue, 23 Feb 2010 23:31:53 +0000 (23:31 +0000)]
ARM defconfig fix

Tix typo in default-configs/arm-softmmu.mak

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agotarget-alpha: Mark helper_excp as NORETURN.
Richard Henderson [Mon, 4 Jan 2010 19:25:22 +0000 (11:25 -0800)]
target-alpha: Mark helper_excp as NORETURN.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-alpha: Clean up arithmetic traps.
Richard Henderson [Mon, 4 Jan 2010 19:24:04 +0000 (11:24 -0800)]
target-alpha: Clean up arithmetic traps.

Replace the EXCP_ARITH_OVERFLOW placeholder with the complete
set of bits from the EXC_SUM IPR.  Use them in the existing
places where we raise arithmetic exceptions.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-alpha: Reduce internal processor registers for user-mode.
Richard Henderson [Mon, 4 Jan 2010 19:19:14 +0000 (11:19 -0800)]
target-alpha: Reduce internal processor registers for user-mode.

The existing set of IPRs is totally irrelevant to user-mode emulation.
Indeed, they most are irrelevant to implementing kernel-mode emulation,
and would only be relevant to PAL-mode emulation, which I suspect that
no one will ever attempt.

Reducing the set of processor registers reduces the size of the CPU state.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-alpha: Split up FPCR value into separate fields.
Richard Henderson [Thu, 31 Dec 2009 20:41:07 +0000 (12:41 -0800)]
target-alpha: Split up FPCR value into separate fields.

The fpcr_exc_status, fpcr_exc_mask, and fpcr_dyn_round fields
are stored in <softfloat.h> format for convenience during
regular execution.

Revert the addition of float_exception_mask to float_status,
added in ba0e276db4b51bd2255a5d5ff8902c70d32ade40.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-alpha: Fix gdb access to fpcr and unique.
Richard Henderson [Thu, 31 Dec 2009 19:54:01 +0000 (11:54 -0800)]
target-alpha: Fix gdb access to fpcr and unique.

cpu_gdb_read/write_register need to access the fpcr via the
cpu_alpha_load/store_fpcr functions.

The unique register is number 66 in the gdb remote protocol.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix OpenBSD linker warning
Blue Swirl [Tue, 23 Feb 2010 22:01:36 +0000 (22:01 +0000)]
Fix OpenBSD linker warning

helper.o(.text+0x11e0): In function `listflags':
/src/qemu/target-i386/helper.c:661: warning: sprintf() is often misused, please use snprintf()

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix i386-bsd-user build
Blue Swirl [Tue, 23 Feb 2010 21:46:32 +0000 (21:46 +0000)]
Fix i386-bsd-user build

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix mingw32 build
Blue Swirl [Tue, 23 Feb 2010 21:46:28 +0000 (21:46 +0000)]
Fix mingw32 build

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>