sdk/emulator/qemu.git
14 years agotcg-sparc: Implement division properly.
Richard Henderson [Tue, 12 Jan 2010 19:59:33 +0000 (19:59 +0000)]
tcg-sparc: Implement division properly.

The {div,divu}2 opcodes are intended for systems for which the
division instruction produces both quotient and remainder.  Sparc
is not such a system.  Indeed, the remainder must be computed as

  quot = a / b
  rem = a - (quot * b)

Split out a tcg_out_div32 function that properly initializes Y
with the extension of the input to 64-bits.  Discard the code
that used the 64-bit DIVX on sparc9/sparcv8plus without extending
the inputs to 64-bits.  Implement remainders in terms of division
followed by multiplication.

Signed-off-by: Richard Henderson <rth@twiddle.net>
[blauwirbel@gmail.com: applied rth's typo fix in tcg_out_div32]
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotcg-sparc: Do not remove %o[012] from 'r' constraint.
Richard Henderson [Tue, 12 Jan 2010 19:59:32 +0000 (19:59 +0000)]
tcg-sparc: Do not remove %o[012] from 'r' constraint.

Only 'L' constraint needs that.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotcg-sparc: Implement add2, sub2, mulu2.
Richard Henderson [Tue, 12 Jan 2010 19:59:31 +0000 (19:59 +0000)]
tcg-sparc: Implement add2, sub2, mulu2.

Add missing 32-bit double-word support opcodes.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotcg-sparc: Add tcg_out_arithc.
Richard Henderson [Tue, 12 Jan 2010 19:59:29 +0000 (19:59 +0000)]
tcg-sparc: Add tcg_out_arithc.

Add a function to handle the register-vs-immediate test for arithmetic.

Also, adjust the OP_32_64 macro so that it auto-indents properly.
Rename the gen_arith32 label to gen_arith, since it handles 64-bit
arithmetic as well.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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>
14 years agoqdev: fix thinko leading to guest crashes
Michael S. Tsirkin [Tue, 12 Jan 2010 19:16:59 +0000 (21:16 +0200)]
qdev: fix thinko leading to guest crashes

Without this fix, guest crashes with drive=virtio.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
14 years agodma/sb16: make clang analyzer not complain
malc [Tue, 12 Jan 2010 18:55:45 +0000 (21:55 +0300)]
dma/sb16: make clang analyzer not complain

Signed-off-by: malc <av1474@comtv.ru>
14 years agoSparc64: enable real access to PCI configuration space
Blue Swirl [Mon, 11 Jan 2010 21:20:53 +0000 (21:20 +0000)]
Sparc64: enable real access to PCI configuration space

Leave the bogus access method used by OpenBIOS in place for now.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoUpdate to SeaBIOS 0.5.1
Anthony Liguori [Mon, 11 Jan 2010 19:27:35 +0000 (13:27 -0600)]
Update to SeaBIOS 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 agomake help output be a little more self-consistent
Bruce Rogers [Wed, 6 Jan 2010 19:33:57 +0000 (12:33 -0700)]
make help output be a little more self-consistent

Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
14 years agovirtio: add features as qdev properties
Michael S. Tsirkin [Sun, 10 Jan 2010 11:52:53 +0000 (13:52 +0200)]
virtio: add features as qdev properties

Add feature bits as properties to virtio. This makes it possible to e.g. define
machine without indirect buffer support, which is required for 0.10
compatibility, or without hardware checksum support, which is required for 0.11
compatibility.  Since default values for optional features are now set by qdev,
get_features callback has been modified: it sets non-optional bits, and clears
bits not supported by host.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio: rename features -> guest_features
Michael S. Tsirkin [Sun, 10 Jan 2010 11:52:47 +0000 (13:52 +0200)]
virtio: rename features -> guest_features

Rename features->guest_features. This is
what they are, avoid confusion with
host features which we also need to keep around.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: add bit property type
Michael S. Tsirkin [Sun, 10 Jan 2010 11:52:41 +0000 (13:52 +0200)]
qdev: add bit property type

This adds "bit" property type, which is a boolean stored in a 32 bit
integer field, with legal values on and off.  Will be used by virtio for
feature bits.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
14 years agolsi: pass lsi_request to lsi_reselect
Gerd Hoffmann [Wed, 6 Jan 2010 16:08:04 +0000 (17:08 +0100)]
lsi: pass lsi_request to lsi_reselect

All callers of lsi_reselect have a lsi_request struct at hand anyway.
So just pass it directly instead of having lsi_reselect search for it
using the tag.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolsi: move dma_len+dma_buf into lsi_request
Gerd Hoffmann [Wed, 6 Jan 2010 16:08:03 +0000 (17:08 +0100)]
lsi: move dma_len+dma_buf into lsi_request

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolsi: move current_dev into lsi_request
Gerd Hoffmann [Wed, 6 Jan 2010 16:08:02 +0000 (17:08 +0100)]
lsi: move current_dev into lsi_request

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolsi: have lsi_request for the whole life time of the request.
Gerd Hoffmann [Wed, 6 Jan 2010 16:08:01 +0000 (17:08 +0100)]
lsi: have lsi_request for the whole life time of the request.

Right now lsi_request is allocated when a request is queued and released
when a request is unqueued.  With this patch applied the lsi_request is
kept for the whole lifetime of the scsi request.

Rationale: We can use it for per-request data then.  The patch does that
already for the request tag.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolsi: use QTAILQ for lsi_queue
Gerd Hoffmann [Wed, 6 Jan 2010 16:08:00 +0000 (17:08 +0100)]
lsi: use QTAILQ for lsi_queue

Replace the funky array logic for queued commands with standard
qemu list functions.  Also rename lsi_queue to lsi_request.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
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>
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>
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>
14 years agoPCI: Fix a typo
Blue Swirl [Sun, 10 Jan 2010 20:54:38 +0000 (20:54 +0000)]
PCI: Fix a typo

Fixes build with PCI_DEBUG defined.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc64: increase APB register range
Blue Swirl [Sun, 10 Jan 2010 18:25:48 +0000 (18:25 +0000)]
Sparc64: increase APB register range

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc64: use firmware configuration device for command line storage
Blue Swirl [Sat, 9 Jan 2010 21:27:04 +0000 (21:27 +0000)]
Sparc64: use firmware configuration device for command line storage

Avoid a ROM conflict.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agooss: fix fragment setting
malc [Sat, 9 Jan 2010 15:06:54 +0000 (18:06 +0300)]
oss: fix fragment setting

Previous patch introduced subtle regression, in cases when
OSS_GETVERSION fails the code wasn't falling back to
SNDCTL_DSP_SETFRAGMENT.

Signed-off-by: malc <av1474@comtv.ru>
14 years agooss: issue OSS_GETVERSION ioctl only when needed
malc [Sat, 9 Jan 2010 14:54:07 +0000 (17:54 +0300)]
oss: issue OSS_GETVERSION ioctl only when needed

Signed-off-by: malc <av1474@comtv.ru>
14 years agofinish VPATH -> vpath translation
Paolo Bonzini [Mon, 4 Jan 2010 10:02:28 +0000 (11:02 +0100)]
finish VPATH -> vpath translation

This adds a few more vpath suffixes and points the remaining two paths
explicitly to $(SRC_PATH) in order to eliminate the VPATH assignment
from config-host.mak.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agooss: refactor code around policy setting
malc [Fri, 8 Jan 2010 21:28:40 +0000 (00:28 +0300)]
oss: refactor code around policy setting

This fixes a problem with a previous patch spotted by Juergen Lock,
thanks to him again.

Signed-off-by: malc <av1474@comtv.ru>
14 years agoMakefile: remove obsolete libuser.a rule
Blue Swirl [Fri, 8 Jan 2010 19:50:27 +0000 (19:50 +0000)]
Makefile: remove obsolete libuser.a rule

libuser.a was removed by 0e8c9214ba1d4128cf92442cd343bc3733478261.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: interrupt trap handling
Igor V. Kovalenko [Thu, 7 Jan 2010 20:28:31 +0000 (23:28 +0300)]
sparc64: interrupt trap handling

cpu_check_irqs
- handle SOFTINT register TICK and STICK timer bits
- only check interrupt levels greater than PIL value
- handle preemption by higher level traps

cpu_exec
- handle CPU_INTERRUPT_HARD only if interrupts are enabled
- PIL 15 is not special level on sparcv9

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: move cpu_interrupts_enabled to cpu.h
Igor V. Kovalenko [Thu, 7 Jan 2010 20:28:26 +0000 (23:28 +0300)]
sparc64: move cpu_interrupts_enabled to cpu.h

- to be used by cpu_check_irqs

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: add macros to deal with softint and timer interrupt
Igor V. Kovalenko [Thu, 7 Jan 2010 20:28:21 +0000 (23:28 +0300)]
sparc64: add macros to deal with softint and timer interrupt

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: check for pending irq when pil, pstate or softint is changed
Igor V. Kovalenko [Thu, 7 Jan 2010 20:28:15 +0000 (23:28 +0300)]
sparc64: check for pending irq when pil, pstate or softint is changed

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: use helper_wrpil to check pending irq on write
Igor V. Kovalenko [Thu, 7 Jan 2010 20:28:10 +0000 (23:28 +0300)]
sparc64: use helper_wrpil to check pending irq on write

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: add PIL to cpu state dump
Igor V. Kovalenko [Thu, 7 Jan 2010 20:28:05 +0000 (23:28 +0300)]
sparc64: add PIL to cpu state dump

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: trace pstate and global register set changes
Igor V. Kovalenko [Thu, 7 Jan 2010 20:28:00 +0000 (23:28 +0300)]
sparc64: trace pstate and global register set changes

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: change_pstate should have 32bit argument
Igor V. Kovalenko [Thu, 7 Jan 2010 20:27:54 +0000 (23:27 +0300)]
sparc64: change_pstate should have 32bit argument

- pstate is 32bit variable, no need to pass 64bit value around

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agomultiboot: Separate multiboot loading into separate file
Adam Lackorzynski [Sat, 26 Dec 2009 13:13:46 +0000 (14:13 +0100)]
multiboot: Separate multiboot loading into separate file

Move multiboot loading code into separate files as suggested by Alex Graf.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomultiboot: Support arbitrary number of modules.
Adam Lackorzynski [Sat, 26 Dec 2009 13:13:45 +0000 (14:13 +0100)]
multiboot: Support arbitrary number of modules.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
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>
14 years agoblock/vdi: allow disk sizes not multiple of block size
François Revol [Tue, 22 Dec 2009 11:40:49 +0000 (12:40 +0100)]
block/vdi: allow disk sizes not multiple of block size

The disk image I created from my old laptop disk with VBoxManage
internalcommand converthd obviously was not a multiple of 1MB as when
created from scratch. This fixes QEMU refusing it. We still require the
size to be a multiple of sector size though.
It then boots correctly.

Allow opening VDI images with size not multiple of 1MB (as when converted from a raw disk).

Signed-off-by: François Revol <revol@free.fr>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agonet: add API to disable/enable polling
Michael S. Tsirkin [Thu, 24 Dec 2009 12:46:29 +0000 (14:46 +0200)]
net: add API to disable/enable polling

When vhost is bound to a backend device, we need to stop polling it when
vhost is started, and restart polling when vhost is stopped.
Add an API for that for use by vhost, and implement in tap backend.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agodebugcon: support for debugging consoles (e.g. Bochs port 0xe9)
H. Peter Anvin [Tue, 29 Dec 2009 21:51:36 +0000 (13:51 -0800)]
debugcon: support for debugging consoles (e.g. Bochs port 0xe9)

Add generic support for debugging consoles (simple I/O ports which
when written to cause debugging output to be written to a target.)
The current implementation matches Bochs' port 0xe9, allowing the same
debugging code to be used for both Bochs and Qemu.

There is no vm state associated with the debugging port, simply
because it has none -- the entire interface is a single, stateless,
write-only port.

Most of the code was cribbed from the serial port driver.

v2: removed non-ISA variants (they can be introduced when/if someone
wants them, using code from the serial port); added configurable
readback (Bochs returns 0xe9 on a read from this register, mimic that
by default)  This retains the apparently somewhat controversial user
friendly option, however.

v3: reimplemented the user friendly option as a synthetic option
("-debugcon foo" basically ends up being a parser-level shorthand for
"-chardev stdio,id=debugcon -device isa-debugcon,chardev=debugcon") --
this dramatically reduced the complexity while keeping the same level
of user friendliness.

v4: spaces, not tabs.

v5: update to match current top of tree.  Calling qemu_chr_open()
already during parsing no longer works; defer until we are parsing the
other console-like devices.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoMakefile: Update unmodified config-devices.mak automatically
Stefan Weil [Sun, 20 Dec 2009 14:39:03 +0000 (15:39 +0100)]
Makefile: Update unmodified config-devices.mak automatically

This makes rebuilds after source updates easier
for most users (who don't edit config-devices.mak).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoUse vpath directive
Paolo Bonzini [Mon, 21 Dec 2009 09:06:55 +0000 (10:06 +0100)]
Use vpath directive

The vpath directive has two advantages over the VPATH variable:
1) it allows to skip searching of .o files; 2) the default semantics
are to append to the vpath, so there is no confusion between "VPATH=xyz"
and "VPATH+=xyz".

Since "vpath %.c %.h PATH" is not valid, I'm introducing a wrapper
macro to append one or more directories to the vpath.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agooss: workaround for cases when OSS_GETVERSION is not defined
malc [Fri, 8 Jan 2010 08:26:27 +0000 (11:26 +0300)]
oss: workaround for cases when OSS_GETVERSION is not defined

Thanks to Juergen Lock.

Signed-off-by: malc <av1474@comtv.ru>
14 years agoSparc32: clear exception_index with -1 value
Blue Swirl [Thu, 7 Jan 2010 20:02:04 +0000 (20:02 +0000)]
Sparc32: clear exception_index with -1 value

See also 821b19fe923ac49a24cdb4af902584fdd019cee6.

Spotted by Artyom Tarasenko and Igor Kovalenko.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoDrop --whole-archive and static libraries
Andreas Färber [Wed, 6 Jan 2010 19:24:05 +0000 (20:24 +0100)]
Drop --whole-archive and static libraries

Juan has contributed a cool Makefile infrastructure that enables us to drop
static libraries completely:

Move shared obj-y definitions to Makefile.objs, prefixed {common-,hw-,user-},
and link those object files directly into the executables.

Replace HWLIB by HWDIR, specifying only the directory.

Drop --whole-archive and ARLIBS in Makefiles and configure.

Drop GENERATED_HEADERS dependency in rules.mak, since this rebuilds all
common objects after generating a target-specific header; add dependency
rules to Makefile and Makefile.target instead.

v2:
- Don't try to include /config.mak for user emulators
- Changes to user object paths ("Quickfix for libuser.a drop") were obsoleted
  by "user_only: compile everything with -fpie" (Kirill A. Shutemov)

v3:
- Fix dependency modelling for tools
- Remove comment on GENERATED_HEADERS obsoleted by this patch

Signed-off-by: Andreas Färber <afaerber@opensolaris.org>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Palle Lyckegaard <palle@lyckegaard.dk>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Cc: Juan Quintela <quintela@trasno.org>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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>
14 years agoCocoa: Use optimized drawing for the window
Andreas Färber [Sun, 13 Dec 2009 02:06:20 +0000 (03:06 +0100)]
Cocoa: Use optimized drawing for the window

Default is NO.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: Suppress window resize animation
Andreas Färber [Sun, 13 Dec 2009 01:49:57 +0000 (02:49 +0100)]
Cocoa: Suppress window resize animation

Disable the nice resize animation, to avoid drawing glitches
following a guest's screen size change.

Based on patch by Juha Riihimäki.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Juha Riihimäki <juha.riihimaki@nokia.com>
Cc: Alexander Graf <alex@csgraf.de>
Cc: Mike Kronenberg <mike.kronenberg@kronenberg.org>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: Shutdown when window is closed
Andreas Färber [Mon, 14 Dec 2009 21:13:27 +0000 (22:13 +0100)]
Cocoa: Shutdown when window is closed

The application is not very useful once the guest window is closed.
QEMU is not a document-based application; terminating it automatically
saves the user another action and resembles SDL behavior.

v2:
- Use delegate method, suggested by Juha Riihimäki.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: Don't unconditionally show the window
Andreas Färber [Sun, 13 Dec 2009 01:11:44 +0000 (02:11 +0100)]
Cocoa: Don't unconditionally show the window

When QEMU was launched in no-graphic, Curses or VNC mode,
don't run it as a Cocoa application.

Based on patch by Alexander Graf.

v1:
- Avoid type mismatch warning for argv
- Drop noCocoa variable
- Coding Style changes

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Alexander Graf <agraf@suse.de>
Cc: Mike Kronenberg <mike.kronenberg@kronenberg.org>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: Redraw the View asynchronously
Andreas Färber [Sun, 13 Dec 2009 01:08:58 +0000 (02:08 +0100)]
Cocoa: Redraw the View asynchronously

Cf. http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaPerformance/Articles/CustomViews.html

Based on patch by Juha Riihimäki.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Juha Riihimäki <juha.riihimaki@nokia.com>
Cc: Alexander Graf <alex@csgraf.de>
Cc: Mike Kronenberg <mike.kronenberg@kronenberg.org>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: Mark the View as opaque
Andreas Färber [Sun, 13 Dec 2009 01:03:33 +0000 (02:03 +0100)]
Cocoa: Mark the View as opaque

Default is NO.

Cf. http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaPerformance/Articles/CustomViews.html

Based on patch by Juha Riihimäki.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Juha Riihimäki <juha.riihimaki@nokia.com>
Cc: Alexander Graf <alex@csgraf.de>
Cc: Mike Kronenberg <mike.kronenberg@kronenberg.org>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: Fix compilation on Mac OS X v10.4 and earlier
Andreas Färber [Sun, 13 Dec 2009 00:52:29 +0000 (01:52 +0100)]
Cocoa: Fix compilation on Mac OS X v10.4 and earlier

NSView's enterFullScreenMode:withOptions: and
exitFullScreenModeWithOptions: are available on v10.5
and later only. Undefined methods raise warnings and
undefined constants result in errors.

Reported by Ryan Schmidt.

While at it, avoid a warning on v10.3.9,
where MAC_OS_X_VERSION_10_4 is not defined.

Spotted by John Arbuckle.

Fix associated comments.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: John Arbuckle <programmingkidx@gmail.com>
Cc: Ryan Schmidt <qemu-2009@ryandesign.com>
Cc: Mike Kronenberg <mike.kronenberg@kronenberg.org>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: Silence type warning
Andreas Färber [Sun, 13 Dec 2009 00:16:27 +0000 (01:16 +0100)]
Cocoa: Silence type warning

Add const for "qemu" character literal, to avoid:

warning: initialization discards qualifiers from pointer target type

An earlier patch by John proposed to use char[5]. Since we do not modify
the text and later copy it into malloc'ed memory, marking it as const
seems sufficient.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: John Arbuckle <programmingkidx@gmail.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: Silence warning on Big Endian host
Andreas Färber [Sat, 12 Dec 2009 23:58:21 +0000 (00:58 +0100)]
Cocoa: Silence warning on Big Endian host

__LITTLE_ENDIAN__ is undefined on Big Endian host.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: John Arbuckle <programmingkidx@gmail.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: Silence warning for cocoa_keycode_to_qemu
Andreas Färber [Sat, 12 Dec 2009 23:55:53 +0000 (00:55 +0100)]
Cocoa: Silence warning for cocoa_keycode_to_qemu

Make cocoa_keycode_to_qemu static, to avoid:

warning: no previous prototype for ‘cocoa_keycode_to_qemu’

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: John Arbuckle <programmingkidx@gmail.com>
Signed-off-by: malc <av1474@comtv.ru>
14 years agoCocoa: ppc64 host support
Andreas Färber [Sat, 12 Dec 2009 23:45:40 +0000 (00:45 +0100)]
Cocoa: ppc64 host support

Fix integer usage in the Cocoa backend: NSInteger is long on LP64.

http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html#//apple_ref/doc/uid/20000014-BBCFHHCD

This makes the graphical display show up on a ppc64 host.

v3:
- Confine NSInteger to Mac OS X v10.5 and later

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: malc <av1474@comtv.ru>
14 years agosparc64: clear exception_index with -1 value
Igor V. Kovalenko [Wed, 6 Jan 2010 17:35:22 +0000 (17:35 +0000)]
sparc64: clear exception_index with -1 value

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoMerge remote branch 'mst/for_anthony' into staging
Anthony Liguori [Wed, 6 Jan 2010 13:16:59 +0000 (07:16 -0600)]
Merge remote branch 'mst/for_anthony' into staging

14 years agopass env to raise_exception if called outside of op_helper code
Igor V. Kovalenko [Sun, 3 Jan 2010 12:09:27 +0000 (15:09 +0300)]
pass env to raise_exception if called outside of op_helper code

- this fixes stepping with gdb, where do_unassigned_access
  may be called from gdb handler, outside of generated code

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: switch to MMU global registers in more MMU related traps
Igor V. Kovalenko [Sun, 3 Jan 2010 12:16:51 +0000 (12:16 +0000)]
sparc64: switch to MMU global registers in more MMU related traps

- extended range of MMU related traps which use MMU global registers,
  as listed in Ultrasparc-IIi document
- no visible changes, since emulation do not cause added traps

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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 agoloader: don't call realloc(non_null, 0) when no symbols are present
Aurelien Jarno [Mon, 28 Dec 2009 20:18:12 +0000 (21:18 +0100)]
loader: don't call realloc(non_null, 0) when no symbols are present

According to C99, realloc(non_null, 0) != free(non_null), that's why
it is forbidden in QEMU.

When there are no symbols, nsyms equals to 0. Free the syms structure
and set it to NULL instead of reallocating it with a size of 0.

This fixes -kernel with stripped kernels.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
15 years agoSparc64: split DPRINTF into CPUIRQ and EBUS versions
Blue Swirl [Wed, 30 Dec 2009 12:27:17 +0000 (12:27 +0000)]
Sparc64: split DPRINTF into CPUIRQ and EBUS versions

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoSparc64: fix compile with DEBUG_IRQ enabled
Blue Swirl [Wed, 30 Dec 2009 12:26:01 +0000 (12:26 +0000)]
Sparc64: fix compile with DEBUG_IRQ enabled

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosdl: print the reason why SDL thinks SDL_Init failed before exiting
malc [Wed, 30 Dec 2009 01:26:34 +0000 (04:26 +0300)]
sdl: print the reason why SDL thinks SDL_Init failed before exiting

Signed-off-by: malc <av1474@comtv.ru>
15 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>
15 years agoUpdate Sparc64 OpenBIOS image to r649.
Blue Swirl [Mon, 28 Dec 2009 11:28:40 +0000 (11:28 +0000)]
Update Sparc64 OpenBIOS image to r649.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoSparc64: move APB PCI memory base to correct location
Blue Swirl [Sun, 27 Dec 2009 20:52:39 +0000 (20:52 +0000)]
Sparc64: move APB PCI memory base to correct location

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoPCI: Fix bus address conversion
Blue Swirl [Sun, 27 Dec 2009 20:52:36 +0000 (20:52 +0000)]
PCI: Fix bus address conversion

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Bus address conversion was not correct.

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

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

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

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

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

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

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