Commit graph

6197 commits

Author SHA1 Message Date
Peter Maydell 217bfb445b hw/arm_gic.c: Ignore attempts to complete nonexistent IRQs
Ignore attempts to complete non-existent IRQs; this fixes a buffer
overrun if the guest writes a bad value to the GICC_EOIR register.
(This case is UNPREDICTABLE so ignoring it is a valid choice.)
Note that doing nothing if the guest writes 1023 to this register
is not in fact a change in behaviour: the old code would also
always do nothing in this case but in a non-obvious way.
(The buffer overrun was noted by Coverity, see bug 887883.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-05 21:38:56 +01:00
David Gibson 81584fd50d pseries: Fix array overrun bug in PCI code
spapr_populate_pci_devices() containd a loop with PCI_NUM_REGIONS (7)
iterations.  However this overruns the 'bars' global array, which only has
6 elements. In fact we only want to run this loop for things listed in the
bars array, so this patch corrects the loop bounds to reflect that.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-05 21:38:50 +01:00
Peter Chubb 4abc7ebf5f Fix hw_error messages from arm_timer.c
Two of the calls to hw_error() in arm_timer.c contain the wrong function name.

As suggested by Andreas Färber, use the C99 standard __func__ macro to
get the correct name, instead of putting the name directly into the code.

Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-05 21:38:41 +01:00
Anthony Liguori eb5d5beaeb Merge remote-tracking branch 'kwolf/for-anthony' into staging 2011-12-05 09:39:25 -06:00
Anthony Liguori f6480ca3f3 Merge remote-tracking branch 'aneesh/1.0-fixes' into staging 2011-12-05 09:37:49 -06:00
Anthony Liguori cac1e30af7 Merge remote-tracking branch 'stefanha/trivial-patches' into staging 2011-12-05 08:44:33 -06:00
Anthony Liguori 01e7a53aed Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging 2011-12-05 08:43:38 -06:00
Stefan Hajnoczi 922453bca6 block: convert qemu_aio_flush() calls to bdrv_drain_all()
Many places in QEMU call qemu_aio_flush() to complete all pending
asynchronous I/O.  Most of these places actually want to drain all block
requests but there is no block layer API to do so.

This patch introduces the bdrv_drain_all() API to wait for requests
across all BlockDriverStates to complete.  As a bonus we perform checks
after qemu_aio_wait() to ensure that requests really have finished.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05 14:56:06 +01:00
Paolo Bonzini 4e5b184d63 xen_disk: remove dead code
Xen_disk.c has support for using synchronous I/O instead of asynchronous,
but it is compiled out by default.  Remove it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05 14:51:34 +01:00
Aneesh Kumar K.V 8b88827222 hw/9pfs: Use the correct file descriptor in Fsdriver Callback
Fsdriver callback that operate on file descriptor need to
differentiate between directory fd and file fd.

Based on the original patch from Sassan Panahinejad <sassan@sassan.me.uk>

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-04 22:35:28 +05:30
Aneesh Kumar K.V 8798d6c98e hw/9pfs: Add qdev.reset callback for virtio-9p-pci device
Add the device reset callback

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-04 22:35:28 +05:30
Deepak C Shetty b41e2992b2 hw/9pfs: Reset server state during TVERSION
As per the 9p rfc, during TVERSION its necessary to clean all the active
fids, so that we start the session from a clean state. Its also needed in
scenarios where the guest is booting off 9p, and boot fails, and client
restarts, without any knowledge of the past, it will issue a TVERSION again
so this ensures that we always start from a clean state.

Signed-off-by: Deepak C Shetty <deepakcs@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-04 22:35:28 +05:30
Aneesh Kumar K.V e9a0152ba1 hw/9pfs: use migration blockers to prevent live migration when virtfs export path is mounted
Now when you try to migrate with VirtFS export path mounted, you get a proper QMP error:

(qemu) migrate tcp:localhost:4444
Migration is disabled when VirtFS export path '/tmp/' is mounted in the guest using mount_tag 'v_tmp'
(qemu)

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-04 22:35:28 +05:30
Aneesh Kumar K.V 77eec1b3f1 hw/9pfs: Improve portability to older systems
handle fs driver require a set of newly added syscalls. Don't
Compile handle FS driver if those syscalls are not available.
Instead of adding #ifdef for all those syscalls we check for
open by handle syscall. If that is available then rest of the
syscalls used by the driver should be available.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-04 22:35:27 +05:30
Markus Armbruster 66d3f1962d qxl: Don't convert from size_t to int and back in qxl_cursor()
Just for cleanliness; it would take a truly gigantic cursor to break.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-12-02 10:50:56 +00:00
Hervé Poussineau d180589621 sonic: fix typo
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-12-02 10:50:56 +00:00
Markus Armbruster 7e62255a4b ccid: Fix buffer overrun in handling of VSC_ATR message
ATR size exceeding the limit is diagnosed, but then we merrily use it
anyway, overrunning card->atr[].

The message is read from a character device.  Obvious security
implications unless the other end of the character device is trusted.

Spotted by Coverity.  CVE-2011-4111.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28 16:20:53 -06:00
Aneesh Kumar K.V 2507718baf 9pfs: improve portability to older systems
I guess we can also make sure we don't  call local_ioc_getversion at
all.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28 16:19:57 -06:00
Stefan Weil c16ada980f eepro100: Fix alignment requirement for statistical counters
According to Intel's Open Source Software Developer Manual,
the dump counters address must be Dword aligned.

The new code enforces this alignment, so s->statsaddr may now
be used with stw_le_pci_dma() and stl_le_pci_dma().

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28 11:36:34 -06:00
Paolo Bonzini ad0c93328d virtio: add and use virtio_set_features
vdev->guest_features is not masking features that are not supported by
the guest.  Fix this by introducing a common wrapper to be used by all
virtio bus implementations.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28 11:36:28 -06:00
Paolo Bonzini ae0f940e6b 9pfs: improve portability to older systems
Small requirements on "new" features have percolated to virtio-9p-local.c.
In particular, the utimensat wrapper actually only supports dirfd = AT_FDCWD
and flags = AT_SYMLINK_NOFOLLOW in the fallback code.  Remove the arguments
so that virtio-9p-local.c will not use AT_* constants.

At the same time, fail local_ioc_getversion if the ioctl is not supported
by the host.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28 11:36:27 -06:00
Anthony Liguori 13bd0b5026 Merge remote-tracking branch 'kwolf/block-stable' into staging 2011-11-28 11:15:10 -06:00
Anthony Liguori f04303743a Merge remote-tracking branch 'kraxel/usb.32' into staging 2011-11-28 11:12:39 -06:00
Avi Kivity f44336c594 omap_l4: rename omap_l4_attach_region() to omap_l4_attach()
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:40:49 +02:00
Avi Kivity a6dbd3c836 omap_l4: remove omap_l4_attach()
No longer used.

Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:47 +02:00
Benoît Canet 7487813909 omap_i2c: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:47 +02:00
Benoît Canet 30af1ec729 omap_lcdc: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:47 +02:00
Benoît Canet 1a0726900e omap_spi: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:47 +02:00
Benoît Canet ba1580299d omap_sx1: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:46 +02:00
Benoît Canet 3892f842c9 omap_l4: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:46 +02:00
Avi Kivity 4852e5d8c3 omap_dss: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:45 +02:00
Avi Kivity 011a98a15b omap2: convert to memory API (part II)
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:45 +02:00
Avi Kivity 9bac7d6c15 omap2: convert to memory API (part I)
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:45 +02:00
Avi Kivity 750ecd444f sysbus: rename sysbus_init_mmio_region() to sysbus_init_mmio()
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:45 +02:00
Avi Kivity 3f7f1c8067 sysbus: remove sysbus_init_mmio()
No longer used - replaced by sysbus_init_mmio_region().

Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:43 +02:00
Benoît Canet 9a542a4821 bonito: convert cop to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:43 +02:00
Benoît Canet def344a6ea bonito: convert ldma to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:43 +02:00
Benoît Canet 845cbeb8e3 bonito: convert south bridge pci config to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:43 +02:00
Benoît Canet 183e1d40db bonito: convert north bridge pci config to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:43 +02:00
Benoît Canet 89200979aa bonito: convert north bridge register mapping to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:43 +02:00
Benoît Canet 0aa27efa93 lm32_sys: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:43 +02:00
Benoît Canet 5f2be17af1 lm32_uart: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:42 +02:00
Benoît Canet 663d94467a mcf_intc: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:42 +02:00
Benoît Canet c65fc1dff3 mcf_fec: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:42 +02:00
Benoît Canet aa6e4986b8 mcf_uart: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:42 +02:00
Benoît Canet 653fa85c9a mcf5206: convert to memory API
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:42 +02:00
Avi Kivity 9244b42dea omap_gpio: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:41 +02:00
Avi Kivity 7405165e26 omap_dma: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:41 +02:00
Avi Kivity 6a0148e7b5 omap_sdrc: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:41 +02:00
Avi Kivity 9832b74c14 omap_gp_timer: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-28 15:38:41 +02:00