Commit Graph

16356 Commits

Author SHA1 Message Date
Peter Maydell 46c305ef6b hw/sysbus: Add sysbus_mmio_get_region()
Add a sysbus_mmio_get_region() which allows users of sysbus
devices to turn a (SysBusDevice*, mmioidx) tuple into a
MemoryRegion*. This enables some useful simplifications of
devices which pass through another device's mmio region
(either directly or by implementing some kind of memory
controller device).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-28 16:22:17 +00:00
Avi Kivity 73c92f9aec sh_pci: Fix sh_pci memory alias confusion
The a7 area was set up as an alias of itself, rather than the p4 area.  This
sent the memory core into infinite recursion.

Fix by aliasing the a7 area to the p4 area.

Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-28 18:34:39 +03:00
Artyom Tarasenko 9f94778c16 Fix disabling interrupts in sun4u
clear interrupt request if the interrupt priority < CPU pil
clear hardware interrupt request if interrupts are disabled

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
[blauwirbel@gmail.com: added a comment about magic 2]
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-28 11:38:13 +00:00
Edgar E. Iglesias 010f3f5fbd xilinx: Convert most xilinx devices to MemoryRegion
This converts ethlite, intc, timer and uartlite to use
MemoryRegions.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-28 09:56:49 +02:00
Blue Swirl fe0de7aa5e TCG: improve optimizer debugging
Use enum TCGOpcode instead of plain old int so that the name of
current op can be seen in GDB. Add a default case to switch
so that GCC does not complain about unhandled enum cases.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-28 07:17:27 +00:00
Blue Swirl e5b34f3779 dyngen-exec.h: cleanup
Remove unused or otherwise available stuff.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-28 07:17:08 +00:00
Hervé Poussineau 97a3f6ffbb g364fb: convert to qdev
Extract G364 ROM contents from device emulation to machine emulation,
so device emulation can be reused in other machines (Commodore Amiga)

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-27 17:03:30 +00:00
Hervé Poussineau b213b37072 g364fb: use trace framework
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-27 17:03:23 +00:00
Pavel Borzenkov 01c4330b58 checkpatch: fix braces {} handling
checkpatch.pl doesn't report warning for if/else statements with missing
'else' braces:

if (something) {
    foo;
} else
    bar;

The patch has been tested using the last 100 commits.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-27 15:44:16 +00:00
Gerd Hoffmann 8733f6093c Fix linker scripts
Remove PROVIDE_HIDDEN and ONLY_IF_{RO,RW} from linker scripts to make
them work with older binutils versions.  Fixes *-bsd-user build on
OpenBSD 4.9 which ships binutils 2.15.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-27 15:42:35 +00:00
Brad 0fc6b5828f Fix build on OpenBSD with BSD userland emu and smartcard NSS enabled
The first issue is the hard coded POSIX Real Time extensions library in the
libcacard/Makefile. From looking at the code it doesn't seem this is necessary
anyway. Robert Relyea seems to think it most likely isn't necessary.

The second issue was the missing exclusion of the BSD userland binary
builds from the addition of this Makefile target for the smartcard NSS
code which breaks the builds if smartcard NSS support is enabled.

pastebin clip of the build failure..

http://pastebin.com/raw.php?i=BLCKd3s6

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-27 15:42:02 +00:00
Christoph Hellwig c488c7f649 block: latency accounting
Account the total latency for read/write/flush requests.  This allows
management tools to average it based on a snapshot of the nr ops
counters and allow checking for SLAs or provide statistics.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-08-26 18:18:38 +02:00
Michael S. Tsirkin b0b3db7955 vhost-net: cleanup host notifiers at last step
When the vhost notifier is disabled, the userspace handler runs
immediately: virtio_pci_set_host_notifier_internal might
call virtio_queue_notify_vq.
Since the VQ state and the tap backend state aren't
recovered yet, this causes
"Guest moved used index from XXX to YYY" assertions.

The solution is to split out host notifier handling
from vhost VQ setup and disable notifiers as our last step
when we stop vhost-net. For symmetry enable them first thing
on start.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-08-26 11:25:25 +03:00
Edgar E. Iglesias cb9c626888 linux-user: Correct a few missuses of host addresses
Fix a few cases where we were passing host pointers to the
guest.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-26 07:59:33 +02:00
Avi Kivity 75f5941cb5 memory: add opaque parameter to memory_region_init_rom_device()
The MemoryRegionOps callbacks expect it.

Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-26 00:35:15 +03:00
Edgar E. Iglesias 8a84fc6bf7 microblaze: Add an MSR_PVR constant and use it.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-08-25 22:44:25 +02:00
Edgar E. Iglesias 97b833c5df microblaze: Make the MSR PVR bit non writable
Instead of hardcoding it to 1.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-08-25 22:44:25 +02:00
Anthony Liguori 01e0451a08 Revert "Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging"
This reverts commit 8ef9ea85a2, reversing
changes made to 444dc48298.

From Avi:

  Please revert the entire pull (git revert 8ef9ea85a2) while I work this
  out - it isn't trivial.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-25 14:39:18 -05:00
Jan Kiszka f065aa0a00 vga: Silence bogus gcc warning about uninitialized variables
Some gcc versions do not properly detect that all possible cases are
covered and base and size are always initialized. Please gcc by defining
a pseudo default case.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-25 13:56:54 -05:00
Christoph Hellwig a597e79ce1 block: explicit I/O accounting
Decouple the I/O accounting from bdrv_aio_readv/writev/flush and
make the hardware models call directly into the accounting helpers.

This means:
 - we do not count internal requests from image formats in addition
   to guest originating I/O
 - we do not double count I/O ops if the device model handles it
   chunk wise
 - we only account I/O once it actuall is done
 - can extent I/O accounting to synchronous or coroutine I/O easily
 - implement I/O latency tracking easily (see the next patch)

I've conveted the existing device model callers to the new model,
device models that are using synchronous I/O and weren't accounted
before haven't been updated yet.  Also scsi hasn't been converted
to the end-to-end accounting as I want to defer that after the pending
scsi layer overhaul.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-08-25 18:18:42 +02:00
Jamie Iles 860341f605 monitor: fix build breakage for !CONFIG_VNC
Commit c62f6d1 (monitor: fix build breakage with --disable-vnc)
conditionalised some VNC setup code but left an unused variable.  Move
the variable into the conditional code to fix the build breakage.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-08-25 12:40:07 -03:00
Aneesh Kumar K.V b9cb88b056 hw/9pfs: mark directories also as un-reclaimable on unlink
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-25 20:16:42 +05:30
Aneesh Kumar K.V 95f65511c3 hw/9pfs: Add directory reclaim support
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-25 20:16:42 +05:30
Aneesh Kumar K.V 9b54ffaab2 hw/9pfs: Use v9fs_do_close instead of close
we should use the local abstraction instead of
directly calling close.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-25 20:16:42 +05:30
Aneesh Kumar K.V 9e5b2247ea hw/9pfs: init fid list properly
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-25 20:16:41 +05:30
Aneesh Kumar K.V 7a46274529 hw/9pfs: Add file descriptor reclaim support
[M. Mohan Kumar <mohan@in.ibm.com> removed some unused variables]

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-25 20:16:41 +05:30
Aneesh Kumar K.V 84dfb926e5 hw/9pfs: Add reference counting for fid
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-08-25 20:16:41 +05:30
Frediano Ziglio 2f4b759367 qcow2: remove unused qcow2_create_refcount_update function
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-08-25 15:23:10 +02:00
Frediano Ziglio 35ee5e39c5 qcow2: use always stderr for debugging
let all DEBUG_ALLOC2 printf goes to stderr

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-08-25 15:22:25 +02:00
Anthony Liguori 56a7a874e9 Merge remote-tracking branch 'stefanha/trivial-patches' into staging 2011-08-25 07:50:07 -05:00
Anthony Liguori 8ef9ea85a2 Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging 2011-08-25 07:48:24 -05:00
Anthony Liguori 444dc48298 Merge remote-tracking branch 'aneesh/for-upstream-2' into staging 2011-08-25 07:48:15 -05:00
Avi Kivity 7bc2b9cd4d memory: fix memory_region_init_rom_device() not initializing ->ops
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 14:56:14 +03:00
Frediano Ziglio e99722f66a disasm: update comment
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-08-25 09:21:48 +01:00
Jan Kiszka fdc9c41a5a Fix up some style nits of last uq/master merge
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-08-25 09:21:35 +01:00
Avi Kivity 2b90ca040c milkymist: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:34 +03:00
Avi Kivity fcb9fc24c4 milkymist-softusb: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:34 +03:00
Avi Kivity 906d23eb0d milkymist-minimac2: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:34 +03:00
Avi Kivity e33df454e5 mcf5208: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:34 +03:00
Avi Kivity 09730e296b mainstone: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:34 +03:00
Avi Kivity 4c9e975d64 lm32_boards: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity 82afb3a707 g364fb: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity 9eadff4a94 dummy_m68k: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity c8a50e596c pflash_cfi01/pflash_cfi02: convert to memory API
cfi02 is annoying in that is ignores some address bits; we probably
want explicit support in the memory API for that.

Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity a1807ef295 Makefile.hw: allow hw/ files to include glib headers
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity c2c1b0f84b piix_pci: wrap memory update in a transaction
The code will remap all PAMs, even if just one is updated, resulting
in reduced performance.  Wrap in a transaction to detect that those
other PAMs have not changed.

Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity cf9182e229 cirrus: wrap memory update in a transaction
This prevents spurious unmapping and remapping of the vga windows,
which reduces performance.

Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity 20e5758b08 leon3: convert to memory API
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity b3cc496255 integratorcp: convert to memory API (RAM/flash only)
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00
Avi Kivity 28e7796459 sysbus: add sysbus_add_memory_overlap()
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-25 10:56:33 +03:00