]> git.proxmox.com Git - qemu.git/log
qemu.git
14 years agoUpdate version and changelog for release v0.12.2
Anthony Liguori [Wed, 13 Jan 2010 23:49:55 +0000 (17:49 -0600)]
Update version and changelog for release

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoUpdate SeaBIOS to 0.5.1
Anthony Liguori [Wed, 13 Jan 2010 23:58:50 +0000 (17:58 -0600)]
Update SeaBIOS to 0.5.1

 - 5da6833 Update version to 0.5.1
 - 669c991 Fix sign error preventing incorrect memory over 4gig calculation.
 - 7e6bd3e Minor - better indent assembler in int1587.
 - 48cf232 Add comment explaining why mptable is in low memory.
 - 643062f Add int1589 support.
 - 085debd Set FDPT in irq table even for small drives.
 - 7c1b186 Reduce #ifs by weeding out some cross-chunk function definitions.
 - f9b25d3 Fix vgahook sign issue; add warning to build to catch future cases.
 - 3862b2d vgabios: Fix compile error due to fixed prototypes.
 - 1ca05b0 Be sure to add "void" to all function prototypes that take no args.
 - b5bb9db mptable: Reset pinmask on new bus or device.
 - 8918989 Detect latest FC12 gcc -combine breakage.
 - c9d3c2d Minor vga binary cleanups.
 - 9a8609f Make MTRR region 0xc0000-0x100000 be cached.
 - fdca418 Force a link error if a function is used from the wrong code chunk.
 - dad41d9 Add __noreturn define for __attribute__((noreturn)).
 - c003148 Implement native 32bit APM support.
 - 5c99b6c Commit compiled dsdt file; misc comment updates.
 - 29f4b91 prevent acpi from rerouting SCI interrupt
 - 4c94b7e enumerate all PCI buses in mptable
 - 871e0a0 Add support for 32bit PCI BIOS entry.
 - eda2c83 Only add "addr32" to memory accesses that require them.
 - 52a300f Introduce MODESEGMENT define; rename VISIBLE32 to VISIBLE32FLAT.
 - fe2c3ee Allocate smbios in temp space and copy into final location.
 - b164d2c Clear user reserved interrupts (0x60-0x66).
 - d9104ff Remove pci_bios_bigmem_addr; set pci_bios_mem_addr=0xe0000000
 - 14021f2 Add initial support for ATA DMA.
 - 8362699 Allocate mptable in temp space and copy into final location.
 - 979862e Also report memory over 4G during init.
 - 928d4df provide correct pci routing information in mptable
 - afc02da Add symbolic definitions for MTRR code.
 - fb214dc Fix yield() so it works from boot code.
 - 2ceeec9 Fix potential build failure due to text16 section being too large.
 - a2195e4 Increase version in preparation for next release.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQemu's internal TFTP server breaks lock-step-iness of TFTP
Milan Plzik [Thu, 7 Jan 2010 12:39:43 +0000 (13:39 +0100)]
Qemu's internal TFTP server breaks lock-step-iness of TFTP

According to RFC 1350 and RFC 2347, TFTP server should answer RRQ by
either OACK or DATA packet. Qemu's internal TFTP server answers RRQ with
additional options by sending both OACK and DATA packet, thus breaking
the "lock-step" feature of the protocol, and also confuses client.

  Proposed solution would be to, in case of OACK packet, wait for ACK
from client and just then start sending data. Attached patch implements
this.

Signed-off-by: Thomas Horsten <thomas@horsten.com>
Signed-off-by: Milan Plzik <milan.plzik@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 1cb1a66aed921060fa34d161b52e95d05de18ec1)

14 years agoosdep.c: Fix accept4 fallback
Kevin Wolf [Wed, 13 Jan 2010 15:20:56 +0000 (16:20 +0100)]
osdep.c: Fix accept4 fallback

Commit 3a03bfa5 added a fallback in case the Linux kernel running qemu is older
than the kernel of the build system. Unfortunately, v1 was committed instead of
v2, so the code has a bug that was revealed in the review (checking for the
wrong error code).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 347ed55cd109864b02dd29bb7e6cda1622e8019e)

14 years agopc: add rombar to compat properties for pc-0.10 and pc-0.11
Gerd Hoffmann [Fri, 8 Jan 2010 14:25:42 +0000 (15:25 +0100)]
pc: add rombar to compat properties for pc-0.10 and pc-0.11

So '-M pc-0.10' and '-M pc-0.11' will use the fw_cfg rom load method
by default.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 20a86364c9e421c4f9ce457251fa8df031cd5078)

14 years agopci: allow loading roms via fw_cfg.
Gerd Hoffmann [Fri, 8 Jan 2010 14:25:41 +0000 (15:25 +0100)]
pci: allow loading roms via fw_cfg.

This patch adds a pci bus property 'rombar' which specifies whenever
the pci rom should be loaded via pci rom bar (default) or via fw_cfg.
The later can be used for compatibility with older qemu versions where
no pci rom bar is present.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 88169ddf82853ca892ce7bee279579c8a0ac03e5)

14 years agoroms: rework rom loading via fw
Gerd Hoffmann [Fri, 8 Jan 2010 14:25:40 +0000 (15:25 +0100)]
roms: rework rom loading via fw

This patch changes the way rom loading via fw_cfg is handled.
Instead of having pc_init1() call a function which passed all
roms to the firmware config we simply pass a pointer to fw_cfg
to the rom loader.

Advantage: loading roms via firmware works also for devices which
are initialized after pc_init1(), i.e. everyting added via -device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 8832cb805dcb65009b979cd8e17d75ac4b03c7e4)

14 years agofw_cfg: rom loader tweaks.
Gerd Hoffmann [Fri, 8 Jan 2010 14:25:39 +0000 (15:25 +0100)]
fw_cfg: rom loader tweaks.

Changes:
 - make dir argument mandatory, we allways have one anyway
   (vgaroms or genroms).
 - check for duplicates, skip loading if found.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit de9352bcaed2452af1d2b06b829748676c691794)

14 years agoroms: minor fixes and cleanups.
Gerd Hoffmann [Fri, 8 Jan 2010 14:25:38 +0000 (15:25 +0100)]
roms: minor fixes and cleanups.

Changes:
  - Drop extra file argument from rom_add_file().
  - Drop fw_dir check in do_info_roms, we allways have a dir name.
  - code style fixes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit bdb5ee3064d5ae786b0bcb6cf6ff4e3554a72990)

14 years agopc: add machine type for 0.12
Gerd Hoffmann [Fri, 8 Jan 2010 14:25:37 +0000 (15:25 +0100)]
pc: add machine type for 0.12

Add a new machine type for qemu 0.12.

Also fixup the 0.11 machine type: msi for virtio-blk-pci was enabled
after the 0.11 release, so turn it off in the 0.11 machine type.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 2cae6f5e34d85fe44ec2329a7fbc22dc8cfb079f)

14 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>
(cherry picked from commit f21a59c224a6fdf7b30c3fe551fd93043e537f6c)

14 years agovnc_refresh: return if vd->timer is NULL
Stefano Stabellini [Mon, 11 Jan 2010 17:30:50 +0000 (17:30 +0000)]
vnc_refresh: return if vd->timer is NULL

Hi all,
calling vnc_update_client in vnc_refresh might have the unlikely side
effect of setting vd->timer = NULL, if the last vnc client disconnected.
In this case we have to return from vnc_refresh without updating the
timer, otherwise we cause a segfault.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 83755c173f4608764e3ee92428247d1c5e962e6a)

14 years agoQMP: Don't free async event's 'data'
Luiz Capitulino [Fri, 8 Jan 2010 18:45:53 +0000 (16:45 -0200)]
QMP: Don't free async event's 'data'

The monitor_protocol_event() function will free the
event's data, this is wrong as 'data' management is up
to the caller.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 3d72f9a2be640f368229d579e80ce4ef2a823e49)

14 years agoHandle TFTP ERROR from client
Thomas Horsten [Thu, 7 Jan 2010 17:01:28 +0000 (17:01 +0000)]
Handle TFTP ERROR from client

If a PXE client only wants to find out the size of a file, it will
open the file and then abort the transfer by sending a TFTP ERROR packet.

The ERROR packet should cause qemu to terminate the session. If not,
the sessions will soon run out and cause timeouts in the client.

Also, if a TFTP session already exists with same IP/UDP port, it
should be terminated when a new RRQ is received, instead of creating a
duplicate (which will never be used).

A patch for gPXE to send the ERROR packet is also being submitted to
gPXE. Together they resolve slowness/hanging when booting pxegrub from
qemu's internal TFTP server. The patch from Milan Plzik to return
after sending OACK is also required for a complete fix.

Signed-off-by: Thomas Horsten <thomas@horsten.com>
Signed-off-by: Milan Plzik <milan.plzik@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit bfe4e172421d711d1d5b049f90be0961451c8259)

14 years agodmg: fix ->open failure
Christoph Hellwig [Mon, 11 Jan 2010 13:06:54 +0000 (14:06 +0100)]
dmg: fix ->open failure

Currently the dmg image format driver simply opens the images as raw
if any kind of failure happens.  This is contrarty to the behaviour
of all other image formats which just return an error and let the
block core deal with it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 1559ca00bc90ce6917c2798ed81098e4be67f58e)

14 years agovirtio-pci: thinko fix
Michael S. Tsirkin [Mon, 11 Jan 2010 15:57:41 +0000 (17:57 +0200)]
virtio-pci: thinko fix

Since patch ed757e140c0ada220f213036e4497315d24ca8bct, virtio will
sometimes clear all status registers on bus master disable, which loses
information such as VIRTIO_CONFIG_S_FAILED bit.  This is a result of
a patch being misapplied: code uses !  instead of ~ for bit
operations as in Yan's original patch.  This obviously does not make
sense.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 49e75cf38848e6da70c0e9ddb4d994e9d71a9625)

14 years agopc-bios: Update README (SeaBIOS)
Stefan Weil [Thu, 7 Jan 2010 18:27:49 +0000 (19:27 +0100)]
pc-bios: Update README (SeaBIOS)

The PC BIOS no longer comes from Bochs.
This patch updates the related entry.

V2 - Modify SeaBIOS description and URL
     (Thanks to Gleb Natapov for the hint).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit c0ced0f3a76c9f3ad680141f751dd1a20c91bbbf)

14 years agovmware_vga: Check cursor dimensions passed from guest to avoid buffer overflow
Roland Dreier [Wed, 6 Jan 2010 04:43:34 +0000 (20:43 -0800)]
vmware_vga: Check cursor dimensions passed from guest to avoid buffer overflow

Check that the cursor dimensions passed from the guest for the
DEFINE_CURSOR command don't overflow the available space in the
cursor.image[] or cursor.mask[] arrays before copying data from the
guest into those arrays.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit f2d928d44ebc918750c94f3605c1417f1f653ec9)

14 years agoremove pending exception on vcpu reset.
Gleb Natapov [Wed, 6 Jan 2010 14:30:10 +0000 (16:30 +0200)]
remove pending exception on vcpu reset.

Without this qemu can even start on kvm modules with events support
since default value of exception_injected in zero and this is #DE
exception.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit e73223a5849d9e695b5f3b5a4a2a812e68e3735d)

14 years agoFix CPU topology initialization
Jiri Denemark [Tue, 5 Jan 2010 16:26:34 +0000 (17:26 +0100)]
Fix CPU topology initialization

Late initialization of CPU topology in CPUState prevents KVM guests to
actually see the topology.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 3f7638ec4093100a63b18cbacd45dcd847f7c06b)

14 years agoMCE: Fix bug of IA32_MCG_STATUS after system reset
Huang Ying [Tue, 5 Jan 2010 08:32:24 +0000 (16:32 +0800)]
MCE: Fix bug of IA32_MCG_STATUS after system reset

Now, if we inject a fatal MCE into guest OS, for example Linux, Linux
will go panic and then reboot. But if we inject another MCE now,
system will reset directly instead of go panic firstly, because
MCG_STATUS.MCIP is set to 1 and not cleared after reboot. This is does
not follow the behavior in real hardware.

This patch fixes this via set env->mcg_status to 0 during system reset.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit af364b418cc57c53275c76ee5e0e0645908605b9)

14 years agolinuxboot: fix gdt address calculation
Avi Kivity [Thu, 24 Dec 2009 13:38:50 +0000 (15:38 +0200)]
linuxboot: fix gdt address calculation

The gdt address calculation in linuxboot.bin is broken in two ways: first
it loads %cs into %eax, but that instruction leaves the high bits of %eax
undefined and we did not clear them.  Secondly, we completely ignore the
incorrect %eax, and use the undefined %ebx instead.

With these issues fixed, linuxboot works again.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit d0652aa8ac8d82e077acf8e781557f4c4367dcf5)

14 years agoQMP: Drop wrong assert()
Luiz Capitulino [Tue, 22 Dec 2009 03:09:06 +0000 (01:09 -0200)]
QMP: Drop wrong assert()

Some commands return a QList of QDicts, which is valid,
but will trig the assert().

Just drop it.

Reported-by: Nathan Baum <nathan@parenthephobia.org.uk>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 810f49b56a5d0cd6848856af51d3093ae9adc7b1)

14 years agovnc: Fix artifacts in hextile decoding
Anthony Liguori [Thu, 7 Jan 2010 13:55:34 +0000 (07:55 -0600)]
vnc: Fix artifacts in hextile decoding

02c2b87 introduced a regression whereas the foreground color in a hextile
update was not being properly invalidated leading to artifacts.

It's still necessary to explicitly invalidate the foreground color with a
SubrectColoured tile even though we no longer send a foreground color as
part of the tile.

Reported-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 18cb1d85578e03b16570d9380309cca673f9fff8)

14 years agoMerge remote branch 'mst/stable-0.12' into stable-0.12
Anthony Liguori [Wed, 6 Jan 2010 15:17:53 +0000 (09:17 -0600)]
Merge remote branch 'mst/stable-0.12' into stable-0.12

14 years agotarget-i386: Fix "call im" on x86_64 when executing 32-bit code
Aurelien Jarno [Sun, 3 Jan 2010 02:08:19 +0000 (03:08 +0100)]
target-i386: Fix "call im" on x86_64 when executing 32-bit code

Similarly to what is done in 32938e127f50a40844a0fb9c5abb8691aeeccf7e
for "jmp im", trunc the immediate to 32-bit when not running in 64-bit
mode.

Reported-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoAdd missing newline at the end of options list
Michael Tokarev [Thu, 24 Dec 2009 09:15:47 +0000 (12:15 +0300)]
Add missing newline at the end of options list

In qemu-kvm this place looks even more "interesting":

 -runas user     Change to user id user just before starting the VM.
 -readconfig <file>
 -writeconfig <file>
                read/write config file-no-kvm         disable KVM hardware virtualization
 -no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC
 -no-kvm-pit     disable KVM kernel mode PIT

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 19e65b47f60c68d7e8c96aa0a36223c5a0d3422b)

14 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>
(cherry picked from commit e405a2ba91b68817cae2a428de55fe9616a4cf37)

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>
(cherry picked from commit 59d1c1c2d774cccb0a88ff73501f97bea190c154)

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>
(cherry picked from commit 9706c06d9c93b6d94785b6b14565b61ddae95a04)

14 years agoalpha: fix compile
Blue Swirl [Sun, 20 Dec 2009 10:27:44 +0000 (10:27 +0000)]
alpha: fix compile

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>
[blauwirbel@gmail.com: combined 299060a0 and 58faa1a6 to avoid breakage]
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agofdc/sparc32: don't hang on detection under OBP
Artyom Tarasenko [Sun, 13 Dec 2009 13:30:44 +0000 (13:30 +0000)]
fdc/sparc32: don't hang on detection under OBP

Stepping through the SS-5's OBP initialization routines
it looks like reading fdc main status register should
clear the fd interrupt.
The patch doesn't fix problems with fdc on sparc platform,
it only fixes fdc detection.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoscsi-disk: Inquiry with allocation length of CDB < 36 (v4)
Artyom Tarasenko [Sun, 13 Dec 2009 10:32:36 +0000 (11:32 +0100)]
scsi-disk: Inquiry with allocation length of CDB < 36 (v4)

According to the SCSI-2 specification,
http://ldkelley.com/SCSI2/SCSI2/SCSI2/SCSI2-08.html#8.2.5 ,
"if the allocation length of the command descriptor block (CDB) is too
small to transfer all of the parameters, the additional length shall
not be adjusted to reflect the truncation."
The 36 mandatory bytes of response are written to outbuf, and then
only the length requested in CDB is transferred.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoUpdate version and changelog for 0.12.1 v0.12.1
Anthony Liguori [Sun, 20 Dec 2009 01:31:18 +0000 (19:31 -0600)]
Update version and changelog for 0.12.1

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
(cherry picked from commit 935effc2bbd2c441b755a8d280811a9763fdb98c)

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>
(cherry picked from commit f9e69bd9cfe2247b1fb5dc56d3a28baf36ce8384)

14 years agoUpdate for 0.12.0 release v0.12.0
Anthony Liguori [Sat, 19 Dec 2009 14:23:00 +0000 (08:23 -0600)]
Update for 0.12.0 release

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>
(cherry picked from commit eac1bb74be4d95616b8a6217e020b1b0d6918608)

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>
(cherry picked from commit 46ee2295678af629a2869e4e331e4e002bcc31fd)

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>
(cherry picked from commit 17a7a5c59c4d72dd1d5666f348b010be6b10163c)

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>
(cherry picked from commit 056001ab30b1e596b992e70f9cb2adacef9c0ad0)

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>
(cherry picked from commit 7cfe34fe4e3b518485c15aa9a78b4cf9cbd11a4d)

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>
(cherry picked from commit 58341bcd112cf11c6266cabe36921572fa4b019d)

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>
(cherry picked from commit d683cfb1a94aa61ace4ce7ce824f1e087b37b851)

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>
(cherry picked from commit 19863875a2e18fc868a7b830f16fa76d32518bd1)

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>
(cherry picked from commit e38fb11b5099db8de8d60d536d4a01610ee4c08b)

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>
(cherry picked from commit 89f5461fc9a3c437e632f6895dc605e8f03b925e)

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>
(cherry picked from commit 2dc3f77c86b6c3782f057af1d935ccddc052bed5)

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>
(cherry picked from commit 632cf034b401cdd01dae253a8b577fe518e37654)

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>
(cherry picked from commit 379526a40e855b0da3c5718063a7d992aa5a79a1)

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>
(cherry picked from commit abe147e0ce41c07e789f6627bcb01c905d1f9bbf)

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>
(cherry picked from commit c2b5bda43a1c87147fadc78d5590b1465b850816)

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>
(cherry picked from commit 8c52c8f320b27684ec3b1a649925b75af376b1f7)

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>
(cherry picked from commit c2039bd0ffce8807e0eaac55254fde790825fa92)

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>
(cherry picked from commit ec7efac4a967c650ae1cd8cebe28e7c69cbe3864)

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>
(cherry picked from commit 47f5ba724871622c7db7a73fd05d6b3646478dd6)

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>
(cherry picked from commit aef30c3c6a3165178584eb125f64defd8173eebd)

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>
(cherry picked from commit c62313bbdc48f72e93fa8196f2fff96ba35e4e9d)

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>
(cherry picked from commit acb6685feaeea0989d29b6f12e96fea48e8ce9d9)

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>
(cherry picked from commit 8095cb3ed22d74649fd247efb9518459eae4d92e)

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>
(cherry picked from commit b5cc6e32baa9d98d50debe23229b303f89fe84f1)

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>
(cherry picked from commit a6109ff1b5d7184a9d490c4ff94f175940232ebd)

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>
(cherry picked from commit ee3e41a9a0194af21d0da75f5afd87bea3738cf3)

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>
(cherry picked from commit f0138a63a41fe26bcef61d031ae53d872d12a992)

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>
(cherry picked from commit f351d050dccfc469fecd353d095526d52e4632c6)

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>
(cherry picked from commit 9ef5c4bf8132eb72db2dd83fce3fa0005a6dd13f)

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>
(cherry picked from commit 69fd02eea61e6d9e7cd7831ef26522a5ac9e146c)

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>
(cherry picked from commit eba6fe8732cb5109b6fcf6a973d8959827eb7af4)

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>
(cherry picked from commit 42be86ce95db944910005aa981a8e9ae5e01b05a)

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>
(cherry picked from commit 15ff7705444ab9663189946d6d648431e0649df1)

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>
(cherry picked from commit d8bcbabf260a4ecce73180991cad576de850b66d)

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>
(cherry picked from commit ac33f8fad14e07fa12b74c3494339ae6882dc22f)

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>
(cherry picked from commit 2daa11912699d9412fb4404d646031a74b166aa5)

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>
(cherry picked from commit 183e6e525764d5c4978e37b42dc2cde0b0ffcfec)

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>
(cherry picked from commit cfdf2c40577ed99bb19cdc05d0537e2808d77a78)

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>
(cherry picked from commit 78d714e08f15171adf48e32ba86709f9c64f37cf)

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>
(cherry picked from commit 29ec3156ee66b6e2553a0adb2f35cb143edddc5f)

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>
(cherry picked from commit 18dd19a7d9bb90734b5188fd6f53c76bde711e4b)

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>
(cherry picked from commit 2dd650e58acbafedc7bf34045b7f81bb6c912e72)

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>
(cherry picked from commit 092493be3caab1ac77f4223b4c3fb0975d1ed490)

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>
(cherry picked from commit 75f124753922451ee697defd81a80a91ce3f9888)

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>
(cherry picked from commit 40a0d7c395f4d18a8061ba075d8f9aab2fa0ec2a)

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>
(cherry picked from commit 36ecd7c016f682437941a54193251cbf918bef0d)

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>
(cherry picked from commit d46272c774a94a8b2f0849703070dbcd93057f50)

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>
(cherry picked from commit 31827373f03b0ff1550d45ddef0ca1305a2ae70d)

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>
(cherry picked from commit 02c2b87fff97e77a1f6033fb09f53afa267c0c1e)

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>
(cherry picked from commit d587e0787153f0224a6140c5015609963ceaabfb)

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>
(cherry picked from commit 82c09f2f0d0f405428ce0c567da2ada493acc30b)

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>
(cherry picked from commit e249651ca94058547f7ae84694e82bb1ee03bc3c)

14 years agoS390: Don't tell guest we're updating config space
Alexander Graf [Thu, 17 Dec 2009 12:06:09 +0000 (13:06 +0100)]
S390: Don't tell guest we're updating config space

Currently we always set the "config space changed" bit to 1 when triggering
any virtio interrupt. While that worked in 2.6.27, newer kernels interpret
that value as "only the config space changed and nothing else happened".

Since we usually trigger interrupts to tell the guest that something did
happen, we just not tell it the config space changed for now until we
implement the correct callback for that.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 86f3dba6518bd5fd106e1cf3f36dafda41ff377b)

14 years agoadd default virtcon initialization
Alexander Graf [Thu, 17 Dec 2009 12:06:08 +0000 (13:06 +0100)]
add default virtcon initialization

When going through the default devices, we don't initialize the virtio
console, unless we're doing -nographic.

I suppose that's just a leftover from the recent code restructuring, so
let's put it in.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 38536da1e3cfde355169a81a3abe3235fd13fc6a)

14 years agoS390: Loop through virtio console devices
Alexander Graf [Thu, 17 Dec 2009 12:06:07 +0000 (13:06 +0100)]
S390: Loop through virtio console devices

We used to always create one single virtio console device. This breaks when
either zero of multiple virtio console devices are requested, so let's use
the same code as on x86.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit a1e4b07f04d8f31e8c0c1bf97385f426d3fcf5e6)

14 years agotarget-s390: Fail on unknown instructions
Alexander Graf [Thu, 17 Dec 2009 12:56:47 +0000 (13:56 +0100)]
target-s390: Fail on unknown instructions

We were being a bit too nice and didn't give the guest an invalid instruction
interrupt.

While that works, it's not exactly the fastest thing to do, since now the
guest doesn't know that we're not really implementing that instruction, so it
continues doing it.

We run into this with the set_page_unstable hint instruction. So let's bail out
in these cases.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit d7963c43b9646e4dfc69a4253c61e4bab7b661cd)

14 years agoosdep: Fix runtime failure on older Linux kernels
Andre Przywara [Fri, 18 Dec 2009 09:45:07 +0000 (10:45 +0100)]
osdep: Fix runtime failure on older Linux kernels

If QEMU finds newer kernel header files on compilation time, it will use
advertised features like pipe2 or SOCK_CLOEXEC by just doing a compile test.
If later the executables are executed on an older kernel (<2.6.27,
like Xen Dom0 2.6.18), then QEMU will fail on opening sockets and creating
pipes and returns the rather unspecific "qemu_init_main_loop failed".
This patch fixes this by checking the return values of these calls
for EINVAL and ENOSYS and falling back to the older versions automatically.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix a make -j race
Juergen Lock [Mon, 14 Dec 2009 20:54:43 +0000 (21:54 +0100)]
Fix a make -j race

Make libuser.a depend on $(GENERATED_HEADERS) too so make -j won't start
building it before the headers exist.  (There may be more bugs like this
but at least this makes (g)make -j4 started from scratch on a quadcore
now always complete here again.)

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit c1bb0dcef2d3a62c89cef81a0f1a0e5e97ef325b)

14 years agotarget-alpha: Fix generic ctz64.
Richard Henderson [Mon, 14 Dec 2009 01:47:25 +0000 (17:47 -0800)]
target-alpha: Fix generic ctz64.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 06445248d23d2422a0fb5736b64f9e5a66539749)

14 years agos390: Fix buggy assignment
Stefan Weil [Mon, 14 Dec 2009 09:39:12 +0000 (10:39 +0100)]
s390: Fix buggy assignment

nd->model keeps dynamically allocated model names.
So casting of a constant string is wrong here.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 5a2b3fc5aaae48859e09a8d96f4f92578b060892)

14 years agoe1000: fix init values for command register
Michael S. Tsirkin [Wed, 9 Dec 2009 20:35:37 +0000 (22:35 +0200)]
e1000: fix init values for command register

Command register for e1000 was initialized to
values out of spec: all of bus master,
io, memory and interrupt disable bits were set.

This breaks the device now that we actually respect
the interrupt disable bit, unless the guest
happens to clear it. Fix, and make the device
more spec compliant, by not touching
the default.

There are implications for migration
from old qemu as well, will be addressed
separately.

Reported-by: Luiz Capitulino <lcapitulino@redhat.com>
Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agotarget-mips: fix user-mode emulation startup
Nathan Froyd [Fri, 11 Dec 2009 17:29:20 +0000 (09:29 -0800)]
target-mips: fix user-mode emulation startup

Running programs with the MIPS user-mode emulator fails during dynamic
loading, as floating-point instructions are not enabled in in
env->hflags.  Move the code for doing so from fpu_init to cpu_reset so
the MIPS_HFLAG_{FPU,F64} setting doesn't get clobbered by cpu_reset
setting env->hflags to MIPS_HFLAG_UM.

The same end can be achieved by swapping the ordering of fpu_init and
cpu_reset in cpu_mips_init, but it seemed better to consolidate the
CONFIG_USER_ONLY code into a single location.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 91a759352623e4a3da969fa66626cc99241e9da2)