]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
13 years agomigration: stable ram block ordering
Michael S. Tsirkin [Mon, 22 Nov 2010 17:52:34 +0000 (19:52 +0200)]
migration: stable ram block ordering

This makes ram block ordering under migration stable, ordered by offset.
This is especially useful for migration to exec, for debugging.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Jason Wang <jasowang@redhat.com>
13 years agoMerge remote branch 'origin/master' into pci
Michael S. Tsirkin [Wed, 1 Dec 2010 05:11:51 +0000 (07:11 +0200)]
Merge remote branch 'origin/master' into pci

Conflicts:
Makefile.objs
hw/virtio.c

13 years agoMerge remote branch 'kwolf/for-anthony' into staging
Anthony Liguori [Tue, 30 Nov 2010 21:25:34 +0000 (15:25 -0600)]
Merge remote branch 'kwolf/for-anthony' into staging

13 years agoMerge remote branch 'qmp/for-anthony' into staging
Anthony Liguori [Tue, 30 Nov 2010 21:24:26 +0000 (15:24 -0600)]
Merge remote branch 'qmp/for-anthony' into staging

13 years agoUse a Linux-style MAINTAINERS file
Anthony Liguori [Thu, 9 Sep 2010 19:51:31 +0000 (14:51 -0500)]
Use a Linux-style MAINTAINERS file

I make no claims that this is accurate or exhaustive but I think it's a
reasonable place to start.

As the file mentions, the purpose of this file is to give contributors
information about who they can go to with questions about a particular piece of
code or who they can ask for review.

If you sign up for a piece of code and indicate that it's Maintained or
Supported, please be prepared to be responsive to questions about that
subsystem.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---

v1 -> v2
 - Sort alphabetically
 - Copy in instructions from linux MAINTAINERS
 - Fix entries based on review feedback

13 years agoide: Reset current_addr after stopping DMA
Kevin Wolf [Fri, 26 Nov 2010 15:36:16 +0000 (16:36 +0100)]
ide: Reset current_addr after stopping DMA

Whenever SSBM is reset in the command register all state information is lost.
Restarting DMA means that current_addr must be reset to the base address of the
PRD table. The OS is not required to change the base address register before
starting a DMA operation, it can reuse the value it wrote for an earlier
request.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoide: Ignore double DMA transfer starts/stops
Kevin Wolf [Fri, 26 Nov 2010 15:44:53 +0000 (16:44 +0100)]
ide: Ignore double DMA transfer starts/stops

You can only start a DMA transfer if it's not running yet, and you can only
cancel it if it's running.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoide: Set bus master inactive on error
Kevin Wolf [Fri, 26 Nov 2010 15:47:42 +0000 (16:47 +0100)]
ide: Set bus master inactive on error

BMIDEA in the status register must be cleared on error. This makes FreeBSD
respond (more) correctly to I/O errors.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoide: Factor ide_dma_set_inactive out
Kevin Wolf [Fri, 26 Nov 2010 15:31:37 +0000 (16:31 +0100)]
ide: Factor ide_dma_set_inactive out

Several places that stop a DMA transfer duplicate this code. Factor it out into
a common function.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoAdd pcnet-pci.c
Paul Brook [Sat, 27 Nov 2010 11:56:02 +0000 (11:56 +0000)]
Add pcnet-pci.c

Add file missing from last commit.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoSplit out common pcnet code
Paul Brook [Sat, 27 Nov 2010 11:23:34 +0000 (11:23 +0000)]
Split out common pcnet code

The core pcnet emulation code is used by both the PCI "pcnet" device
and the SPARC "lance" device.  Split the common code frm the PCI code so
that that can be configures independantly.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoRemove PCI from sparc32 target
Paul Brook [Sat, 27 Nov 2010 10:33:55 +0000 (10:33 +0000)]
Remove PCI from sparc32 target

None of the (current) sparc32 machines have a PCI bus, so remove the PCI
code from these configs.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoDetect missing config includes
Paul Brook [Sat, 27 Nov 2010 00:43:04 +0000 (00:43 +0000)]
Detect missing config includes

Terminate make_device_config.sh if the awk command fails.
Typically this means a missing file.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoFix previous commit
Paul Brook [Sat, 27 Nov 2010 00:34:15 +0000 (00:34 +0000)]
Fix previous commit

Fix breakage from previous commit (missing pci.mak, and incorrect
include in default-configs/s390x-softmmu.mak).

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoVirtIO config option
Paul Brook [Fri, 26 Nov 2010 22:08:48 +0000 (22:08 +0000)]
VirtIO config option

Make virtio devices optional.  Selecting individual devices is not useful
as the host bindings are all in one file.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoPCI config include
Paul Brook [Fri, 26 Nov 2010 21:39:42 +0000 (21:39 +0000)]
PCI config include

Split PCI config options into a separate file

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoInclude directives in default configs
Paul Brook [Fri, 26 Nov 2010 18:47:45 +0000 (18:47 +0000)]
Include directives in default configs

Allow default configs to be split into several files.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoAdd missing dependency.
Paul Brook [Fri, 26 Nov 2010 18:46:03 +0000 (18:46 +0000)]
Add missing dependency.

Teach Makefile that cmd.o depends on a generated header (specifically
config-host.h).

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoraw-posix: raw_pwrite comment fixup
Christoph Hellwig [Fri, 26 Nov 2010 13:32:34 +0000 (14:32 +0100)]
raw-posix: raw_pwrite comment fixup

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi-disk: Remove duplicate cdb parsing
Hannes Reinecke [Wed, 24 Nov 2010 11:16:00 +0000 (12:16 +0100)]
scsi-disk: Remove duplicate cdb parsing

We parse the CDB twice, which is completely unnecessary.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi: Move sense handling into the driver
Hannes Reinecke [Wed, 24 Nov 2010 11:15:59 +0000 (12:15 +0100)]
scsi: Move sense handling into the driver

The current sense handling in scsi-bus is only used by the
scsi-disk driver; the scsi-generic driver is using its own.
So we should move the current sense handling into the
scsi-disk driver.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi: INQUIRY VPD fixes
Hannes Reinecke [Wed, 24 Nov 2010 11:15:58 +0000 (12:15 +0100)]
scsi: INQUIRY VPD fixes

We should announce and support the block device characterics page
only on block devices, not on CDROMs. And the VPD page 0x83 has
an off-by-one error.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi: Return SAM status codes
Hannes Reinecke [Wed, 24 Nov 2010 11:15:57 +0000 (12:15 +0100)]
scsi: Return SAM status codes

Traditionally, the linux stack is using SCSI status codes
which are shifted by one as compared to those defined in SAM.
A SCSI emulation should naturally return the SAM defined codes,
not the linux ones.
So to avoid any confusion this patch modifies the existing
definitions to match those found in SAM and removes any
(now obsolete) byte-shift from the returned status codes.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi: Increase the number of possible devices
Hannes Reinecke [Wed, 24 Nov 2010 11:15:56 +0000 (12:15 +0100)]
scsi: Increase the number of possible devices

The SCSI parallel interface has a limit of 8 devices, but
not the SCSI stack in general. So we should be removing the
hard-coded limit and use MAX_SCSI_DEVS instead.
And we only need to scan those devices which are allocated
by the bus.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoblock: Remove unused s->hd in various drivers
Kevin Wolf [Tue, 16 Nov 2010 17:55:01 +0000 (18:55 +0100)]
block: Remove unused s->hd in various drivers

All drivers use bs->file instead of s->hd for quite a while now, so it's time
to remove s->hd.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoqemu and qemu-xen: support empty write barriers in xen_disk
Stefano Stabellini [Wed, 24 Nov 2010 13:08:03 +0000 (13:08 +0000)]
qemu and qemu-xen: support empty write barriers in xen_disk

This patch can be applied to both qemu-xen and qemu and adds support
for empty write barriers to xen_disk.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoide: convert bmdma address ioport to ioport_register()
Avi Kivity [Sun, 21 Nov 2010 16:29:52 +0000 (18:29 +0200)]
ide: convert bmdma address ioport to ioport_register()

cmd646, via compile tested, pci lightly boot tested.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoblock migration: do not submit multiple AIOs for same sector (v2)
Marcelo Tosatti [Fri, 12 Nov 2010 18:07:50 +0000 (16:07 -0200)]
block migration: do not submit multiple AIOs for same sector (v2)

An old version of this patch was applied to master, so this contains the
differences between v1 and v2.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoImplement drive_del to decouple block removal from device removal
Ryan Harper [Fri, 12 Nov 2010 17:07:13 +0000 (11:07 -0600)]
Implement drive_del to decouple block removal from device removal

Currently device hotplug removal code is tied to device removal via
ACPI.  All pci devices that are removable via device_del() require the
guest to respond to the request.  In some cases the guest may not
respond leaving the device still accessible to the guest.  The management
layer doesn't currently have a reliable way to revoke access to host
resource in the presence of an uncooperative guest.

This patch implements a new monitor command, drive_del, which
provides an explicit command to revoke access to a host block device.

drive_del first quiesces the block device (qemu_aio_flush;
bdrv_flush() and bdrv_close()).  This prevents further IO from being
submitted against the host device.  Finally, drive_del cleans up
pointers between the drive object (host resource) and the device
object (guest resource).

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi-disk: Move active request asserts
Stefan Hajnoczi [Fri, 12 Nov 2010 09:57:11 +0000 (09:57 +0000)]
scsi-disk: Move active request asserts

SCSI read/write requests should not be re-issued before the current
fragment of I/O completes.  There are asserts in scsi-disk.c that guard
this constraint but they trigger on SPARC Linux 2.4.  It turns out that
the asserts are too early in the code path and don't allow for read
requests to terminate.

Only the read assert needs to be moved but move the write assert too for
consistency.

Reported-by: Nigel Horne <njh@bandsman.co.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agovirtio: fix up VQ checks
Michael S. Tsirkin [Tue, 23 Nov 2010 19:55:39 +0000 (21:55 +0200)]
virtio: fix up VQ checks

When migration triggers before a VQ is initialized,
base pa is 0 and last_used_index must be 0 too:
we don't have a ring to compare to.

Reported-by: Juan Quintela <quintela@redhat.com>
Tested-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agovirtio: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:36 +0000 (20:44 +0000)]
virtio: Convert fprintf() to error_report()

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit cd92f4cc22fbe12a7bf60c9430731f768dc1537c)

13 years agopci: fix bus walk under secondary bus reset
Michael S. Tsirkin [Wed, 24 Nov 2010 05:23:25 +0000 (07:23 +0200)]
pci: fix bus walk under secondary bus reset

Take into account secondary bus reset bit for
bus walk: devices behind a reset bus should not
respond to configuration cycles.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agomicroblaze: target-ify target_ucontext
Richard Henderson [Mon, 22 Nov 2010 22:57:52 +0000 (14:57 -0800)]
microblaze: target-ify target_ucontext

Rename the members of target_ucontext so that they don't conflict
with possible host macros for ucontext members.  This has already
been done for the other targets.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agopci bridge: implement secondary bus reset
Isaku Yamahata [Fri, 19 Nov 2010 09:56:03 +0000 (18:56 +0900)]
pci bridge: implement secondary bus reset

Trigger secondary bus reset when secondary bus reset bit
value changes from 0 to 1.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: use qdev reset framework for pci bus reset
Isaku Yamahata [Fri, 19 Nov 2010 09:56:02 +0000 (18:56 +0900)]
pci: use qdev reset framework for pci bus reset

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqdev: trigger reset from a given device
Isaku Yamahata [Fri, 19 Nov 2010 09:56:01 +0000 (18:56 +0900)]
qdev: trigger reset from a given device

Introduce a helper function which triggers reset from a given device.
Will be used by pci bus emulation.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqdev: introduce reset call back for qbus level
Isaku Yamahata [Fri, 19 Nov 2010 09:56:00 +0000 (18:56 +0900)]
qdev: introduce reset call back for qbus level

and make it called via qbus_reset_all().
The qbus reset callback will be used by pci bus reset.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqdev: reset qdev along with qdev tree
Anthony Liguori [Fri, 19 Nov 2010 09:55:59 +0000 (18:55 +0900)]
qdev: reset qdev along with qdev tree

This patch changes the reset handling so that qdev has no knowledge of the
global system reset.  Instead, a new bus/device level function is introduced
that allows all devices/buses on the bus/device to be reset using a depth
first transversal.

N.B. we have to expose the implicit system bus because we have various hacks
that result in an implicit system bus existing.  Instead, we ought to have an
explicitly created system bus that we can trigger reset from.  That's a topic
for a future patch though.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqbus: add functions to walk both devices and busses
Anthony Liguori [Fri, 19 Nov 2010 09:55:58 +0000 (18:55 +0900)]
qbus: add functions to walk both devices and busses

There are some cases where you want to walk the busses, in particular, when
searching for a bus either by name or DeviceInfo.
Paolo suggested that we model the return values on how GCC's walkers work which
allows an actor to skip child transversal, or terminate walking with a positive
value that's returned as the qbus_walk_children's result.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoeepro100: Use a single rom file for all i825xx devices
Stefan Weil [Fri, 15 Oct 2010 20:51:07 +0000 (22:51 +0200)]
eepro100: Use a single rom file for all i825xx devices

Patching the rom data during load (in qemu) now
also supports i82801 (which had no rom file).

We only need a single rom file for the whole device family,
so remove the second one which is no longer needed.

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: Automatically patch PCI vendor id and device id in PCI ROM
Stefan Weil [Tue, 19 Oct 2010 21:08:21 +0000 (23:08 +0200)]
pci: Automatically patch PCI vendor id and device id in PCI ROM

PCI devices with different vendor or device ids sometimes share
the same rom code. Only the ids and the checksum
differs in a boot rom for such devices.

The i825xx ethernet controller family is a typical example
which is implemented in hw/eepro100.c. It uses at least
3 different device ids, so normally 3 boot roms would be needed.

By automatically patching vendor id and device id (and the checksum)
in qemu, all emulated family members can share the same boot rom.

VGA bios roms are another example with different vendor and device ids.

Only qemu's built-in default rom files will be patched.

v2:
    * Patch also the vendor id (and remove the sanity check for vendor id).

v3:
    * Don't patch a rom file when its name was set by the user.
      Thus we avoid modifications of unknown rom data.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: Replace unneeded type casts in calls of pci_register_bar
Stefan Weil [Fri, 19 Nov 2010 18:29:07 +0000 (19:29 +0100)]
pci: Replace unneeded type casts in calls of pci_register_bar

There is no need for these type casts (as other existing
code shows). So re-write the first argument without
type cast (and remove a related TODO comment).

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie/port: fix bridge control register wmask
Isaku Yamahata [Fri, 19 Nov 2010 11:28:45 +0000 (13:28 +0200)]
pcie/port: fix bridge control register wmask

pci generic layer initialized wmask for bridge control register
according to pci spec. pcie deviates slightly from it,
so initialize it properly.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: fix bridge control bit wmask
Michael S. Tsirkin [Thu, 18 Nov 2010 08:42:50 +0000 (10:42 +0200)]
pci: fix bridge control bit wmask

Bits 12 to 15 in bridge control register are reserver and must be
read-only zero, curent mask is 0xffff which makes them writeable. Fix
this up by using symbolic bit names for writeable bits instead of a
hardcoded constant.

Fix a comment w1mask -> w1cmask as well.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agox3130/downstream: support aer.
Isaku Yamahata [Tue, 16 Nov 2010 08:26:12 +0000 (17:26 +0900)]
x3130/downstream: support aer.

add aer support.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agox3130/upstream: support aer
Isaku Yamahata [Tue, 16 Nov 2010 08:26:11 +0000 (17:26 +0900)]
x3130/upstream: support aer

add aer support.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoioh3420: support aer
Isaku Yamahata [Tue, 16 Nov 2010 08:26:10 +0000 (17:26 +0900)]
ioh3420: support aer

Add aer support.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie_aer: complete unwinding recursion
Michael S. Tsirkin [Wed, 17 Nov 2010 13:45:39 +0000 (15:45 +0200)]
pcie_aer: complete unwinding recursion

Open-code functions created in the previous patch,
to make code more compact and clear.
Detcted and documented what looks like a bug in code
that becomes apparent from this refactoring.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie_aer: get rid of recursion
Michael S. Tsirkin [Wed, 17 Nov 2010 13:02:26 +0000 (15:02 +0200)]
pcie_aer: get rid of recursion

Added some TODOs: they are trivial but omitted here
to make the patch logic as transparent as possible.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie/aer: helper functions for pcie aer capability
Isaku Yamahata [Tue, 16 Nov 2010 08:26:09 +0000 (17:26 +0900)]
pcie/aer: helper functions for pcie aer capability

This patch implements helper functions for pcie aer capability
which will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie_regs.h: more constants
Isaku Yamahata [Tue, 16 Nov 2010 08:26:08 +0000 (17:26 +0900)]
pcie_regs.h: more constants

Add constants for PCI AER log.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: add W1C bits to pci status register
Isaku Yamahata [Tue, 16 Nov 2010 08:26:07 +0000 (17:26 +0900)]
pci: add W1C bits to pci status register

This patch adds W1C bit support in the initialization/reset of pci
status registers.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agovirtio-pci: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:38 +0000 (20:44 +0000)]
virtio-pci: Convert fprintf() to error_report()

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio-net: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:37 +0000 (20:44 +0000)]
virtio-net: Convert fprintf() to error_report()

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:36 +0000 (20:44 +0000)]
virtio: Convert fprintf() to error_report()

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio-blk: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:35 +0000 (20:44 +0000)]
virtio-blk: Convert fprintf() to error_report()

Errors should be logged using error_report() so they go to the
appropriate monitor.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovgabios update: handle compatibility with older qemu versions
Gerd Hoffmann [Wed, 17 Nov 2010 11:06:44 +0000 (12:06 +0100)]
vgabios update: handle compatibility with older qemu versions

As pointed out by avi the vgabios update is guest-visible and thus has
migration implications.

One change is that the vga has a valid pci rom bar now.  We already have
a pci bus property to enable/disable the rom bar and we'll load the bios
via fw_cfg as fallback for the no-rom-bar case.  So we just have to add
compat properties to handle this case.

A second change is that the magic bochs lfb @ 0xe0000000 is gone.  When
live-migrating a guest from a older qemu version it might be using the
lfb though, so we have to keep it for the old machine types.  The patch
enables the bochs lfb in case we don't have the pci rom bar enabled
(i.e. we are in 0.13+older compat mode).

This patch depends on these patches which add (and use) the pc-0.13
machine type:
  http://patchwork.ozlabs.org/patch/70797/
  http://patchwork.ozlabs.org/patch/70798/

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: avi@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopcnet: Do not receive external frames in loopback mode
Jan Kiszka [Tue, 19 Oct 2010 15:03:24 +0000 (17:03 +0200)]
pcnet: Do not receive external frames in loopback mode

While not explicitly stated in the spec, it was observed on real systems
that enabling loopback testing on the pcnet controller disables
reception of external frames. And some legacy software relies on it, so
provide this behavior.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopiix4 acpi: convert io BAR to type-safe ioport callbacks
Avi Kivity [Wed, 17 Nov 2010 09:50:10 +0000 (11:50 +0200)]
piix4 acpi: convert io BAR to type-safe ioport callbacks

Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoType-safe ioport callbacks
Avi Kivity [Wed, 17 Nov 2010 09:50:09 +0000 (11:50 +0200)]
Type-safe ioport callbacks

The current ioport callbacks are not type-safe, in that they accept an "opaque"
pointer as an argument whose type must match the argument to the registration
function; this is not checked by the compiler.

This patch adds an alternative that is type-safe.  Instead of an opaque
argument, both registation and the callback use a new IOPort type.  The
callback then uses container_of() to access its main structures.

Currently the old and new methods exist side by side; once the old way is gone,
we can also save a bunch of memory since the new method requires one pointer
per ioport instead of 6.

Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agotrace: Trace vm_start()/vm_stop()
Stefan Hajnoczi [Tue, 16 Nov 2010 12:20:25 +0000 (12:20 +0000)]
trace: Trace vm_start()/vm_stop()

VM state change notifications are invoked from vm_start()/vm_stop().
Trace these state changes so we can reason about the state of the VM
from trace output.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtfs: enable MSI-X
Gerd Hoffmann [Thu, 11 Nov 2010 11:59:26 +0000 (12:59 +0100)]
virtfs: enable MSI-X

This patch enables MSI-X for virtfs-9p-pci.  It also adds a
compat property to pc-0.13 which turns it of there to stay
compatible to 0.13-stable.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopc: add 0.13 pc machine type
Gerd Hoffmann [Thu, 11 Nov 2010 11:59:25 +0000 (12:59 +0100)]
pc: add 0.13 pc machine type

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agotrace: Use fprintf_function (format checking)
Stefan Weil [Mon, 15 Nov 2010 20:17:06 +0000 (21:17 +0100)]
trace: Use fprintf_function (format checking)

fprintf_function adds format checking with GCC_FMT_ATTR.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoslirp: Remove unused code for bad sprintf
Stefan Weil [Mon, 15 Nov 2010 20:15:26 +0000 (21:15 +0100)]
slirp: Remove unused code for bad sprintf

Neither DECLARE_SPRINTF nor BAD_SPRINTF are needed for QEMU.

QEMU won't support systems with missing or bad declarations
for sprintf. The unused code was detected while looking for
functions with missing format checking. Instead of adding
GCC_FMT_ATTR, the unused code was removed.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopc: disable the BOCHS BIOS panic port
Bernhard Kohl [Tue, 16 Nov 2010 12:28:37 +0000 (13:28 +0100)]
pc: disable the BOCHS BIOS panic port

We have an OS which writes to port 0x400 when probing for special hardware.
This causes an exit of the VM. With SeaBIOS this port isn't used anyway.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-By: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agooptionrom: fix bugs in signrom.sh
Avi Kivity [Tue, 16 Nov 2010 14:33:17 +0000 (16:33 +0200)]
optionrom: fix bugs in signrom.sh

signrom.sh has multiple bugs:

- the last byte is considered when calculating the existing checksum, but not
  when computing the correction
- apprently the 'expr' expression overflows and produces incorrect results with
  larger roms
- if the checksum happened to be zero, we calculated the correction byte to be
  256

Instead of rewriting this in half a line of python, this patch fixes the bugs.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoMakefile: Fix check dependency breakage
Luiz Capitulino [Fri, 12 Nov 2010 14:55:46 +0000 (12:55 -0200)]
Makefile: Fix check dependency breakage

Commit b152aa84d52882bb1846485a89baf13aa07c86bc broke the unit-tests
build, fix it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoblock migration: do not submit multiple AIOs for same sector
Marcelo Tosatti [Mon, 8 Nov 2010 19:02:56 +0000 (17:02 -0200)]
block migration: do not submit multiple AIOs for same sector

Block migration can submit multiple AIO reads for the same sector/chunk, but
completion of such reads can happen out of order:

migration               guest
- get_dirty(N)
- aio_read(N)
- clear_dirty(N)
                        write(N)
                        set_dirty(N)
- get_dirty(N)
- aio_read(N)

If the first aio_read completes after the second, stale data will be
migrated to the destination.

Fix by not allowing multiple AIOs inflight for the same sector.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoblock: set sector dirty on AIO write completion
Marcelo Tosatti [Mon, 8 Nov 2010 19:02:55 +0000 (17:02 -0200)]
block: set sector dirty on AIO write completion

Sectors are marked dirty in the bitmap on AIO submission. This is wrong
since data has not reached storage.

Set a given sector as dirty in the dirty bitmap on AIO completion, so that
reading a sector marked as dirty is guaranteed to return uptodate data.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoblock: fix shift in dirty bitmap calculation
Marcelo Tosatti [Mon, 8 Nov 2010 19:02:54 +0000 (17:02 -0200)]
block: fix shift in dirty bitmap calculation

Otherwise upper 32 bits of bitmap entries are not correctly calculated.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd support for generating a systemtap tapset static probes
Daniel P. Berrange [Fri, 12 Nov 2010 13:20:25 +0000 (13:20 +0000)]
Add support for generating a systemtap tapset static probes

This introduces generation of a qemu.stp/qemu-system-XXX.stp
files which provides tapsets with friendly names for static
probes & their arguments. Instead of

    probe process("qemu").mark("qemu_malloc") {
        printf("Malloc %d %p\n", $arg1, $arg2);
    }

It is now possible todo

    probe qemu.system.i386.qemu_malloc {
        printf("Malloc %d %p\n", size, ptr);
    }

There is one tapset defined per target arch, for both
user and system emulators.

* Makefile.target: Generate stp files for each target
* tracetool: Support for generating systemtap tapsets
* configure: Check for whether systemtap is available
  with the DTrace backend

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd a DTrace tracing backend targetted for SystemTAP compatability
Daniel P. Berrange [Fri, 12 Nov 2010 13:20:24 +0000 (13:20 +0000)]
Add a DTrace tracing backend targetted for SystemTAP compatability

This introduces a new tracing backend that targets the SystemTAP
implementation of DTrace userspace tracing. The core functionality
should be applicable and standard across any DTrace implementation
on Solaris, OS-X, *BSD, but the Makefile rules will likely need
some small additional changes to cope with OS specific build
requirements.

This backend builds a little differently from the other tracing
backends. Specifically there is no 'trace.c' file, because the
'dtrace' command line tool generates a '.o' file directly from
the dtrace probe definition file. The probe definition is usually
named with a '.d' extension but QEMU uses '.d' files for its
external makefile dependancy tracking, so this uses '.dtrace' as
the extension for the probe definition file.

The 'tracetool' program gains the ability to generate a trace.h
file for DTrace, and also to generate the trace.d file containing
the dtrace probe definition.

Example usage of a dtrace probe in systemtap looks like:

  probe process("qemu").mark("qemu_malloc") {
    printf("Malloc %d %p\n", $arg1, $arg2);
  }

* .gitignore: Ignore trace-dtrace.*
* Makefile: Extra rules for generating DTrace files
* Makefile.obj: Don't build trace.o for DTrace, use
  trace-dtrace.o generated by 'dtrace' instead
* tracetool: Support for generating DTrace data files

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRevert "Add a DTrace tracing backend targetted for SystemTAP compatability"
Anthony Liguori [Thu, 18 Nov 2010 00:06:06 +0000 (18:06 -0600)]
Revert "Add a DTrace tracing backend targetted for SystemTAP compatability"

This reverts commit 4addb1127f6327c7ebcbd150a6b589e7677adc92.

13 years agoRevert "Add support for generating a systemtap tapset static probes"
Anthony Liguori [Thu, 18 Nov 2010 00:05:58 +0000 (18:05 -0600)]
Revert "Add support for generating a systemtap tapset static probes"

This reverts commit 2834c3e0140c3b0ed4422909dfa0607b7213d95d.

Conflicts:

Makefile.target

13 years agoaudio: Only use audio timer when necessary
malc [Thu, 18 Nov 2010 11:30:12 +0000 (14:30 +0300)]
audio: Only use audio timer when necessary

Originally proposed by Gerd Hoffmann.

Signed-off-by: malc <av1474@comtv.ru>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoMakefile: Fix check dependency breakage
Luiz Capitulino [Wed, 10 Nov 2010 17:59:57 +0000 (15:59 -0200)]
Makefile: Fix check dependency breakage

Commit b152aa84d52882bb1846485a89baf13aa07c86bc broke the unit-tests
build, fix it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agoQMP/qmp-shell: Introduce HMP mode
Luiz Capitulino [Thu, 28 Oct 2010 15:28:37 +0000 (13:28 -0200)]
QMP/qmp-shell: Introduce HMP mode

In which qmp-shell will exclusively use the HMP passthrough feature,
this is useful for testing.

Example:

    # ./qmp-shell -H qmp-sock
    Welcome to the HMP shell!
    Connected to QEMU 0.13.50

    (QEMU) info network
    VLAN 0 devices:
      user.0: net=10.0.2.0, restricted=n
        e1000.0: model=e1000,macaddr=52:54:00:12:34:56
        Devices not on any VLAN:
    (QEMU)

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agoQMP: Introduce Human Monitor passthrough command
Luiz Capitulino [Fri, 22 Oct 2010 12:08:02 +0000 (10:08 -0200)]
QMP: Introduce Human Monitor passthrough command

This command allows QMP clients to execute HMP commands.

Please, check the documentation added to the qmp-commands.hx file
for additional details about the interface and its limitations.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agoqemu-char: Introduce Memory driver
Luiz Capitulino [Fri, 22 Oct 2010 18:09:05 +0000 (16:09 -0200)]
qemu-char: Introduce Memory driver

This driver handles in-memory chardev operations. That's, all writes
to this driver are stored in an internal buffer and it doesn't talk
to the external world in any way.

Right now it's very simple: it supports only writes. But it can be
easily extended to support more operations.

This is going to be used by the monitor's "HMP passthrough via QMP"
feature, which needs to run monitor handlers without a backing
device.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agoQMP: Drop vm-info example script
Luiz Capitulino [Wed, 27 Oct 2010 20:03:01 +0000 (18:03 -0200)]
QMP: Drop vm-info example script

It's broken and not really useful, let's just drop it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agoQMP: Revamp the qmp-shell script
Luiz Capitulino [Wed, 27 Oct 2010 19:57:51 +0000 (17:57 -0200)]
QMP: Revamp the qmp-shell script

This commit updates the qmp-shell script to use the new interface
introduced by the last commit.

Additionally, the following fixes/features are also introduced:

 o TCP sockets support
 o Update/add documentation
 o Simple command-line completion
 o Fix a number of unhandled errors

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agoQMP: Revamp the Python class example
Luiz Capitulino [Wed, 27 Oct 2010 19:43:34 +0000 (17:43 -0200)]
QMP: Revamp the Python class example

This commit simplifies and fixes a number of problems in the Python
QEMUMonitorProtocol example class.

It's almost a rewrite and it DOES BREAK the qmp-shell script (which
is going to be fixed in the next commit).

However, I'm not going to split this in different commits because it
could get up to 10 commits, it's really not worth it for a simple
demo class.

Highlights:

 o TCP sockets support
 o QMP events support
 o Add documentation
 o Fix a number of unhandled errors
 o Simplify methods that send commands to the Monitor

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agopc: Fix e820 fw_cfg for big endian
Alex Williamson [Mon, 8 Nov 2010 03:57:00 +0000 (20:57 -0700)]
pc: Fix e820 fw_cfg for big endian

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopc: e820 qemu_cfg tables need to be packed
Alex Williamson [Fri, 5 Nov 2010 21:40:38 +0000 (15:40 -0600)]
pc: e820 qemu_cfg tables need to be packed

We can't let the compiler define the alignment for qemu_cfg data.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoFix compilation failure with simple trace when srcdir==objdir
Peter Maydell [Tue, 16 Nov 2010 20:07:07 +0000 (20:07 +0000)]
Fix compilation failure with simple trace when srcdir==objdir

Fix a makefile error that meant that qemu would not compile if
the source and object directories were the same.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoDelete IOHandlers after potentially running them
Stefan Hajnoczi [Wed, 3 Nov 2010 14:29:44 +0000 (14:29 +0000)]
Delete IOHandlers after potentially running them

Since commit 4bed9837309e58d208183f81d8344996744292cf an .fd_read()
handler that deletes its IOHandler is exposed to .fd_write() being
called on the deleted IOHandler.

This patch fixes deletion so that .fd_read() and .fd_write() are never
called on an IOHandler that is marked for deletion.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agousb-linux: Get the active configuration from sysfs rather then asking the dev
Hans de Goede [Wed, 10 Nov 2010 09:06:25 +0000 (10:06 +0100)]
usb-linux: Get the active configuration from sysfs rather then asking the dev

Some devices seem to choke on receiving a USB_REQ_GET_CONFIGURATION ctrl msg
(witnessed with a digital picture frame usb id 1908:1320).
When usb_fs_type == USB_FS_SYS, the active configuration can be read directly
from sysfs, which allows using this device through qemu's usb redirection.
More in general it seems a good idea to not send needless control msg's to
devices, esp. as the code in question is called every time a set_interface
is done. Which happens multiple times during virtual machine startup, and
when device drivers are activating the usb device.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agousb-linux: introduce a usb_linux_get_configuration function
Hans de Goede [Wed, 10 Nov 2010 09:06:24 +0000 (10:06 +0100)]
usb-linux: introduce a usb_linux_get_configuration function

The next patch in this series introduces multiple ways to get the
configuration dependent upon usb_fs_type, it is cleaner to put this
into its own function.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agousb-linux: Store devpath into USBHostDevice when usb_fs_type == USB_FS_SYS
Hans de Goede [Wed, 10 Nov 2010 09:06:23 +0000 (10:06 +0100)]
usb-linux: Store devpath into USBHostDevice when usb_fs_type == USB_FS_SYS

This allows us to recreate the sysfspath used during scanning later
(which will be used in a later patch in this series).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd missing braces
Jes Sorensen [Thu, 11 Nov 2010 15:10:04 +0000 (16:10 +0100)]
Add missing braces

This patch adds missing braces around if/else statements that call
macros which are likely to result in errors if the macro is
changed. It also makes the code comply better with CODING_STYLE.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoOut off array access in usb-net
Gleb Natapov [Tue, 9 Nov 2010 07:36:53 +0000 (09:36 +0200)]
Out off array access in usb-net

Properly check array bounds before accessing array element.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoMerge remote branch 'spice/bugfix.2' into staging
Anthony Liguori [Tue, 16 Nov 2010 20:11:05 +0000 (14:11 -0600)]
Merge remote branch 'spice/bugfix.2' into staging

13 years agoAdd support for generating a systemtap tapset static probes
Daniel P. Berrange [Mon, 8 Nov 2010 19:33:08 +0000 (19:33 +0000)]
Add support for generating a systemtap tapset static probes

This introduces generation of a qemu.stp/qemu-system-XXX.stp
files which provides tapsets with friendly names for static
probes & their arguments. Instead of

    probe process("qemu").mark("qemu_malloc") {
        printf("Malloc %d %p\n", $arg1, $arg2);
    }

It is now possible todo

    probe qemu.system.i386.qemu_malloc {
        printf("Malloc %d %p\n", size, ptr);
    }

There is one tapset defined per target arch.

* Makefile: Generate a qemu.stp file for systemtap
* tracetool: Support for generating systemtap tapsets

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd a DTrace tracing backend targetted for SystemTAP compatability
Daniel P. Berrange [Mon, 8 Nov 2010 19:33:07 +0000 (19:33 +0000)]
Add a DTrace tracing backend targetted for SystemTAP compatability

This introduces a new tracing backend that targets the SystemTAP
implementation of DTrace userspace tracing. The core functionality
should be applicable and standard across any DTrace implementation
on Solaris, OS-X, *BSD, but the Makefile rules will likely need
some small additional changes to cope with OS specific build
requirements.

This backend builds a little differently from the other tracing
backends. Specifically there is no 'trace.c' file, because the
'dtrace' command line tool generates a '.o' file directly from
the dtrace probe definition file. The probe definition is usually
named with a '.d' extension but QEMU uses '.d' files for its
external makefile dependancy tracking, so this uses '.dtrace' as
the extension for the probe definition file.

The 'tracetool' program gains the ability to generate a trace.h
file for DTrace, and also to generate the trace.d file containing
the dtrace probe definition.

Example usage of a dtrace probe in systemtap looks like:

  probe process("qemu").mark("qemu_malloc") {
    printf("Malloc %d %p\n", $arg1, $arg2);
  }

* .gitignore: Ignore trace-dtrace.*
* Makefile: Extra rules for generating DTrace files
* Makefile.obj: Don't build trace.o for DTrace, use
  trace-dtrace.o generated by 'dtrace' instead
* tracetool: Support for generating DTrace data files

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomultiboot: Prevent loading of x86_64 images
Adam Lackorzynski [Thu, 4 Nov 2010 22:22:15 +0000 (23:22 +0100)]
multiboot: Prevent loading of x86_64 images

A via -kernel supplied x86_64 ELF image is being started in 32bit mode.
Detect and exit if a 64bit image has been supplied.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoapic: Don't iterate past last used apic
Alex Williamson [Fri, 5 Nov 2010 22:01:29 +0000 (16:01 -0600)]
apic: Don't iterate past last used apic

local_apics are allocated sequentially and never removed, so
we can stop any iterations that go to MAX_APICS as soon as we
hit the first NULL.  Looking at a small guest running a virtio-net
workload with oprofile, this drops apic_get_delivery_bitmask()
from #3 in the profile to down in the noise.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopci: allow hotplug removal of cold-plugged devices
Michael S. Tsirkin [Fri, 12 Nov 2010 07:21:35 +0000 (16:21 +0900)]
pci: allow hotplug removal of cold-plugged devices

This patch fixes hot unplug of cold plugged devices
(those present at system start), which got broken by
5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 .

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Cam Macdonell <cam@cs.ualberta.ca>
Tested-by: Cam Macdonell <cam@cs.ualberta.ca>
Reported-by: Cam Macdonell <cam@cs.ualberta.ca>.
13 years agoPCI: Bus number from the bridge, not the device
Alex Williamson [Mon, 4 Oct 2010 21:53:11 +0000 (15:53 -0600)]
PCI: Bus number from the bridge, not the device

pcibus_dev_print() was erroneously retrieving the device bus
number from the secondary bus number offset of the device
instead of the bridge above the device.  This ends of landing
in the 2nd byte of the 3rd BAR for devices, which thankfully
is usually zero.

Note: pcibus_get_dev_path() copied this code,
inheriting the same bug.  pcibus_get_dev_path() is used for
ramblock naming, so changing it can effect migration.  However,
I've only seen this byte be non-zero for an assigned device,
which can't migrate anyway, so hopefully we won't run into
any issues.

This patch does not touch pcibus_get_dev_path, as
bus number is guest assigned for nested buses,
so using it for migration is broken anyway.
Fix it properly later.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>