sdk/emulator/qemu.git
13 years agoMerge remote branch 'origin/master' into pci
Michael S. Tsirkin [Mon, 10 Jan 2011 11:43:48 +0000 (13:43 +0200)]
Merge remote branch 'origin/master' into pci

13 years agovga: tag as not hotplugable.
Gerd Hoffmann [Thu, 6 Jan 2011 14:14:39 +0000 (15:14 +0100)]
vga: tag as not hotplugable.

This patch tags all vga cards as not hotpluggable.  The qemu
standard vga will never ever be hotpluggable.  For cirrus + vmware
it might be possible to get that work some day.  Todays we can't
handle that for a number of reasons though.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopiix: tag as not hotpluggable.
Gerd Hoffmann [Thu, 6 Jan 2011 14:14:38 +0000 (15:14 +0100)]
piix: tag as not hotpluggable.

This patch tags all pci devices which belong to the piix3/4 chipsets as
not hotpluggable (Host bridge, ISA bridge, IDE controller, ACPI bridge).

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: allow devices being tagged as not hotpluggable.
Gerd Hoffmann [Thu, 6 Jan 2011 14:14:37 +0000 (15:14 +0100)]
pci: allow devices being tagged as not hotpluggable.

This patch adds a field to PCIDeviceInfo to tag devices as being
not hotpluggable.  Any attempt to plug-in or -out such a device
will throw an error.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoslirp: fix unaligned access in bootp code
Aurelien Jarno [Thu, 6 Jan 2011 21:43:13 +0000 (22:43 +0100)]
slirp: fix unaligned access in bootp code

Slirp code tries to be smart an avoid data copy by using pointer to
the data. This solution leads to unaligned access, in this case
preq_addr, which is a 32-bit long structure. There is no real point
of avoiding data copy in a such case, as the value itself is smaller
or the same size as a pointer.

The patch replaces pointers to the preq_addr structure by the strcture
itself, and use the address 0.0.0.0 if no address has been requested
(this is not a valid address in such a request). It compares it with
htonl(0L) for correctness reasons, in case a code checker look for such
mistakes. It also uses memcpy() for copying the data, which takes care
of alignement issues.

This fixes an unaligned access on IA64 host while requesting a DHCP
address.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agobswap.h: add cpu_to_be64wu()
Aurelien Jarno [Thu, 6 Jan 2011 21:43:13 +0000 (22:43 +0100)]
bswap.h: add cpu_to_be64wu()

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotcg/arm: improve constant loading
Aurelien Jarno [Thu, 6 Jan 2011 21:43:13 +0000 (22:43 +0100)]
tcg/arm: improve constant loading

Improve constant loading in two ways:
- On all ARM versions, it's possible to load 0xffffff00 = -0x100 using
  the mvn rd, #0. Fix the conditions.
- On <= ARMv6 versions, where movw and movt are not available, load the
  constants using mov and orr with rotations depending on the constant
  to load. This is very useful for example to load constants where the
  low byte is 0. This reduce the generated code size by about 7%.

Also fix the coding style at the same time.

Cc: Andrzej Zaborowski <balrog@zabor.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotcg/ia64: remove an unnecessary stop bit
Aurelien Jarno [Mon, 10 Jan 2011 00:39:49 +0000 (01:39 +0100)]
tcg/ia64: remove an unnecessary stop bit

Spotted by Richard Henderson.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-sh4: improve TLB
Aurelien Jarno [Sun, 9 Jan 2011 22:53:45 +0000 (23:53 +0100)]
target-sh4: improve TLB

SH4 is using 16-bit instructions which means most of the constants are
loaded through a constant pool at the end of the subroutine. The same
memory page is therefore accessed in exec and read mode.

With the current implementation, a QEMU TLB entry is set to read or
read/write mode after an UTLB search and to exec mode after an ITLB
search, which causes a lot of TLB exceptions to switch from read or
read/write to exec and vice versa.

This patch optimizes that by already setting the QEMU TLB entry in read
or read/write mode when an UTLB entry is copied into ITLB (during an
ITLB miss). This improve the emulation speed by about 14%.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-sh4: implement writes to mmaped ITLB
Aurelien Jarno [Sun, 9 Jan 2011 22:53:45 +0000 (23:53 +0100)]
target-sh4: implement writes to mmaped ITLB

Some Linux kernels seems to implement ITLB/UTLB flushing through by
writing all TLB entries through the memory mapped interface instead
of writing one to MMUCR.TI.

Implement memory mapped ITLB write interface so that such kernels can
boot. This fixes https://bugs.launchpad.net/bugs/700774 .

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotcg: fix typo in readme
Mike Frysinger [Sun, 9 Jan 2011 08:45:45 +0000 (03:45 -0500)]
tcg: fix typo in readme

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agotcg/README: Spelling fixes
Stefan Weil [Fri, 7 Jan 2011 20:34:50 +0000 (21:34 +0100)]
tcg/README: Spelling fixes

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoqemu-tech: Spelling fixes
Stefan Weil [Fri, 7 Jan 2011 20:31:39 +0000 (21:31 +0100)]
qemu-tech: Spelling fixes

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoqemu-doc: Spelling fixes
Stefan Weil [Fri, 7 Jan 2011 17:59:16 +0000 (18:59 +0100)]
qemu-doc: Spelling fixes

neccessary -> necessary
Keberos -> Kerberos
emuilated -> emulated
transciever -> transceiver
emulaton -> emulation
inital -> initial
MingGW -> MinGW

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoqemu-doc: Add missing blanks
Stefan Weil [Fri, 7 Jan 2011 17:59:15 +0000 (18:59 +0100)]
qemu-doc: Add missing blanks

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoqemu-doc: Add missing menu entry
Stefan Weil [Fri, 7 Jan 2011 17:59:14 +0000 (18:59 +0100)]
qemu-doc: Add missing menu entry

Each @section should have a menu entry and a @node entry.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoqemu-doc: Clean whitespace
Stefan Weil [Fri, 7 Jan 2011 17:59:13 +0000 (18:59 +0100)]
qemu-doc: Clean whitespace

Remove blanks at line endings.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agousb-bsd: fix a file descriptor leak
Blue Swirl [Sun, 9 Jan 2011 14:43:33 +0000 (14:43 +0000)]
usb-bsd: fix a file descriptor leak

Fix a file descriptor leak reported by cppcheck:
[/src/qemu/usb-bsd.c:392]: (error) Resource leak: bfd
[/src/qemu/usb-bsd.c:388]: (error) Resource leak: dfd

Rearrange the code to avoid descriptor leaks. Also add braces as
needed.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoalsaaudio: add endianness support for VoiceIn
Michael Walle [Sat, 8 Jan 2011 16:53:30 +0000 (17:53 +0100)]
alsaaudio: add endianness support for VoiceIn

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: malc <av1474@comtv.ru>
13 years agoossaudio: add endianness support for VoiceIn
Michael Walle [Sat, 8 Jan 2011 16:53:29 +0000 (17:53 +0100)]
ossaudio: add endianness support for VoiceIn

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: malc <av1474@comtv.ru>
13 years agotcg/mips: fix branch target change during code retranslation
Aurelien Jarno [Thu, 6 Jan 2011 21:43:14 +0000 (22:43 +0100)]
tcg/mips: fix branch target change during code retranslation

TCG on MIPS was trying to avoid changing the branch offset, but didn't
due to a stupid typo. Fix it.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotcg/arm: fix qemu_st64 for big endian targets
Aurelien Jarno [Thu, 6 Jan 2011 21:43:13 +0000 (22:43 +0100)]
tcg/arm: fix qemu_st64 for big endian targets

Due to a typo, qemu_st64 doesn't properly byteswap the 32-bit low word of
a 64 bit word before saving it. This patch fixes that.

Acked-by: Andrzej Zaborowski <balrogg@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotcg/arm: fix branch target change during code retranslation
Aurelien Jarno [Thu, 6 Jan 2011 21:43:13 +0000 (22:43 +0100)]
tcg/arm: fix branch target change during code retranslation

QEMU uses code retranslation to restore the CPU state when an exception
happens. For it to work the retranslation must not modify the generated
code. This is what is currently implemented in ARM TCG.

However on CPU that don't have icache/dcache/memory synchronised like
ARM, this requirement is stronger and code retranslation must not modify
the generated code "atomically", as the cache line might be flushed
at any moment (interrupt, exception, task switching), even if not
triggered by QEMU. The probability for this to happen is very low, and
depends on cache size and associativiy, machine load, interrupts, so the
symptoms are might happen randomly.

This requirement is currently not followed in tcg/arm, for the
load/store code, which basically has the following structure:
  1) tlb access code is written
  2) conditional fast path code is written
  3) branch is written with a temporary target
  4) slow path code is written
  5) branch target is updated
The cache lines corresponding to the retranslated code is not flushed
after code retranslation as the generated code is supposed to be the
same. However if the cache line corresponding to the branch instruction
is flushed between step 3 and 5, and is not flushed again before the
code is executed again, the branch target is wrong. In the guest, the
symptoms are MMU page fault at a random addresses, which leads to
kernel page fault or segmentation faults.

The patch fixes this issue by avoiding writing the branch target until
it is known, that is by writing only the branch instruction first, and
later only the offset.

This fixes booting linux guests on ARM hosts (tested: arm, i386, mips,
mipsel, sh4, sparc).

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoMerge branch 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemu
Aurelien Jarno [Sat, 8 Jan 2011 15:25:48 +0000 (16:25 +0100)]
Merge branch 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemu

* 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemu:
  Remove dead code for ARM semihosting commandline handling
  Fix commandline handling for ARM semihosted executables
  linux-user: Fix incorrect NaN detection in ARM nwfpe emulation
  softfloat: Implement floatx80_is_any_nan() and float128_is_any_nan()
  linux-user: Implement FS_IOC_FIEMAP ioctl
  linux-user: Support ioctls whose parameter size is not constant
  linux-user: Implement sync_file_range{,2} syscalls

13 years agoRemove dead code for ARM semihosting commandline handling
Wolfgang Schildbach [Mon, 6 Dec 2010 15:06:06 +0000 (15:06 +0000)]
Remove dead code for ARM semihosting commandline handling

There are some bits in the code which were used to store the commandline for
the semihosting call. These bits are now write-only and can be removed.

Signed-off-by: Wolfgang Schildbach <wschi@dolby.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
13 years agoFix commandline handling for ARM semihosted executables
Wolfgang Schildbach [Mon, 6 Dec 2010 15:06:05 +0000 (15:06 +0000)]
Fix commandline handling for ARM semihosted executables

Use the copy of the command line that loader_build_argptr() sets up in guest
memory as the command line to return from the ARM SYS_GET_CMDLINE semihosting
call. Previously we were using a pointer to memory which had already been
freed before the guest program started.

This fixes https://bugs.launchpad.net/qemu/+bug/673613 .

Signed-off-by: Wolfgang Schildbach <wschi@dolby.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
13 years agolinux-user: Fix incorrect NaN detection in ARM nwfpe emulation
Peter Maydell [Thu, 6 Jan 2011 18:34:44 +0000 (18:34 +0000)]
linux-user: Fix incorrect NaN detection in ARM nwfpe emulation

The code in the linux-user ARM nwfpe emulation was incorrectly
checking only for quiet NaNs when it should have been checking
for any kind of NaN. This is probably because the code in
question was taken from the Linux kernel, whose copy of the
softfloat library had been modified so that float*_is_nan()
returned true for all NaNs, not just quiet ones. The qemu
equivalent function is float*_is_any_nan(), so use that.
NB that this code is really obsolete since nobody uses FPE
for actual arithmetic now; this is just cleanup following
the recent renaming of the NaN related functions.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
13 years agosoftfloat: Implement floatx80_is_any_nan() and float128_is_any_nan()
Peter Maydell [Thu, 6 Jan 2011 18:34:43 +0000 (18:34 +0000)]
softfloat: Implement floatx80_is_any_nan() and float128_is_any_nan()

Implement versions of float*_is_any_nan() for the floatx80 and
float128 types.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
13 years agolinux-user: Implement FS_IOC_FIEMAP ioctl
Peter Maydell [Thu, 6 Jan 2011 15:04:18 +0000 (15:04 +0000)]
linux-user: Implement FS_IOC_FIEMAP ioctl

Implement the FS_IOC_FIEMAP ioctl using the new support for
custom handling of ioctls; this is needed because the struct
that is passed includes a variable-length array.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
13 years agolinux-user: Support ioctls whose parameter size is not constant
Peter Maydell [Thu, 6 Jan 2011 15:04:17 +0000 (15:04 +0000)]
linux-user: Support ioctls whose parameter size is not constant

Some ioctls (for example FS_IOC_FIEMAP) use structures whose size is
not constant. The generic argument conversion code in do_ioctl()
cannot handle this, so add support for implementing a special-case
handler for a particular ioctl which does the conversion itself.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
13 years agocris: Allow more TB chaning
Edgar E. Iglesias [Fri, 7 Jan 2011 15:18:13 +0000 (16:18 +0100)]
cris: Allow more TB chaning

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agolinux-user: Implement sync_file_range{,2} syscalls
Peter Maydell [Thu, 6 Jan 2011 11:05:10 +0000 (11:05 +0000)]
linux-user: Implement sync_file_range{,2} syscalls

Implement the missing syscalls sync_file_range and sync_file_range2.
The latter in particular is used by newer versions of apt on Ubuntu
for ARM.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
13 years agocris: Avoid useless tmp in t_gen_cc_jmp()
Edgar E. Iglesias [Fri, 7 Jan 2011 11:50:38 +0000 (12:50 +0100)]
cris: Avoid useless tmp in t_gen_cc_jmp()

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agocirrus: delete GCC 4.6 warnings
Aurelien Jarno [Thu, 6 Jan 2011 21:28:33 +0000 (22:28 +0100)]
cirrus: delete GCC 4.6 warnings

Commit 92d675d1c1f23f3617e24b63c825074a1d1da44b triggered uninitialized
variables warning with GCC 4.6. Fix them by adding zero initializers.

Acked-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: wire up the softfloat flush_input_to_zero flag
Peter Maydell [Thu, 6 Jan 2011 19:37:55 +0000 (19:37 +0000)]
target-arm: wire up the softfloat flush_input_to_zero flag

Wire up the new softfloat support for flushing input denormals
to zero on ARM. The FPSCR FZ bit enables flush-to-zero for
both inputs and outputs, but the reporting of when inputs are
flushed to zero is via a separate IDC bit rather than the UFC
(underflow) bit used when output denormals are flushed to zero.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Set softfloat cumulative exc flags from correct FPSCR bits
Peter Maydell [Thu, 6 Jan 2011 19:37:54 +0000 (19:37 +0000)]
target-arm: Set softfloat cumulative exc flags from correct FPSCR bits

When handling a write to the ARM FPSCR, set the softfloat cumulative
exception flags from the cumulative flags in the FPSCR, not the
exception-enable bits. Also don't apply a mask: vfp_exceptbits_to_host
will only look at the correct bits anyway.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosoftfloat: Implement flushing input denormals to zero
Peter Maydell [Thu, 6 Jan 2011 19:37:53 +0000 (19:37 +0000)]
softfloat: Implement flushing input denormals to zero

Add support to softfloat for flushing input denormal float32 and float64
to zero. softfloat's existing 'flush_to_zero' flag only flushes denormals
to zero on output. Some CPUs need input denormals to be flushed before
processing as well. Implement this, using a new status flag to enable it
and a new exception status bit to indicate when it has happened. Existing
CPUs should be unaffected as there is no behaviour change unless the
mode is enabled.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: fix SMMLA/SMMLS instructions
Aurelien Jarno [Thu, 6 Jan 2011 18:53:56 +0000 (19:53 +0100)]
target-arm: fix SMMLA/SMMLS instructions

SMMLA and SMMLS are broken on both in normal and thumb mode, that is
both (different) implementations are wrong. They try to avoid a 64-bit
add for the rounding, which is not trivial if you want to support both
SMMLA and SMMLS with the same code.

The code below uses the same implementation for both modes, using the
code from the ARM manual. It also fixes the thumb decoding that was a
mix between normal and thumb mode.

This fixes the issues reported in
https://bugs.launchpad.net/qemu/+bug/629298

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoblock: delete a write-only variable
Blue Swirl [Thu, 6 Jan 2011 18:25:37 +0000 (18:25 +0000)]
block: delete a write-only variable

Avoid a warning with GCC 4.6.0:
/src/qemu/block.c: In function 'bdrv_img_create':
/src/qemu/block.c:2862:25: error: variable 'fmt' set but not used [-Werror=unused-but-set-variable]

CC: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agocirrus_vga: Declare as little endian
Blue Swirl [Thu, 6 Jan 2011 18:25:26 +0000 (18:25 +0000)]
cirrus_vga: Declare as little endian

This patch replaces explicit bswaps with endianness hints to the
mmio layer.

CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agopc: move port 92 stuff back to pc.c from pckbd.c
Blue Swirl [Thu, 6 Jan 2011 18:24:35 +0000 (18:24 +0000)]
pc: move port 92 stuff back to pc.c from pckbd.c

956a3e6bb7386de48b642d4fee11f7f86a2fcf9a introduced a bug concerning
reset bit for port 92.

Since the keyboard output port and port 92 are not compatible anyway,
let's separate them.

Reported-by: Peter Lieven <pl@dlh.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
--
v2: added reset handler and VMState

13 years agotarget-ppc: Implement correct NaN propagation rules
Aurelien Jarno [Thu, 6 Jan 2011 14:38:19 +0000 (15:38 +0100)]
target-ppc: Implement correct NaN propagation rules

Implement the correct NaN propagation rules for PowerPC targets by
providing an appropriate pickNaN function.

Also fix the #ifdef tests for default NaN definition, the correct name
is TARGET_PPC instead of TARGET_POWERPC.

Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-mips: Implement correct NaN propagation rules
Aurelien Jarno [Thu, 6 Jan 2011 14:38:19 +0000 (15:38 +0100)]
target-mips: Implement correct NaN propagation rules

Implement the correct NaN propagation rules for MIPS targets by
providing an appropriate pickNaN function.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosoftfloat: use float{32,64,x80,128}_maybe_silence_nan()
Aurelien Jarno [Thu, 6 Jan 2011 14:38:19 +0000 (15:38 +0100)]
softfloat: use float{32,64,x80,128}_maybe_silence_nan()

Use float{32,64,x80,128}_maybe_silence_nan() instead of toggling the
sNaN bit manually. This allow per target implementation of sNaN to qNaN
conversion.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
13 years agosoftfloat: add float{x80,128}_maybe_silence_nan()
Aurelien Jarno [Thu, 6 Jan 2011 14:38:19 +0000 (15:38 +0100)]
softfloat: add float{x80,128}_maybe_silence_nan()

Add float{x80,128}_maybe_silence_nan() functions, they will be need by
propagateFloat{x80,128}NaN().

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosoftfloat: fix float{32,64}_maybe_silence_nan() for MIPS
Aurelien Jarno [Thu, 6 Jan 2011 14:38:19 +0000 (15:38 +0100)]
softfloat: fix float{32,64}_maybe_silence_nan() for MIPS

On targets that define sNaN with the sNaN bit as one, simply clearing
this bit may correspond to an infinite value.

Convert it to a default NaN if SNAN_BIT_IS_ONE, as it corresponds to
the MIPS implementation, the only emulated CPU with SNAN_BIT_IS_ONE.
When other CPU of this type are added, this might be updated to include
more cases.

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosoftfloat: rename *IsNaN variables to *IsQuietNaN
Aurelien Jarno [Thu, 6 Jan 2011 14:38:19 +0000 (15:38 +0100)]
softfloat: rename *IsNaN variables to *IsQuietNaN

Similarly to what has been done in commit
185698715dfb18c82ad2a5dbc169908602d43e81 rename the misnamed *IsNaN
variables into *IsQuietNaN.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosoftfloat: remove HPPA specific code
Aurelien Jarno [Thu, 6 Jan 2011 14:38:19 +0000 (15:38 +0100)]
softfloat: remove HPPA specific code

We don't have any HPPA target, so let's remove HPPA specific code. It
can be re-added when someone adds an HPPA target.

This has been blessed by Stuart Brady <sdb@zubnet.me.uk>, author of the
target-hppa fork.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-ppc: use float32_is_any_nan()
Aurelien Jarno [Thu, 6 Jan 2011 14:38:18 +0000 (15:38 +0100)]
target-ppc: use float32_is_any_nan()

Use the new function float32_is_any_nan() instead of
float32_is_quiet_nan() || float32_is_signaling_nan().

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-ppc: fix default qNaN
Aurelien Jarno [Thu, 6 Jan 2011 14:38:18 +0000 (15:38 +0100)]
target-ppc: fix default qNaN

On PPC the default qNaN doesn't have the sign bit set.

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-ppc: remove PRECISE_EMULATION define
Aurelien Jarno [Thu, 6 Jan 2011 14:38:18 +0000 (15:38 +0100)]
target-ppc: remove PRECISE_EMULATION define

The PRECISE_EMULATION is "hardcoded" to one in target-ppc/exec.h and not
something easily tunable. Remove it and non-precise emulation code as
it doesn't make a noticeable difference in speed. People wanting speed
improvement should use softfloat-native instead.

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agortl8139: Use subsection to restrict migration after hotplug
Alex Williamson [Tue, 4 Jan 2011 19:38:02 +0000 (12:38 -0700)]
rtl8139: Use subsection to restrict migration after hotplug

rtl8139 includes a cpu_register_io_memory acquired value in it's
migration data.  This is not only unecessary, but we should treat
these values as unique to the VM instances since the value depends
on call order.  In most cases, this miraculously still works.
However, if devices are added or removed from the system, it may
represent an ordering change, which could cause the target rtl8139
device to make use of another device's cpu_register_io_memory value.
If we detect that a hot-add/remove has occured, include a subsection
to restrict migrations only to driver versions known to include this
fix.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqdev: Track runtime machine modifications
Alex Williamson [Tue, 4 Jan 2011 19:37:50 +0000 (12:37 -0700)]
qdev: Track runtime machine modifications

Create a trivial interface to track whether the machine has been
modified since boot.  Adding or removing devices will trigger this
to return true.  An example usage scenario for such an interface is
the rtl8139 driver which includes a cpu_register_io_memory() value
in it's migration stream.  For the majority of migrations, where
no hotplug has occured in the machine, this works correctly.  Once
the machine is modified, we can use this interface to detect that
and include a subsection for the device to prevent migrations to
rtl8139 versions with this bug.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agomicroblaze: Use more TB chaining
Edgar E. Iglesias [Wed, 5 Jan 2011 01:21:19 +0000 (02:21 +0100)]
microblaze: Use more TB chaining

For some workloads with tight loops this ~doubles the emulation
speed.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
13 years agocirrus_vga: fix division by 0 for color expansion rop
Aurelien Jarno [Tue, 4 Jan 2011 20:58:24 +0000 (21:58 +0100)]
cirrus_vga: fix division by 0 for color expansion rop

Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regression
with Windows ME that leads to a division by 0 and a crash.

It uses the color expansion rop with the source pitch set to 0. This is
something allowed, as the manual explicitely says "When the source of
color-expand data is display memory, the source pitch is ignored.".

This patch fixes this regression by computing sx, sy and others
variables only if they are going to be used later, that is for a plain
copy ROP. It basically consists in moving code.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoFix curses on big endian hosts
Aurelien Jarno [Tue, 4 Jan 2011 20:58:24 +0000 (21:58 +0100)]
Fix curses on big endian hosts

On big endian hosts, the curses interface is unusable: the emulated
graphic card only displays garbage, while the monitor interface displays
nothing (or rather only spaces).

The curses interface is waiting for data in native endianness, so
console_write_ch() should not do any conversion. The conversion should
be done when reading the video buffer in hw/vga.c. I supposed this
buffer is in little endian mode, though it's not impossible that the
data is actually in guest endianness. I currently have no big endian
guest to way (they all switch to graphic mode immediately).

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agonoaudio: correctly account acquired samples
Michael Walle [Tue, 4 Jan 2011 00:48:55 +0000 (01:48 +0100)]
noaudio: correctly account acquired samples

This will fix the return value of the function which otherwise returns too
many samples because sw->total_hw_samples_acquired isn't correctly
accounted.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: malc <av1474@comtv.ru>
13 years agotarget-arm: Implement correct NaN propagation rules
Peter Maydell [Thu, 16 Dec 2010 11:51:18 +0000 (11:51 +0000)]
target-arm: Implement correct NaN propagation rules

Implement the correct NaN propagation rules for ARM targets by
providing an appropriate pickNaN function.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosoftfloat: abstract out target-specific NaN propagation rules
Peter Maydell [Thu, 16 Dec 2010 11:51:17 +0000 (11:51 +0000)]
softfloat: abstract out target-specific NaN propagation rules

IEEE754 doesn't specify precisely what NaN should be returned as
the result of an operation on two input NaNs. This is therefore
target-specific. Abstract out the code in propagateFloat*NaN()
which was implementing the x87 propagation rules, so that it
can be easily replaced on a per-target basis.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosoftfloat: Rename float*_is_nan() functions to float*_is_quiet_nan()
Peter Maydell [Fri, 17 Dec 2010 15:56:06 +0000 (15:56 +0000)]
softfloat: Rename float*_is_nan() functions to float*_is_quiet_nan()

The softfloat functions float*_is_nan() were badly misnamed,
because they return true only for quiet NaNs, not for all NaNs.
Rename them to float*_is_quiet_nan() to more accurately reflect
what they do.

This change was produced by:
 perl -p -i -e 's/_is_nan/_is_quiet_nan/g' $(git grep -l is_nan)
(with the results manually checked.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoTCG: Improve tb_phys_hash_func()
Aurelien Jarno [Tue, 28 Dec 2010 16:46:59 +0000 (17:46 +0100)]
TCG: Improve tb_phys_hash_func()

Most of emulated CPU have instructions aligned on 16 or 32 bits, while
on others GCC tries to align the target jump location. This means that
1/2 or 3/4 of tb_phys_hash entries are never used.

Update the hash function tb_phys_hash_func() to ignore the two lowest
bits of the address. This brings a 6% speed-up when booting a MIPS
image.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: fix UMAAL instruction
Aurelien Jarno [Fri, 31 Dec 2010 16:50:27 +0000 (17:50 +0100)]
target-arm: fix UMAAL instruction

UMAAL should use unsigned multiply instead of signed.

This patch fixes this issue by handling UMAAL separately from
UMULL/UMLAL/SMULL/SMLAL as these instructions are different
enough. It also explicitly list instructions in case and catch
nonexistent instruction as illegal. Also fixes a few style issues.

This fixes the issues reported in
https://bugs.launchpad.net/qemu/+bug/696015

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoFix translation of unary PPC/SPE instructions (efdneg etc.).
Mike Pall [Fri, 31 Dec 2010 20:17:53 +0000 (21:17 +0100)]
Fix translation of unary PPC/SPE instructions (efdneg etc.).

Signed-off-by: Mike Pall <mike-lp10@luajit.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-sparc: fix udiv(cc) and sdiv(cc)
Aurelien Jarno [Sat, 25 Dec 2010 22:25:47 +0000 (23:25 +0100)]
target-sparc: fix udiv(cc) and sdiv(cc)

Since commit 5a4bb580cdb10b066f9fd67658b31cac4a4ea5e5, Xorg crashes on
a Debian Etch image. The commit itself is fine, but it triggers a bug
due to wrong computation of flags for udiv(cc) and sdiv(cc).

This patch only compute cc_src2 for the cc version of udiv/sdiv. It
also moves the update of cc_dst and cc_op to the helper, as it is
faster doing it here when there is already an helper.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoMerge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu
Aurelien Jarno [Mon, 27 Dec 2010 21:59:48 +0000 (22:59 +0100)]
Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu

* 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu:
  vnc/spice: add set_passwd monitor command.
  vnc: support password expire
  vnc: auth reject cleanup
  spice: add qmp 'query-spice' and hmp 'info spice' commands.
  spice: connection events.
  spice: add qxl device
  spice: add qxl vgabios binary.

13 years agox86: Filter out garbage from segment flags dump
Jan Kiszka [Mon, 27 Dec 2010 14:52:24 +0000 (15:52 +0100)]
x86: Filter out garbage from segment flags dump

Only bits 8..23 of the segment flags contain valid data, so only dump
those when printing the CPU state.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoFix migrate set speed doc arg
Luiz Capitulino [Wed, 15 Dec 2010 19:56:18 +0000 (17:56 -0200)]
Fix migrate set speed doc arg

We used to ignore any fractional part in 0.13, but due to recent
changes (started with 9f9b17a4f0865286391e4d3a0a735230122a2289)
migrate_set_speed will reject the fractional part.

We don't expect existing clients to be relying on this, but we
need to update the documentation to reflect the change.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: correct cp15 c1_sys reset value for arm1136 and cortex-a9
Juha Riihimäki [Wed, 8 Dec 2010 11:15:18 +0000 (13:15 +0200)]
target-arm: correct cp15 c1_sys reset value for arm1136 and cortex-a9

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: correct cp15 c1_sys reset value for cortex-a8
Mattias Holm [Wed, 8 Dec 2010 11:15:17 +0000 (13:15 +0200)]
target-arm: correct cp15 c1_sys reset value for cortex-a8

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: fix vmsav6 access control
Juha Riihimäki [Wed, 8 Dec 2010 11:15:16 +0000 (13:15 +0200)]
target-arm: fix vmsav6 access control

Override access control checks (including execute) for mmu translation
table descriptors assigned to manager domains.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Correct result in saturating cases for VQSHL of s8/16/32
Peter Maydell [Tue, 7 Dec 2010 14:13:45 +0000 (14:13 +0000)]
target-arm: Correct result in saturating cases for VQSHL of s8/16/32

Where VQSHL of a signed 8/16/32 bit value saturated, the result
value was not being calculated correctly (it should be either
the minimum or maximum value for the size of the signed type).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: remove pointless else clause in VQSHL of u64
Juha Riihimäki [Tue, 7 Dec 2010 14:13:44 +0000 (14:13 +0000)]
target-arm: remove pointless else clause in VQSHL of u64

Remove a pointless else clause in the neon_qshl_u64 helper.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Fix VQSHL of signed 64 bit values by shift counts >= 64
Peter Maydell [Tue, 7 Dec 2010 14:13:43 +0000 (14:13 +0000)]
target-arm: Fix VQSHL of signed 64 bit values by shift counts >= 64

VQSHL of a signed 64 bit non-zero value by a shift count >= 64 should
saturate; return the correct value in this case.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Fix VQSHL of signed 64 bit values
Juha Riihimäki [Tue, 7 Dec 2010 14:13:42 +0000 (14:13 +0000)]
target-arm: Fix VQSHL of signed 64 bit values

Add a missing '-' which meant that we were misinterpreting the shift
argument for VQSHL of 64 bit signed values and treating almost every
shift value as if it were an extremely large right shift.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Fix arguments passed to VQSHL helpers
Juha Riihimäki [Tue, 7 Dec 2010 14:13:41 +0000 (14:13 +0000)]
target-arm: Fix arguments passed to VQSHL helpers

Correct the arguments passed when generating neon qshl_{u,s}64()
helpers so that we use the correct registers.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: fix bug in translation of REVSH
Aurelien Jarno [Mon, 27 Dec 2010 18:54:49 +0000 (19:54 +0100)]
target-arm: fix bug in translation of REVSH

The translation of REVSH shifted the low byte 8 steps left before performing
an 8-bit sign extend, causing this part of the expression to alwas be 0.

Reported-by: Johan Bengtsson <teofrastius@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoFix a missing trailing newline
Aurelien Jarno [Mon, 27 Dec 2010 17:29:20 +0000 (18:29 +0100)]
Fix a missing trailing newline

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agopci: fix migration path for devices behind bridges
Michael S. Tsirkin [Mon, 27 Dec 2010 09:21:38 +0000 (11:21 +0200)]
pci: fix migration path for devices behind bridges

The device path used for migration is currently broken for
for all devices behind a nested bridge.

Replace this by a hierarchical list of slot/function numbers, walking
the path from root down to device. Add :00 after the domain number
so that if there are no nested bridges, this is compatible
with what we have now.

Note: as pointed out by Gleb, using openfirmware paths
might be cleaner, doing this would break compatibility though,
and the IDs used are not guest or user visible at all,
so breaking the compatibility is probably not worth it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agotarget-mips: fix host CPU consumption when guest is idle
Aurelien Jarno [Sat, 25 Dec 2010 21:56:32 +0000 (22:56 +0100)]
target-mips: fix host CPU consumption when guest is idle

When the CPU is in wait state, do not wake-up if an interrupt can't be
taken. This avoid host CPU running at 100% if a device (e.g. timer) has
an interrupt line left enabled.

Also factorize code to check if interrupts are enabled in
cpu_mips_hw_interrupts_pending().

Based on a patch from Edgar E. Iglesias <edgar.iglesias@gmail.com>

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agos390: compile fixes
Alexander Graf [Wed, 17 Nov 2010 12:01:04 +0000 (13:01 +0100)]
s390: compile fixes

The s390 target doesn't compile out of the box anymore. This patch fixes all
the obvious glitches that got introduced in the last few weeks.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agopcie/aer: glue aer error injection into qemu monitor
Isaku Yamahata [Fri, 24 Dec 2010 03:14:14 +0000 (12:14 +0900)]
pcie/aer: glue aer error injection into qemu monitor

introduce pcie_aer_inject_error command.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: introduce a helper function to convert qdev id to PCIDevice
Isaku Yamahata [Fri, 24 Dec 2010 03:14:13 +0000 (12:14 +0900)]
pci: introduce a helper function to convert qdev id to PCIDevice

This patch introduce a helper function to get PCIDevice from qdev id.
This function will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqdev: export qdev_find_recursive() for later use
Isaku Yamahata [Fri, 24 Dec 2010 03:14:12 +0000 (12:14 +0900)]
qdev: export qdev_find_recursive() for later use

This patch exports qdev_find_recursive() for later use.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agobuild, pci: remove QMP dependency on core PCI code
Isaku Yamahata [Wed, 22 Dec 2010 10:54:48 +0000 (19:54 +0900)]
build, pci: remove QMP dependency on core PCI code

by introducing pci-stub.c, eliminate QMP dependency on core PCI code
rquired by query-pci command.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agotarget-mips: fix translation of MT instructions
Nathan Froyd [Fri, 29 Oct 2010 14:48:46 +0000 (07:48 -0700)]
target-mips: fix translation of MT instructions

The translation of dmt/emt/dvpe/evpe was doing the moral equivalent of:

  int x;
  ... /* no initialization of x */
  x = f (x);

which confused later bits of TCG rather badly, leading to crashes.

Fix the helpers to only return results (those instructions have no
inputs), and fix the translation code accordingly.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agopcie: add flr support
Isaku Yamahata [Wed, 22 Dec 2010 06:14:35 +0000 (15:14 +0900)]
pcie: add flr support

Support flr: trigger device reset on flr config write.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopc/piix: fix mismerge of b1aeb92666d2fde413c34578b3b42bbfe5f2a506
Isaku Yamahata [Wed, 22 Dec 2010 06:13:43 +0000 (15:13 +0900)]
pc/piix: fix mismerge of b1aeb92666d2fde413c34578b3b42bbfe5f2a506

The change set of b1aeb92666d2fde413c34578b3b42bbfe5f2a506 in pci branch
was mismerged. The compatibility should be kept for 0.13, not for 0.14.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoUse mmap() within code_gen_alloc() for OpenBSD.
Brad [Tue, 21 Dec 2010 02:25:40 +0000 (21:25 -0500)]
Use mmap() within code_gen_alloc() for OpenBSD.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoAdd OpenBSD to ifdef list since it has CLOCK_MONOTONIC.
Brad [Tue, 21 Dec 2010 02:24:32 +0000 (21:24 -0500)]
Add OpenBSD to ifdef list since it has CLOCK_MONOTONIC.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoAdd support for OpenBSD to QEMU's tap driver.
Brad [Tue, 21 Dec 2010 02:23:15 +0000 (21:23 -0500)]
Add support for OpenBSD to QEMU's tap driver.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agotcg-arm: fix __clear_cache() warning
Aurelien Jarno [Tue, 21 Dec 2010 18:32:49 +0000 (19:32 +0100)]
tcg-arm: fix __clear_cache() warning

Use __builtin___clear_cache() instead of __clear_cache() to avoid having
to define the function as extern. Fix the following warning:

| In file included from qemu/cpus.c:34:
| qemu/exec-all.h: In function 'tb_set_jmp_target1':
| qemu/exec-all.h:208: error: nested extern declaration of '__clear_cache'
| make[1]: *** [cpus.o] Error 1
| make: *** [subdir-i386-softmmu] Error 2

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoqdev: sysbus_get_default must not return a NULL pointer (fix regression)
Stefan Weil [Thu, 16 Dec 2010 18:33:22 +0000 (19:33 +0100)]
qdev: sysbus_get_default must not return a NULL pointer (fix regression)

Every system should have some sort of main system bus,
so sysbus_get_default should always return a valid bus.

Without this patch, at least mipssim and malta no longer
start but raise a null pointer access exception (caused by
commit ec990eb622ad46df5ddcb1e94c418c271894d416).

Cc: Anthony Liguori <anthony@codemonkey.ws>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoqdev: remove an unused function
Michael S. Tsirkin [Mon, 20 Dec 2010 13:17:10 +0000 (15:17 +0200)]
qdev: remove an unused function

qbus_reset_all is unused, remove it

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agosparc32: ledma extra registers need tracing too
Bob Breuer [Mon, 20 Dec 2010 17:55:33 +0000 (11:55 -0600)]
sparc32: ledma extra registers need tracing too

Also trace the extra registers, and update the comments with new
info from Artyom Tarasenko.

Signed-off-by: Bob Breuer <breuerr@mc.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agotarget-i386: Fix accidental use of SoftFloat uint64 type
Andreas Färber [Sun, 19 Dec 2010 16:22:41 +0000 (17:22 +0100)]
target-i386: Fix accidental use of SoftFloat uint64 type

softfloat.h's uint64 type has least-width semantics.
Use uint64_t instead since that is used in helpers.

v4:
* Summary change.

v3:
* Split off.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Huang Ying <ying.huang@intel.com>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agowdt_ib700: Fix accidental use of SoftFloat int64 type
Andreas Färber [Sun, 19 Dec 2010 16:22:40 +0000 (17:22 +0100)]
wdt_ib700: Fix accidental use of SoftFloat int64 type

softfloat.h's int64 type has least-width semantics.
Since we're assigning an int64_t, use plain int64_t.

v4:
* Summary change.

v3:
* Split off.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoapic: Fix accidental use of SoftFloat uint32 type
Andreas Färber [Sun, 19 Dec 2010 16:22:39 +0000 (17:22 +0100)]
apic: Fix accidental use of SoftFloat uint32 type

softfloat.h's uint32 type has least-width semantics.
Surrounding code uses uint32_t, so use uint32_t here, too.

v4:
* Summary change.

v3:
* Split off.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoqbus: register reset handler for qbus whose parent is NULL
Isaku Yamahata [Mon, 20 Dec 2010 05:33:35 +0000 (14:33 +0900)]
qbus: register reset handler for qbus whose parent is NULL

Stefan Weil reported the regression caused by
ec990eb622ad46df5ddcb1e94c418c271894d416 as follows

> The second regression also occurs with MIPS malta.
> Networking no longer works with the default pcnet nic.
>
> This is caused because the reset function for pcnet is no
> longer called during system boot. The result in an invalid
> mac address (all zero) and a non-working nic.
>
> For this second regression I still have no simple solution.
> Of course mips_malta.c should be converted to qdev which
> would fix both problems (but only for malta system emulation).

The issue is, it is assumed that all qbuses, qdeves are under
main_system_bus. But there are qbuses whose parent is NULL. So it
is necessary to trigger reset for those qbuses.
(On the other hand, if NULL is passed to qdev_create(), its parent bus
is main_system_bus.)
Ideally those buses should be moved under bus controller
device which is qdev. But it's not done yet.
So register qbus reset handler for qbus whose parent is NULL.

Reported-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoAvoid a warning from OpenBSD linker
Blue Swirl [Sun, 19 Dec 2010 14:05:43 +0000 (14:05 +0000)]
Avoid a warning from OpenBSD linker

Avoid the warning below by using snprintf:
../libhw64/vl.o(.text+0x78d4): In function `get_boot_devices_list':
/src/qemu/vl.c:763: warning: sprintf() is often misused, please use snprintf()

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoSparc: implement monitor command 'info tlb'
Blue Swirl [Sun, 19 Dec 2010 13:42:56 +0000 (13:42 +0000)]
Sparc: implement monitor command 'info tlb'

Use existing dump_mmu() to implement monitor command 'info tlb'.

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