sdk/emulator/qemu.git
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 years agousb-net: use qdev for -usbdevice
Gerd Hoffmann [Tue, 15 Dec 2009 09:20:57 +0000 (10:20 +0100)]
usb-net: use qdev for -usbdevice

Rebased to master, adapted to device renaming by armbru,
no other changes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoCheck rom_load_all() return value.
Gerd Hoffmann [Mon, 14 Dec 2009 15:07:35 +0000 (16:07 +0100)]
Check rom_load_all() return value.

Check rom_load_all() return value.
Also don't make option rom loading failure fatal.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agodefaults: update device_list[]
Gerd Hoffmann [Wed, 16 Dec 2009 13:25:40 +0000 (14:25 +0100)]
defaults: update device_list[]

Add isa-fdc (disables default_floppy).
Add ide-drive (disables default_cdrom).

Also walk the -global QemuOpts, so we'll catch
-global isa-fdc.drive{A,B}=<name> too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agodefaults: split default_drive
Gerd Hoffmann [Wed, 16 Dec 2009 13:25:39 +0000 (14:25 +0100)]
defaults: split default_drive

Split default_drive into default_{floppy,cdrom,sdcard}.
Also add QEMUMachine flags to disable them per machine.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: Catch printing to non-existent monitor
Luiz Capitulino [Mon, 14 Dec 2009 20:53:24 +0000 (18:53 -0200)]
monitor: Catch printing to non-existent monitor

The monitor_vprintf() function now touches the 'mon' pointer
before calling monitor_puts(), this causes block migration
to segfault as its functions call monitor_printf() with a
NULL 'mon'.

To fix the problem this commit moves the 'mon' NULL check
from monitor_puts() to monitor_vprintf().

This can potentially hide bugs, but for some reason this has
been the behavior for a long time.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: Avoid readline functions in QMP
Luiz Capitulino [Mon, 14 Dec 2009 20:53:23 +0000 (18:53 -0200)]
monitor: Avoid readline functions in QMP

The monitor_read_command() function is readline specific
and should only be used when readline is available.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: do_balloon(): Check for errors
Luiz Capitulino [Mon, 14 Dec 2009 20:53:22 +0000 (18:53 -0200)]
monitor: do_balloon(): Check for errors

do_balloon() should check for ballooning availability as
do_info_balloon() does.

Noted by Daniel P. Berrange <berrange@redhat.com>.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: Use 'device' in eject
Luiz Capitulino [Mon, 14 Dec 2009 20:53:21 +0000 (18:53 -0200)]
monitor: Use 'device' in eject

Monitor's eject command uses 'filename' for the device name
argument, but 'device' is a better name.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQDict: Fix size update
Luiz Capitulino [Mon, 14 Dec 2009 20:53:20 +0000 (18:53 -0200)]
QDict: Fix size update

Key replacement should not update the dictionary's size.

This commit also adds a test for the bug.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: Improve uni-north device names
Markus Armbruster [Mon, 14 Dec 2009 09:41:21 +0000 (10:41 +0100)]
qdev: Improve uni-north device names

Switch to the names suggested by Blue Swirl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAvoid permanently disabled QEMU monitor when UNIX migration fails
Daniel P. Berrange [Fri, 11 Dec 2009 21:01:14 +0000 (21:01 +0000)]
Avoid permanently disabled QEMU monitor when UNIX migration fails

If a UNIX migration command is attempt to a UNIX socket which does
not exist, then the monitor is suspended, but never resumed. This
prevents any further use of the monitor

* migration-unix.c: Only call migrate_fd_monitor_suspend() once
  connected to the UNIX socket.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix loading of ELF multiboot kernels
Kevin Wolf [Fri, 4 Dec 2009 16:19:25 +0000 (17:19 +0100)]
Fix loading of ELF multiboot kernels

The multiboot implementation assumed that there is only one program header
(which contains the entry point) and that the entry point is at the start of
the code. This doesn't hold true generally and caused too little data to be
loaded.

Fix the loading code to pass the whole loaded data to the Multiboot Option ROM.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRevert "Rename DriveInfo.onerror to on_write_error" (fix mismerge)
Kevin Wolf [Fri, 4 Dec 2009 11:06:32 +0000 (12:06 +0100)]
Revert "Rename DriveInfo.onerror to on_write_error" (fix mismerge)

Part of the first patch of the -drive rerror series has been merged once more
on top of the rest of the series. This effectively disables the rerror option
and always goes with the default value. Reverting the commit re-enables the
option.

This reverts commit fc072ec4df0996682dfbff6c735e2bbc0d93132f.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqemu-io: Fix memory leak
Kevin Wolf [Wed, 18 Nov 2009 09:42:59 +0000 (10:42 +0100)]
qemu-io: Fix memory leak

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix thinko in linuxboot.S
Paolo Bonzini [Sun, 13 Dec 2009 10:36:40 +0000 (11:36 +0100)]
Fix thinko in linuxboot.S

The %gs segment that was used was not matching the comments.
I just moved the GDT descriptor on the stack instead.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agotarget-i386: Fix evaluation of DR7 register
Jan Kiszka [Mon, 14 Dec 2009 11:26:27 +0000 (12:26 +0100)]
target-i386: Fix evaluation of DR7 register

hw_breakpoint_type and hw_breakpoint_len used the wrong index multiplier
to extract type and len.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agokvm: x86: Use separate exception_injected CPUState field
Jan Kiszka [Mon, 14 Dec 2009 11:26:17 +0000 (12:26 +0100)]
kvm: x86: Use separate exception_injected CPUState field

Marcelo correctly remarked that there are usage conflicts between QEMU
core code and KVM /wrt exception_index. So spend a separate field and
also save/restore it properly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovnc: hextile: do not generate ForegroundSpecified and SubrectsColoured tiles
Anthony Liguori [Mon, 14 Dec 2009 20:11:56 +0000 (14:11 -0600)]
vnc: hextile: do not generate ForegroundSpecified and SubrectsColoured tiles

This violates the RFB specification (section 6.6.4).  It happens to work with
most clients but it's still wrong.

Reported-by: Yaniv Kaul <ykaul@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRevert "pci: interrupt disable bit support"
Anthony Liguori [Mon, 14 Dec 2009 17:36:53 +0000 (11:36 -0600)]
Revert "pci: interrupt disable bit support"

This reverts commit 0ea5709a32085f7d14901a09d12bd35f9b267607.

Per discussion with Michael Tsirkin, this is too risky for 0.12

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoS390: Bail out without KVM
Alexander Graf [Fri, 18 Dec 2009 15:29:04 +0000 (16:29 +0100)]
S390: Bail out without KVM

Currently only the S390 KVM target works. To keep users from accidently not
using KVM, let's not even initialize the machine when KVM is not used.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>