sdk/emulator/qemu.git
15 years agoPCI: Fix bus address conversion
Blue Swirl [Sun, 27 Dec 2009 20:52:36 +0000 (20:52 +0000)]
PCI: Fix bus address conversion

Pass physical addresses to map functions instead of PCI bus addresses.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc: make command line available also via firmware configuration device
Blue Swirl [Sun, 27 Dec 2009 18:25:49 +0000 (18:25 +0000)]
sparc: make command line available also via firmware configuration device

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agotcg: Add tcg_unsigned_cond.
Richard Henderson [Sun, 27 Dec 2009 09:09:41 +0000 (09:09 +0000)]
tcg: Add tcg_unsigned_cond.

Returns an unsigned version of a signed condition;
returns the original condition otherwise.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoblock/bochs: improve format checking
Blue Swirl [Fri, 25 Dec 2009 19:27:18 +0000 (19:27 +0000)]
block/bochs: improve format checking

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoblock.c: fix warning with _FORTIFY_SOURCE
Kirill A. Shutemov [Fri, 25 Dec 2009 18:19:22 +0000 (18:19 +0000)]
block.c: fix warning with _FORTIFY_SOURCE

  CC    block.o
cc1: warnings being treated as errors
block.c: In function 'bdrv_open2':
block.c:400: error: ignoring return value of 'realpath', declared with attribute warn_unused_result

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoblock/bochs.c: fix warning with _FORTIFY_SOURCE
Kirill A. Shutemov [Fri, 25 Dec 2009 18:19:20 +0000 (18:19 +0000)]
block/bochs.c: fix warning with _FORTIFY_SOURCE

  CC    block/bochs.o
cc1: warnings being treated as errors
block/bochs.c: In function 'seek_to_sector':
block/bochs.c:202: error: ignoring return value of 'read', declared with attribute warn_unused_result
make: *** [block/bochs.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosavevm.c: fix warning with _FORTIFY_SOURCE
Kirill A. Shutemov [Fri, 25 Dec 2009 18:19:19 +0000 (18:19 +0000)]
savevm.c: fix warning with _FORTIFY_SOURCE

  CC    savevm.o
cc1: warnings being treated as errors
savevm.c: In function 'file_put_buffer':
savevm.c:342: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result
make: *** [savevm.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoslirp/misc.c: fix warning with _FORTIFY_SOURCE
Kirill A. Shutemov [Fri, 25 Dec 2009 18:19:18 +0000 (18:19 +0000)]
slirp/misc.c: fix warning with _FORTIFY_SOURCE

  CC    slirp/misc.o
cc1: warnings being treated as errors
slirp/misc.c: In function 'fork_exec':
slirp/misc.c:209: error: ignoring return value of 'write', declared with attribute warn_unused_result
make: *** [slirp/misc.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agohw/pc.c: fix warnings with _FORTIFY_SOURCE
Kirill A. Shutemov [Fri, 25 Dec 2009 18:19:17 +0000 (18:19 +0000)]
hw/pc.c: fix warnings with _FORTIFY_SOURCE

  CC    i386-softmmu/pc.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c: In function 'load_multiboot':
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c:614: error: ignoring return value of 'fread', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c: In function 'load_linux':
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c:888: error: ignoring return value of 'fread', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/hw/pc.c:889: error: ignoring return value of 'fread', declared with attribute warn_unused_result
make[1]: *** [pc.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agopath.c fix warning with _FORTIFY_SOURCE
Kirill A. Shutemov [Fri, 25 Dec 2009 18:19:15 +0000 (18:19 +0000)]
path.c fix warning with _FORTIFY_SOURCE

  CC    libuser/path.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/path.c: In function 'new_entry':
/usr/src/RPM/BUILD/qemu-0.11.92/path.c:49: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
make[1]: *** [path.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoPCI: partially revert 2e01c8cf4b076b05013c87723e3fc710b50a0a7a
Blue Swirl [Fri, 25 Dec 2009 18:18:29 +0000 (18:18 +0000)]
PCI: partially revert 2e01c8cf4b076b05013c87723e3fc710b50a0a7a

Bus address conversion was not correct.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoPCI: make pci_mem_base private
Blue Swirl [Fri, 25 Dec 2009 16:50:36 +0000 (16:50 +0000)]
PCI: make pci_mem_base private

Make pci_mem_base private to PCIBus. Add a function to set it.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix Sparse error: dubious one-bit signed bitfield
Blue Swirl [Fri, 25 Dec 2009 16:12:26 +0000 (16:12 +0000)]
Fix Sparse error: dubious one-bit signed bitfield

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix Sparse warning: dubious: !x & y
Blue Swirl [Fri, 25 Dec 2009 16:12:17 +0000 (16:12 +0000)]
Fix Sparse warning: dubious: !x & y

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoscsi: fix Sparse warning: Initializer entry defined twice
Blue Swirl [Fri, 25 Dec 2009 16:11:40 +0000 (16:11 +0000)]
scsi: fix Sparse warning: Initializer entry defined twice

Both REWIND and REZERO_UNIT use 0x01, READ_POSITION and PRE_FETCH
share 0x34.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoMAC DBDMA: store register values in native endianness
Aurelien Jarno [Thu, 24 Dec 2009 00:00:41 +0000 (01:00 +0100)]
MAC DBDMA: store register values in native endianness

Store the register values in native endianness, by dropping all the
endianness conversion functions, and converting the endianness in
dbdma_readl/dbdma_writel instead.

Also guard the endianness conversion with TARGET_WORDS_BIGENDIAN to
simulate the backward connection of the bus.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoIntel CPUs starting from pentium have apic
Gleb Natapov [Thu, 24 Dec 2009 14:14:33 +0000 (16:14 +0200)]
Intel CPUs starting from pentium have apic

Intel CPUs starting from pentium have apic. Lets advertise it.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoloader: more ignores for rom intended to be loaded by the bios
Aurelien Jarno [Thu, 24 Dec 2009 18:30:25 +0000 (19:30 +0100)]
loader: more ignores for rom intended to be loaded by the bios

Similarly to what has been done in e405a2ba91b68817cae2a428de55fe9616a4cf37,
ignore rom intended to be loaded by the bios in find_rom() and rom_copy().

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoDon't load options roms intended to be loaded by the bios in qemu
Avi Kivity [Tue, 22 Dec 2009 09:57:02 +0000 (11:57 +0200)]
Don't load options roms intended to be loaded by the bios in qemu

The first such option rom will load at address 0, which isn't very nice,
and the second will report a conflict and abort, which is horrible.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix strexd
Aurelien Jarno [Wed, 23 Dec 2009 23:18:23 +0000 (00:18 +0100)]
target-arm: fix strexd

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: fix build with gcc-4.1
Aurelien Jarno [Wed, 23 Dec 2009 23:17:12 +0000 (00:17 +0100)]
linux-user: fix build with gcc-4.1

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinuxboot.bin is a generated file
Juan Quintela [Wed, 23 Dec 2009 18:28:11 +0000 (19:28 +0100)]
linuxboot.bin is a generated file

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoqemu-nbd: fix OpenBSD linker warning
Blue Swirl [Wed, 23 Dec 2009 15:45:30 +0000 (15:45 +0000)]
qemu-nbd: fix OpenBSD linker warning

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoe1000: add link to data sheet
Michael S. Tsirkin [Wed, 23 Dec 2009 15:05:21 +0000 (17:05 +0200)]
e1000: add link to data sheet

Link to data sheet at intel.com so people can find it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoqemu-io: suppress a warning with gcc 4.0.2
Blue Swirl [Wed, 23 Dec 2009 15:35:17 +0000 (15:35 +0000)]
qemu-io: suppress a warning with gcc 4.0.2

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoCompile qemu-nbd also on OpenBSD and Solaris
Blue Swirl [Wed, 23 Dec 2009 15:34:04 +0000 (15:34 +0000)]
Compile qemu-nbd also on OpenBSD and Solaris

basename() needs #include <libgen.h>.

No prototype for daemon() is available on Solaris, but link
succeeds.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoUSB: Improve usbdevice error messages
Scott Tsai [Tue, 22 Dec 2009 20:30:18 +0000 (04:30 +0800)]
USB: Improve usbdevice error messages

When an non-existent USB device is specified on the command line,
print "qemu: could not add USB device 'X'".
Likewise for the usb_{add,del} monitor commands.

Signed-off-by: Scott Tsai <scottt.tw@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-alpha: Initialize fpcr
Richard Henderson [Mon, 21 Dec 2009 21:02:40 +0000 (13:02 -0800)]
target-alpha: Initialize fpcr

Linux, at least, disables exceptions by default.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotcg-sparc: Implement brcond2.
Richard Henderson [Sun, 20 Dec 2009 04:23:19 +0000 (20:23 -0800)]
tcg-sparc: Implement brcond2.

Split out tcg_out_cmp and properly handle immediate arguments.
Fix constraints on brcond to match what SUBCC accepts.
Add tcg_out_brcond2_i32 for 32-bit host.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agotcg-sparc: Use TCG_TARGET_REG_BITS in conditional compilation.
Richard Henderson [Fri, 18 Dec 2009 07:47:54 +0000 (23:47 -0800)]
tcg-sparc: Use TCG_TARGET_REG_BITS in conditional compilation.

The test TCG_TARGET_REG_BITS==64 is exactly the feature that we
are checking for, whereas something involving __sparc_v9__ or
__sparc_v8plus__ should be reserved for something ISA related,
as with SMULX.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agotcg-sparc: Improve tcg_out_movi for sparc64.
Richard Henderson [Sun, 20 Dec 2009 03:45:27 +0000 (19:45 -0800)]
tcg-sparc: Improve tcg_out_movi for sparc64.

Generate sign-extended 32-bit constants with SETHI+XOR.
Otherwise tidy the routine to avoid the need for
conditional compilation and code duplication with movi_imm32.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agotcg-sparc: Fix imm13 check in movi.
Richard Henderson [Thu, 17 Dec 2009 23:20:24 +0000 (15:20 -0800)]
tcg-sparc: Fix imm13 check in movi.

We were unnecessarily restricting imm13 constants to 12 bits.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoARM PBX-A9 memory map tweaks
Paul Brook [Mon, 21 Dec 2009 20:19:12 +0000 (20:19 +0000)]
ARM PBX-A9 memory map tweaks

Add core tile memeory to the RealView PBX-A9 board.  Document the
memeory maps that are known to work with the qemu bootloader.

Signed-off-by: Paul Brook <paul@codesourcery.com>
15 years agoLAN9118 improvements
Paul Brook [Mon, 21 Dec 2009 15:05:57 +0000 (15:05 +0000)]
LAN9118 improvements

Implement LAN9118 general purpose timer and PHY interrupts. Fix global
interrupt status bit.

Signed-off-by: Paul Brook <paul@codesourcery.com>
15 years agoPPC: Make DCR uint32_t
Alexander Graf [Mon, 21 Dec 2009 13:02:39 +0000 (14:02 +0100)]
PPC: Make DCR uint32_t

For what I know DCR is always 32 bits wide, so we should also use uint32_t to
pass it along the stacks.

This fixes a warning when compiling qemu-system-ppc64 with KVM enabled, making
it compile without --disable-werror

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoPPC64: Fix alternate timebase
Aurelien Jarno [Mon, 21 Dec 2009 12:52:08 +0000 (13:52 +0100)]
PPC64: Fix alternate timebase

Fix the alternate time base the same way as the default timebase. SPR_ATBL
should return a 64-bit value on 64 bit implementations.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoPPC64: Fix timebase
Alexander Graf [Mon, 21 Dec 2009 11:24:17 +0000 (12:24 +0100)]
PPC64: Fix timebase

On PPC we have a 64-bit time base. Usually (PPC32) this is accessed using
two separate 32 bit SPR accesses to SPR_TBU and SPR_TBL.

On PPC64 the SPR_TBL register acts as 64 bit though, so we get the full
64 bits as return value. If we only take the lower ones, fine. But Linux
wants to see all 64 bits or it breaks.

This patch makes PPC64 Linux work even after TB crossed the 32-bit boundary,
which usually happened a few seconds after bootup.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-alpha: Emit tcg debug_insn_start.
Richard Henderson [Sat, 19 Dec 2009 23:17:14 +0000 (15:17 -0800)]
target-alpha: Emit tcg debug_insn_start.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: Add aliases for some Alpha syscalls
Richard Henderson [Sat, 19 Dec 2009 23:17:15 +0000 (15:17 -0800)]
linux-user: Add aliases for some Alpha syscalls

Alpha always used 32-bit uids, but never renamed the syscalls
to match i386 when 32-bit uids were added there.  This enables
the proper bits in syscall.c.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoUpdate OpenBIOS PPC image to revision 647
Aurelien Jarno [Mon, 21 Dec 2009 10:10:53 +0000 (11:10 +0100)]
Update OpenBIOS PPC image to revision 647

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoppc64: Change default machine to mac99
Andreas Färber [Sat, 19 Dec 2009 23:22:26 +0000 (00:22 +0100)]
ppc64: Change default machine to mac99

Also change the New World default CPU to 970FX for ppc64,
since the G4 is a 32-bit CPU.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agocpu-all.h: fix cpu_get_real_ticks() #ifdef
Aurelien Jarno [Sun, 20 Dec 2009 20:18:57 +0000 (21:18 +0100)]
cpu-all.h: fix cpu_get_real_ticks() #ifdef

Reported-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoMultiboot support: Fix rom_copy
Kevin Wolf [Sat, 19 Dec 2009 20:15:20 +0000 (21:15 +0100)]
Multiboot support: Fix rom_copy

ROMs need to be loaded if they are anywhere in the requested area, not
only at the very beginning. This fixes Multiboot with ELF kernels that
have more than one program header.

Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: add core dump support for SH
Nathan Froyd [Fri, 11 Dec 2009 17:04:51 +0000 (09:04 -0800)]
linux-user: add core dump support for SH

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: add core dump support for M68K
Nathan Froyd [Fri, 11 Dec 2009 17:04:50 +0000 (09:04 -0800)]
linux-user: add core dump support for M68K

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: add core dump support for MIPS
Nathan Froyd [Fri, 11 Dec 2009 17:04:49 +0000 (09:04 -0800)]
linux-user: add core dump support for MIPS

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: add core dump support for PPC
Nathan Froyd [Fri, 11 Dec 2009 17:04:48 +0000 (09:04 -0800)]
linux-user: add core dump support for PPC

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: fix ARM core dumps on opposite-endian hosts
Nathan Froyd [Fri, 11 Dec 2009 17:04:47 +0000 (09:04 -0800)]
linux-user: fix ARM core dumps on opposite-endian hosts

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: commonify definitions of target typedefs
Nathan Froyd [Fri, 11 Dec 2009 17:04:46 +0000 (09:04 -0800)]
linux-user: commonify definitions of target typedefs

There's no sense in separately declaring target_{elf_greg,uid,gid,pid}_t
for every architecture.  Just declare them once with appropriate
USE_UID16 handling.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: fix ELF_USE_CORE_DUMP/USE_ELF_CORE_DUMP confusion
Nathan Froyd [Fri, 11 Dec 2009 17:04:45 +0000 (09:04 -0800)]
linux-user: fix ELF_USE_CORE_DUMP/USE_ELF_CORE_DUMP confusion

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: use TARGET_ABI_FMT_lx to print abi_ulong types
Aurelien Jarno [Sat, 19 Dec 2009 19:28:23 +0000 (20:28 +0100)]
linux-user: use TARGET_ABI_FMT_lx to print abi_ulong types

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoroms: allow roms to be loaded at address 0
Aurelien Jarno [Sat, 19 Dec 2009 18:14:16 +0000 (19:14 +0100)]
roms: allow roms to be loaded at address 0

It was possible to load roms at address 0, but commit
632cf034b401cdd01dae253a8b577fe518e37654 started to forbid that, which
broke at least ARM versatile.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: cleanup force_sig() calls
Riku Voipio [Fri, 4 Dec 2009 13:16:32 +0000 (15:16 +0200)]
linux-user: cleanup force_sig() calls

Force_sig should be always called with TARGET_ signals.
Not that it really matters with SEGV, so this patch is
just for cleanup and improving consistency.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: Fix mmap_lock ordering
Riku Voipio [Fri, 4 Dec 2009 13:16:31 +0000 (15:16 +0200)]
linux-user: Fix mmap_lock ordering

mmap_lock() can be called while tb_lock() is being held. To
avoid deadlock when one thread is holding mmap_lock and another
tb_lock, _always_ lock first tb_lock().

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agolinux-user: enable tb unlinking when compiled with NPTL
Riku Voipio [Fri, 4 Dec 2009 13:16:30 +0000 (15:16 +0200)]
linux-user: enable tb unlinking when compiled with NPTL

Fixes receiving signals when guest code is being executed in a tight
loop. For an example, try interrupting the following code with ctrl-c.

http://nchipin.kos.to/test-loop.c

The tight loop is ofcourse brainless, but it is also exactly how the waitpid* testcases
are implemented.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agouser: fix compilation without -fpie
Blue Swirl [Sat, 19 Dec 2009 15:42:34 +0000 (15:42 +0000)]
user: fix compilation without -fpie

Fixes breakage by 299060a06e7c73de5cb9962edbca7f7f9e0b7f25.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agouser_only: compile everything with -fpie
Kirill A. Shutemov [Sat, 19 Dec 2009 15:16:08 +0000 (15:16 +0000)]
user_only: compile everything with -fpie

We really need compile _all_ sources for user target with -fpie when
use --enable-user-pie.

It's regression introduced by commit add16157d72454.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agohw/openpic.c: replace tabs by spaces
Aurelien Jarno [Sat, 19 Dec 2009 14:59:29 +0000 (15:59 +0100)]
hw/openpic.c: replace tabs by spaces

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-ppc: Use interrupts for escc
Alexander Graf [Fri, 18 Dec 2009 22:37:27 +0000 (23:37 +0100)]
target-ppc: Use interrupts for escc

When using the escc with Linux, we need interrupts. So instead of creating
a dummy device, let's just map them to the openpic we have anyways.

This makes Linux on PPC64 with console=ttyPZ0 work.

Obviously, this change needs to be reflected in openbios. Patch for that
follows this one. Please update the binary then.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-ppc: Initialize OpenPIC properly
Alexander Graf [Fri, 18 Dec 2009 22:37:26 +0000 (23:37 +0100)]
target-ppc: Initialize OpenPIC properly

When lowering an IRQ line, we search for the line we're supposed to lower.

Usually we run into an optimization there that queues up interrupts. This
queue ends with -1. Unfortunately we didn't set the first item to -1.

This patch fixes this, making interrupts work on PPC64.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoUpdate version and changelog to sync with stable branch
Anthony Liguori [Sat, 19 Dec 2009 14:24:34 +0000 (08:24 -0600)]
Update version and changelog to sync with stable branch

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoUpdate to SeaBIOS 0.5.0
Anthony Liguori [Sat, 19 Dec 2009 03:26:15 +0000 (21:26 -0600)]
Update to SeaBIOS 0.5.0

The only change is updating the makefile but that way we're carrying an official
release.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoRevert "monitor: Convert do_migrate_set_speed() to QObject"
Anthony Liguori [Fri, 18 Dec 2009 20:51:49 +0000 (14:51 -0600)]
Revert "monitor: Convert do_migrate_set_speed() to QObject"

This reverts commit 3a4921047d514c336531c304bec362c4d138ebcc.

From Luiz:

  do_migrate_set_speed() accepts a suffix for the 'value' argument and this is
  not good for QMP.  We will have to add a new argument type to handle that and
  this will have to wait for 0.13.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoe1000: Don't muck with PCI commmand register
Anthony Liguori [Fri, 18 Dec 2009 19:58:56 +0000 (13:58 -0600)]
e1000: Don't muck with PCI commmand register

Otherwise, the driver does not work in Linux after the INT_DISABLE changes in
PCI.

Michael Tsirkin had a patch to do this, I'm not sure what happened to it.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: do_balloon(): Use 'M' argument type
Luiz Capitulino [Fri, 18 Dec 2009 15:25:05 +0000 (13:25 -0200)]
monitor: do_balloon(): Use 'M' argument type

This makes do_balloon() accept megabyte values from the user
Monitor while accepting byte values for QMP.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Introduce 'M' argument type
Luiz Capitulino [Fri, 18 Dec 2009 15:25:04 +0000 (13:25 -0200)]
monitor: Introduce 'M' argument type

This is a target long value in megabytes which should be
converted to bytes.

It will be used by handlers which accept a megabyte value
when in "user mode".

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoQMP: Update spec file
Luiz Capitulino [Fri, 18 Dec 2009 15:25:03 +0000 (13:25 -0200)]
QMP: Update spec file

- Remove "draft" status
- Change default success response to be json-object
- Change error and event data member to be a json-object
- Update examples
- Add new section "Compatibility Considerations"
- Other fixes and clarifications

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoQMP: Update README file
Luiz Capitulino [Fri, 18 Dec 2009 15:25:02 +0000 (13:25 -0200)]
QMP: Update README file

- Fix output description
- Fix command-line usage notes
- Minor improvements

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoQMP: Assure that returned data is a QDict
Luiz Capitulino [Fri, 18 Dec 2009 15:25:01 +0000 (13:25 -0200)]
QMP: Assure that returned data is a QDict

This is for debug purposes only.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoQMP: Return an empty dict by default
Luiz Capitulino [Fri, 18 Dec 2009 15:25:00 +0000 (13:25 -0200)]
QMP: Return an empty dict by default

Currently, when a regular command doesn't have any data to output,
QMP will emit:

{ "return": "OK" }

Returning an empty dict is better though, because dicts can support
some protocol changes in a compatible way.

So, with this commit we will return:

{ "return": {} }

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoQMP: Only handle converted commands
Luiz Capitulino [Fri, 18 Dec 2009 15:24:59 +0000 (13:24 -0200)]
QMP: Only handle converted commands

Looks like I dropped this check when addressing the 'query-'
commands request.

QMP should only handle converted commands, obviously.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agotarget-ppc: fix ppc32 kvm build
Alexander Graf [Sat, 19 Dec 2009 00:58:59 +0000 (01:58 +0100)]
target-ppc: fix ppc32 kvm build

My segment sync patch broke compilation on PPC32, because it was trying to
sync the SLB even though ppc32 CPUs don't have an SLB.

So let's only sync it when we're on a PP64 one!

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agousb-musb: convert fifo to 8bit and add more registers
Riku Voipio [Thu, 3 Dec 2009 13:56:08 +0000 (15:56 +0200)]
usb-musb: convert fifo to 8bit and add more registers

Convert musb fifo to 8bit to allow 8/16/32bit access

MUSB allows reading and writing to the fifo in 32/16/8 bit
width. The Linux kernel does this sometimes, most usually at
the end of writing the packet to allow packet to end at a
odd bytecount.

Convert the fifo to 8bit allows removing lots of shifts
which shows that the fifo is more natural as 8bit.

While at it, add multiple missing register definitions and
and cleanup debug prints.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agohandle SD CMD5 without error messages
Juha Riihimäki [Thu, 3 Dec 2009 13:56:07 +0000 (15:56 +0200)]
handle SD CMD5 without error messages

From: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoMake USB hid devices self-powered
Riku Voipio [Thu, 3 Dec 2009 13:56:06 +0000 (15:56 +0200)]
Make USB hid devices self-powered

Simplifies power budget negotiation.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoGive a error when running out of iomem areas.
Riku Voipio [Thu, 3 Dec 2009 13:56:05 +0000 (15:56 +0200)]
Give a error when running out of iomem areas.

The limit of iomem areas is quite low. Without the
debug print, it is quite hard to figure out why more
devices are not getting registered.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agofix networking on win32 host
Juha Riihimäki [Thu, 3 Dec 2009 13:56:04 +0000 (15:56 +0200)]
fix networking on win32 host

At least under some mingw compilers slirp networking fails without declaring
these fields packed.

From: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agofix pidfile option to work in WIN32
Juha Riihimäki [Thu, 3 Dec 2009 13:56:03 +0000 (15:56 +0200)]
fix pidfile option to work in WIN32

Explicit read/write locking pidfile under WIN32 is bit extreme
nobody get the chance to read the pidfile. Convert to a write-only lock.

Also, creating pidfile was disabled along with daemonize under
WIN32. Enable it, but do not enable daemon support which doesn't
exist under WIN32 atm.

From: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoFix win32 log file location
Juha Riihimäki [Thu, 3 Dec 2009 13:56:02 +0000 (15:56 +0200)]
Fix win32 log file location

/tmp doesn't exist under win32. Ease the pain of win32 development slightly.

From: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoUpdate SeaBIOS to include PCI based option rom loading
Anthony Liguori [Fri, 18 Dec 2009 15:42:56 +0000 (09:42 -0600)]
Update SeaBIOS to include PCI based option rom loading

Also remove pcbios from the tree.  It will no longer work.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoroms: remove option rom packing logic
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:12 +0000 (12:01 +0100)]
roms: remove option rom packing logic

Now that we load the option roms via fw_cfg, we can stop copying
them to the 0xc000 -> 0xe000.  The patch does just that.

Also the rom loader gets simplified as all remaining users of the
rom loader load the bits at a fixed address so the packing and
aligning logic can go away.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoroms: use new fw_cfg file xfer support.
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:11 +0000 (12:01 +0100)]
roms: use new fw_cfg file xfer support.

roms: use fw_cfg for vgabios and option rom loading, additionally to
deploying them the traditional way (copy to 0xc0000 -> 0xe0000 range).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agofw_cfg: add API for file transfer.
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:10 +0000 (12:01 +0100)]
fw_cfg: add API for file transfer.

This patch adds a file transfer interface to fw_cfg.  Intended to be
used for passing non-pci option roms and vgabios to seabios.  Namespace
is modeled after the existing cbfs filesystem support in seabios.

Reading the new FW_CFG_FILE_DIR entry returns a file list.
Fields there are in network byte order (aka bigendian).

aliguori: fix fw_cfg.h for multiboot.bin, add proper fw_cfg.h declarations,
          quiet fprintf() in fw_cfg.c

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agofw_cfg: make calls typesafe
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:09 +0000 (12:01 +0100)]
fw_cfg: make calls typesafe

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agopci romfiles: add property, add default to PCIDeviceInfo
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:08 +0000 (12:01 +0100)]
pci romfiles: add property, add default to PCIDeviceInfo

This patch adds a romfile property to the pci bus.  It allows to specify
a romfile to load into the rom bar of the pci device.  The default value
comes from a new field in PCIDeviceInfo.  The property allows to change
the file and also to disable the rom loading using an empty string.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoSupport PCI based option rom loading
Anthony Liguori [Fri, 18 Dec 2009 11:01:07 +0000 (12:01 +0100)]
Support PCI based option rom loading

Currently, we preload option roms into the option rom space in memory.  This
prevents DDIM from functioning correctly which severely limits the number
of roms we can support.

This patch introduces a pci_add_option_rom() which registers the
PCI_ROM_ADDRESS bar which points to our option rom.  It also converts over
the cirrus vga adapter, the rtl8139, virtio, and the e1000 to use this
new mechanism.

The result is that PXE boot functions even with three unique types of cards.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoFix backcompat for hotplug of SCSI controllers
Daniel P. Berrange [Mon, 7 Dec 2009 20:51:49 +0000 (20:51 +0000)]
Fix backcompat for hotplug of SCSI controllers

SCSI controllers have no trouble existing without any attached
disks. This could be achieved with the (legacy) monitor syntax

  pci_add pci_addr=auto storage if=scsi

This is now denied with

  scsi requires a backing file/device.
  failed to add if=scsi

There is no need for this denial and it breaks compatability
with existing QEMU usage, so remove the check for presence
of a drive.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agofdc: fix migration from 0.11
Juan Quintela [Tue, 15 Dec 2009 13:34:35 +0000 (14:34 +0100)]
fdc: fix migration from 0.11

0.11 uses as instance ide io_base, get it back

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoRevert "fdc: fix vmstate variable passed"
Juan Quintela [Tue, 15 Dec 2009 13:34:34 +0000 (14:34 +0100)]
Revert "fdc: fix vmstate variable passed"

Floppy used the io_base address to register savevm region.

This reverts commit 2966b390d0f7cd5e5b971290fcc20685de374228.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Accept input only byte-wise
Jan Kiszka [Fri, 4 Dec 2009 13:05:29 +0000 (14:05 +0100)]
monitor: Accept input only byte-wise

This allows to suspend command interpretation and execution
synchronously, e.g. during migration.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoRevert "kvm: x86: Save/restore exception_index"
Anthony Liguori [Fri, 18 Dec 2009 14:16:30 +0000 (08:16 -0600)]
Revert "kvm: x86: Save/restore exception_index"

This reverts commit ebbc8a3d8e76d0402f8a08c10c0f32e24715d41d.

As suggested by Jan Kiszka,

  "It was obsoleted by d1793b836f8f123b961c613de1bb1c0c185c84cc and now
   saves/restores a useless field."

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmware: increase cursor buffer size.
Dave Airlie [Thu, 17 Dec 2009 22:08:11 +0000 (08:08 +1000)]
vmware: increase cursor buffer size.

The cursor pixmap size we calculate later ends up being 4096 dwords
long by the looks of it. This boots an F12 LiveCD now.

Signed-off-by: Dave Airlie <airlied@linux.ie>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoVMware VGA: Only enable dirty log tracking when fifo is disabled
Anthony Liguori [Thu, 17 Dec 2009 22:08:10 +0000 (08:08 +1000)]
VMware VGA: Only enable dirty log tracking when fifo is disabled

This patch enables dirty log tracking whenever it's needed and disables it
when it is not.

We unconditionally enable dirty log tracking on reset, restart dirty log
tracking when PCI IO regions are remapped, and disable/enable it based on
commands from the guest.

Rebased-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoFix VMware VGA depth computation
Anthony Liguori [Thu, 17 Dec 2009 22:08:09 +0000 (08:08 +1000)]
Fix VMware VGA depth computation

VMware VGA requires that the depth presented to the guest is the same as the
DisplaySurface that it renders to.  This is because it performs a very simple
memcpy() to blit from one surface to another.

We currently hardcode a 24-bit depth.  The surface allocator for SDL may, and
usually will, allocate a surface with a different depth causing screen
corruption.

This changes the code to allocate the DisplaySurface before initializing the
device which allows the depth of the DisplaySurface to be used instead of
hardcoding something.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoMake sure to enable dirty log tracking for VMware VGA
Anthony Liguori [Thu, 17 Dec 2009 22:08:08 +0000 (08:08 +1000)]
Make sure to enable dirty log tracking for VMware VGA

This is needed for VMware VGA to work properly under KVM.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoMake sure to enable dirty tracking of VBE vram mapping
Anthony Liguori [Thu, 17 Dec 2009 22:08:07 +0000 (08:08 +1000)]
Make sure to enable dirty tracking of VBE vram mapping

Apparently, VBE maps the VGA vram to a fixed physical location.  KVM requires
that all mappings of the VGA vram have dirty tracking enabled on them.  Any
access to the VGA vram through the VBE mapping currently fails to result in
dirty page tracking updates causing a black screen.

This is the true root cause of VMware VGA not working correctly under KVM and
likely also an issue with some of the std-vga black screen issues too.

Cirrus does not enable VBE so it would not be a problem when using Cirrus.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Rebased-by: Dave Airlie <airlied@redhat.com>
15 years agovmware: setup PCI BAR 2 for FIFO as per vmware spec
Dave Airlie [Thu, 17 Dec 2009 22:08:06 +0000 (08:08 +1000)]
vmware: setup PCI BAR 2 for FIFO as per vmware spec

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoqdev: improve property error reporting.
Gerd Hoffmann [Wed, 16 Dec 2009 13:22:11 +0000 (14:22 +0100)]
qdev: improve property error reporting.

Add a error message in case we fail to parse a qdev property.

Also make qemu not abort() in case setting a global property can't be
set.  This used to be a clear programming error.  The introduction of
the -global switch changed that though, so better exit instead (after
printing the new error message).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agofix vga names in default_list
Gerd Hoffmann [Wed, 16 Dec 2009 12:35:19 +0000 (13:35 +0100)]
fix vga names in default_list

Fix mismerge between 64465297 and 556cd098.

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agousb-host: check mon before using it.
Gerd Hoffmann [Tue, 15 Dec 2009 10:43:02 +0000 (11:43 +0100)]
usb-host: check mon before using it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>