Commit Graph

3579 Commits

Author SHA1 Message Date
Blue Swirl 9678d9501b Remove dead assignments in various common files, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 18:35:52 +00:00
Blue Swirl d4c4e6fdc7 usb: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 18:23:04 +00:00
Blue Swirl 7300c07991 bt: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 18:20:28 +00:00
Blue Swirl 4aa720f717 Fix harmless if statement with empty body, spotted by clang
This clang error is harmless but worth fixing:
  CC    libhw32/rc4030.o
/src/qemu/hw/rc4030.c:244:66: error: if statement has empty body [-Wempty-body]
        DPRINTF("read 0x%02x at " TARGET_FMT_plx "\n", val, addr);

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-23 19:22:12 +00:00
Bruce Rogers 3cc128bb1e Remove un-needed code
The bdrv_set_geometry_hint call below is not needed - it's just setting
what was just read.

Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-04-23 16:21:57 +02:00
Kevin Wolf d6e9098e10 Replace calls of old bdrv_open
What is known today as bdrv_open2 becomes the new bdrv_open. All remaining
callers of the old function are converted to the new one. In some places they
even know the right format, so they should have used bdrv_open2 from the
beginning.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-04-23 16:08:46 +02:00
Kevin Wolf 25920d6ad6 Make qemu-config available for tools
To be able to use config files for blkdebug, we need to make these functions
available in the tools. This involves moving two functions that can only be
built in the context of the emulator.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-04-23 16:08:45 +02:00
Andrzej Zaborowski a6e4b14388 bt-sdp: Fix an excessive ; and assignment of the wrong variable
Problem-spotted-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
2010-04-22 03:55:46 +02:00
Blue Swirl 7b1df88f28 bt-l2cap: fix if statement with empty body, spotted by clang
Fix clang error:
  CC    bt-l2cap.o
/src/qemu/hw/bt-l2cap.c:1000:41: error: if statement has empty body
[-Wempty-body]
            /* TODO: Signal an error? */;

This means that l2cap_sframe_in() may now get called.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
2010-04-22 03:41:24 +02:00
Isaku Yamahata 470e63633f pci: fix pci_find_bus().
When looking down child bus, it should look parent bridge's
bus number, not child bus's.
Optimized tail recursion and style fix.

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-20 17:15:41 +00:00
M. Mohan Kumar d6fa4b77fb Check for invalid initrd file
When qemu is invoked with an invalid initrd file, it crashes. Following
patch prints a error message and exits if an invalid initrd is
specified. Includes changes suggested by JV.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-19 00:07:10 +02:00
Kevin Wolf 908bb9497b virtio-blk: Fix use after free in error case
virtio_blk_req_complete frees the request, so we can't access it any more when
calling bdrv_mon_event. Use the pointer that was copied earlier.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18 23:55:19 +02:00
Markus Armbruster e17ba87c52 error: Use QERR_INVALID_PARAMETER_VALUE instead of QERR_INVALID_PARAMETER
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18 23:46:48 +02:00
Markus Armbruster c389c43ee5 error: Drop extra messages after qemu_opts_set() and qemu_opts_parse()
Both functions report errors nicely enough now, no need for additional
messages.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18 23:46:48 +02:00
Markus Armbruster 17a38eaa2f monitor: convert do_device_del() to QObject, QError
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18 23:46:48 +02:00
Markus Armbruster cc601cb785 qdev: Convert qdev_unplug() to QError
Note: our device unplug methods don't need conversion work, because
they can't currently fail.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18 23:46:48 +02:00
Blue Swirl 6ad6135dca Fix harmless if statements with empty body, spotted by clang
These clang errors are harmless but worth fixing:
  CC    ppc-softmmu/usb-ohci.o
/src/qemu/hw/usb-ohci.c:1104:59: error: if statement has empty body [-Wempty-body]
                          ohci->ctrl_head, ohci->ctrl_cur);
/src/qemu/hw/usb-ohci.c:1371:57: error: if statement has empty body [-Wempty-body]
        DPRINTF("usb-ohci: port %d: SUSPEND\n", portnum);
  CC    sparc64-softmmu/translate.o
/src/qemu/target-sparc/translate.c:3173:37: error: if statement has empty body [-Wempty-body]
                                    ; // XXX

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-18 14:22:14 +00:00
Artyom Tarasenko 676d9b9b88 sparc32 use empty_slot for missing RAM v1
use empty_slot device for the RAM which is not installed

Models without ECC don't trap when missing ram is accessed.

v0->v1 compile only once and fix indentation

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-18 08:55:20 +00:00
Artyom Tarasenko da9fcfa544 create empty_slot device
The empty_slot device emulates known to a bus but not connected devices.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-18 08:55:12 +00:00
Blue Swirl 3c83eb4f17 Fix harmless if statements with empty body, spotted by clang
These clang errors are harmless but worth fixing:
  CC    libhw64/fdc.o
/src/qemu/hw/fdc.c:998:74: error: if statement has empty body [-Wempty-body]
        FLOPPY_DPRINTF("Floppy digital input register: 0x%02x\n", retval);
  CC    libhw64/cuda.o
/src/qemu/hw/cuda.c:320:66: error: if statement has empty body [-Wempty-body]
        CUDA_DPRINTF("read: reg=0x%x val=%02x\n", (int)addr, val);

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-18 08:46:35 +00:00
Anthony Liguori bf3de7f16f Merge remote branch 'mst/for_anthony' into staging 2010-04-13 20:59:12 -05:00
Marcelo Tosatti 11078ae37f vhost.c: include <linux/vhost.h> last
So the userspace headers define KERNEL_STRICT_NAMES and there's no
conflict on type definition for older kernels.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-14 00:12:04 +02:00
Michael S. Tsirkin 5751995a20 vhost-net: disable mergeable buffers
vhost in current kernels doesn't support mergeable buffers.
Disable this feature if vhost is enabled, until such
support is implemented.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-13 23:59:49 +02:00
David L Stevens dc14a39781 vhost: fix features ack
vhost driver in qemu didn't ack features, and this happens
to work because we don't really require any features. However,
it's better not to rely on this. This patch passes features to
vhost as guest acks them.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-13 23:58:20 +02:00
Aurelien Jarno 5ba9e9522c sh_pci: fix memory and I/O access
Since commit 8da3ff1809 ("MMIO callback
interface changes"), the addresses passed to the I/O functions are an
offset to the start of the area. As a consequence, there is no need to
correct the address using the value of IOBR. This make possible the use
of the default MMIO functions. Moreover the addresses are now remaped
when the value if IOBR change.

The memory area corresponds to the devices behing the PCI bus, it should
not be mapped by the PCI controller. Remove the corresponding code.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-13 20:17:24 +02:00
Aurelien Jarno 612b2bd0ac r2d: always enable IDE and flash
IDE and flash are part of the R2D board, and can't be removed. Emulate
them even if there is no hard-drive plugged to the IDE or if the flash
content is empty.
2010-04-13 20:17:24 +02:00
Aurelien Jarno 73f190352d hw/r2d: add initrd support
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-11 19:20:32 +02:00
Marcelo Tosatti 15a2cb7b70 vhost.c: include <linux/vhost.h> last
So the userspace headers define KERNEL_STRICT_NAMES and there's no
conflict on type definition for older kernels.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-11 20:16:28 +03:00
Michael S. Tsirkin c6b35ac4c4 vhost-net: disable mergeable buffers
vhost in current kernels doesn't support mergeable buffers.
Disable this feature if vhost is enabled, until such
support is implemented.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-11 20:15:55 +03:00
David L Stevens af4c828e70 vhost: fix features ack
vhost driver in qemu didn't ack features, and this happens
to work because we don't really require any features. However,
it's better not to rely on this. This patch passes features to
vhost as guest acks them.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-11 20:15:48 +03:00
Michael S. Tsirkin 8bbd1ce236 eepro100: convert to new capability API
Using new pci_add_capability_at_offset makes
eepro100 code cleaner.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
2010-04-11 19:37:33 +03:00
Michael S. Tsirkin 1db5a3aad3 pci: add API to add capability at a known offset
Unlike virtio, device emulations need to add pci capabilities
at known offsets to match real hardware. Make this possible
by adding an appropriate API.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-11 19:37:28 +03:00
Aurelien Jarno 56839a19e8 hw/r2d: add flash memory
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-11 03:58:19 +02:00
Alexander Graf baf0b55a9e Implement virtio reset
The guest may issue a RESET command for virtio. So far we didn't bother
to implement it, but with my new bootloader we actually need it for Linux
to get back to a safe state.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 22:06:22 +02:00
Gerd Hoffmann 6ac08101f9 lsi: fix segfault in lsi_command_complete
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 21:52:01 +02:00
Paolo Bonzini 37b76cfd93 move targphys.h and hw/poison.h inclusion to cpu-common.h
With more files from outside the hw/ directory being placed into
libhw, avoid the need to include hw/hw.h for the sake of targ_phys_addr_t.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 18:55:55 +02:00
Paolo Bonzini fbe3288df6 move two variable declarations out of vl.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-09 18:55:54 +02:00
Adam Lackorzynski 0534163f5b Debugcon: Fix debugging printf
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:44:38 +02:00
Thomas Monjalon 98835fe30f e1000: fix build on Ubuntu with _FORTIFY_SOURCE
There was a pointer cast warning on Ubuntu since _FORTIFY_SOURCE has been reenabled.

_FORTIFY_SOURCE had been disabled by 4a24470497
and reenabled by 849583050d.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:32:31 +02:00
Lars Munch 14da561698 smc91c111: allow access to reserved register
Some drivers seems to access the reserved register in bank 0 so allow and
ignore these accesses.

Signed-off-by: Lars Munch <lars@segv.dk>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:24:34 +02:00
Lars Munch 3b4b86aace smc91c111: mask register offset
this fixes the smc91c111 emulation which has been broken for gumstix and
mainstone and maybe others since the "MMIO callback interface changes"
8da3ff1809 was commited.

Signed-off-by: Lars Munch <lars@segv.dk>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:22:43 +02:00
Samuel Thibault 2c7faf318d baum: add destroy hook
Add a destroy hook for the baum character device, to properly close the BrlAPI
connection.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 21:17:10 +02:00
Gerd Hoffmann af92284bec update bochs vbe interface
The bochs vbe interface got a new register a while back, which specifies
the linear framebuffer size in 64k units.  This patch adds support for
the new register to qemu.  With this patch applied vgabios 0.6c works
with qemu.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 11:11:21 +02:00
Stefan Weil f62719ca6f eepro100: fix PCI interrupt pin configuration regression
Commit 15e89f5916
removed this setting, but it is still needed.

Without this patch, e100 device drivers using
interrupts don't work with qemu.

See other nic emulations which also set the
PCI interrupt pin.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-07 10:58:00 +03:00
Stefan Weil 269eba0771 eepro100: fix mapping of flash memory
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-07 10:58:00 +03:00
Stefan Weil ae543b498c eepro100: Set power management capability using pci_reserve_capability
pci_add_capability automatically updates PCI status and
PCI capability pointer, so use it. Use pci_reserve_capability
to make the new capability appear at the correct offset.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-07 10:58:00 +03:00
Stefan Weil 3dec59a1fb eepro100: Set configuration bit for standard TCB
For some devices, this bit is always set.
For the others, it is set by default.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:32:30 +03:00
Stefan Weil db667a1205 eepro100: Add new device variant i82801
This ethernet device is used in Toshiba Tecra 8200 notebooks.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:32:28 +03:00
Stefan Weil 558c86345a eepro100: Simplified device instantiation
By using a private device info structure
(as suggested by Gerd Hoffmann), handling of the
different device variants becomes much easier.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:32:26 +03:00
Stefan Weil 75f5a6cccd eepro100: Simplify status handling
Includes a minor STATUS_NOT_OK -> 0 tweak.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:25:18 +03:00
Stefan Weil e74818f3cd eepro100: Don't allow writing SCBStatus
SCBStatus is readonly, but most drivers which were derived
from the old Linux eepro100.c do a word write to this address
when they want to acknowledge interrupts.

So we have to mask these writes here.

The patch also removes old unused code for status read / write.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:22:46 +03:00
Paul Brook 61d3cf93e2 OHCI qdev conversion
Convert remaining OHCI devices to QDEV interface.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-04-05 19:57:40 +01:00
Paul Brook 983fe82611 ARMv7-M reset fixes
Move ARMv7-M PC/SP initialization to the CPU reset routine.  Add a board
reset routine to call this.  Also load values directly from ROM as
images have not been copied yet.

Avoid clearing the NVIC pointer on cpu reset.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-04-05 19:43:12 +01:00
Paul Brook 5bd2c0d7a6 UHCI spurious interrut fix
Only raise an interrupt if the TD has actually completed.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-04-04 21:48:31 +01:00
Paul Brook a67ba3b6f8 Revert "Compile usb-ohci only once"
This reverts commit f1698408f1.

PCI is always little-endian. Having a user-visible "be" property is just
plain wrong.
2010-04-04 21:18:26 +01:00
Blue Swirl 93c5a32f89 sparc32: add IOMMU chipset doc links
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-03 07:40:47 +00:00
Blue Swirl 240566908f sparc32: rename iommu.c to sun4m_iommu.c to make room for other IOMMUs
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-03 07:35:50 +00:00
Blue Swirl 68fb89a2c0 sparc32: improve timer implementation
Timer with zero period (free-run) will never match.

Timer counting starts with tick value of 0x200, not from 0,
so the period must calculated from one tick less than the limit.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-03 06:17:35 +00:00
Aurelien Jarno 9caa3ec1e9 hw/r2d: add a USB keyboard
The R2D board does not have a PS/2 port, and only support a keyboard on
the USB bus.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-02 12:16:04 +02:00
TeLeMan 98f22dc172 usb-bus: fix no params
After commit 702f3e0fb5, the params is
nerver NULL. It should check *params instead of params to determine
whether the params is empty.

Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-02 12:12:17 +02:00
Stefan Weil 2b3af99984 win32: Fix compiler errors from u_int64_t
u_int64_t raises compiler error messages:

  CC    libhw32/virtio.o
/qemu/ar7/hw/virtio.c: In function ‘virtio_queue_get_avail_size’:
/qemu/ar7/hw/virtio.c:776: error: ‘u_int64_t’ undeclared (first use in this function)
/qemu/ar7/hw/virtio.c:776: error: (Each undeclared identifier is reported only once
/qemu/ar7/hw/virtio.c:776: error: for each function it appears in.)

Replacing u_int64_t by uint64_t helps.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 17:01:02 -05:00
Michael S. Tsirkin 9bc6304c15 virtio-net: vhost net support
This connects virtio-net to vhost net backend.
The code is structured in a way analogous to what we have with vnet
header capability in tap.

We start/stop backend on driver start/stop as
well as on save and vm start (for migration).

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin d59700553e vhost: vhost net support
This adds vhost net device support in qemu. Will be tied to tap device
and virtio by following patches.  Raw backend is currently missing,
will be worked on/submitted separately.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin ade80dc845 virtio-pci: fill in notifier support
Support host/guest notifiers in virtio-pci.
The last one only with kvm, that's okay
because vhost relies on kvm anyway.

Note on kvm usage: kvm ioeventfd API
is implemented on non-kvm systems as well,
this is the reason we don't need if (kvm_enabled())
around it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin 2be24aaafe virtio: move typedef to qemu-common
make it possible to use type without header include,
simplifying header dependencies.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin 3e607cb503 virtio: add set_status callback
vhost net backend needs to be notified when
frontend status changes. Add a callback,
similar to set_features.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin 1cbdabe203 virtio: notifier support + APIs for queue fields
vhost needs physical addresses for ring and other queue fields,
so add APIs for these. In particular, add binding API to set
host/guest notifiers.  Will be used by vhost.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin 2292b33986 notifier: event notifier implementation
event notifiers are slightly generalized eventfd descriptors. Current
implementation depends on eventfd because vhost is the only user, and
vhost depends on eventfd anyway, but a stub is provided for non-eventfd
case.

We'll be able to further generalize this when another user comes along
and we see how to best do this.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Anthony Liguori b33612d035 Fix -enable-kvm
Make vl.o compiled per target and fix a thinko in hw/acpi.c.  It's not trivial
to make kvm.h consumable by compiled-once files.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 09:58:48 -05:00
Alexander Graf c81131db15 Don't check for bus master for old guests
Older Linux guests don't activate the bus master enable bit. So for those we
can just try to be clever and track if they set the DEVICE_OK bit even though
bus mastering is still disabled.

Under that condition we can disable the windows safety check. With that logic
in place both guests should work just fine. Without PCI hotplug breaks
virtio-net in Linux < 2.6.34 guests.

Signed-off-by: Alexander Graf <agraf@suse.de>
CC: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-31 11:16:52 -05:00
Max Reitz f3571b1a5b usb: class specific interface requests
Mass Storage Reset and Get Max LUN are class specific requests, but
they were not marked as such in hw/usb-msd.c, moved therefore
ClassInterfaceRequest and ClassInterfaceOutRequest from hw/usb-net.c
to hw/usb.h.
Furthermore there was a problem in hw/usb-ohci.c when using DEBUG
concerning systems where size_t is a 32 bit integer (printf resulted
in a segmentation fault).

Signed-off-by: Max Reitz <max@tyndur.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-31 11:16:52 -05:00
Blue Swirl 2b5eb37123 Compile most PPC devices only once
Make byte swapping unconditional since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-30 17:36:23 +00:00
Blue Swirl add85a76bb Compile prep_pci only once
Make byte swapping unconditional since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:24:04 +00:00
Blue Swirl 5c4532ee78 Compile openpic only once
Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional
since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:59 +00:00
Blue Swirl 02c7c992f0 Compile ide/macio only once
Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional
since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:57 +00:00
Blue Swirl 3d08ff698b Compile pflash_cfi01 only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:56 +00:00
Blue Swirl 5f9fc5ad7e Compile pflash_cfi02 only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:55 +00:00
Blue Swirl 53b67b3052 Compile acpi only once
Use qemu_irqs to trigger CMOS S3 and SMI events.

Avoid using kvm.h, which uses CPUState.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:52 +00:00
Blue Swirl d745bef890 Move KVM and Xen global flags to vl.c
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:49 +00:00
Blue Swirl f8be67ee14 pflash_cfi02: fix incorrect TARGET_FMT_lx/d use
Also use target_phys_addr_t for addresses.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 18:24:35 +00:00
Markus Armbruster 9f59b566a6 error: Trim includes after "Move qemu_error & friends..."
Missed in commit 2f792016.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-27 14:30:36 +01:00
Adam Litke bd12ff9df7 balloon: Fix overflow when reporting actual memory size
Beginning with its introduction, the virtio balloon has had an overflow error
that causes 'info balloon' to misreport the actual memory size when the balloon
itself becomes larger than 4G.  Use a cast when converting dev->actual from
pages to kB to prevent overflows.

Before:
(qemu) info balloon
balloon: actual=5120
(qemu) balloon 1025
(qemu) info balloon
balloon: actual=1025
(qemu) balloon 1024
(qemu) info balloon
balloon: actual=5120

After:
(qemu) info balloon
balloon: actual=5120
(qemu) balloon 1025
(qemu) info balloon
balloon: actual=1025
(qemu) balloon 1024
(qemu) info balloon
balloon: actual=1024

Signed-off-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-27 13:53:34 +01:00
Blue Swirl b970ea8f8d Compile some MIPS devices only once
Move CPU specific declarations to a separate file.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 07:26:16 +00:00
Blue Swirl 6450a334c4 Fix build
Actually some systems don't define PAGE_SIZE. Fixes build breakage
by f7736b91c4.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 06:58:53 +00:00
Blue Swirl f7736b91c4 Compile ide/core only once
Make win2k install hack unconditional as it is still restricted to
x86 only in vl.c.

Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 06:20:53 +00:00
Lars Munch 6725f3fa1d Fix recent pxa270 serial breakage
This fixes a copy/paste bug introduced in commit
2d48377a85 that pushed TARGET_WORDS_BIGENDIAN
dependency to board level.

Signed-off-by: Lars Munch <lars@segv.dk>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-23 19:26:45 +00:00
Aurelien Jarno 4dcf7d87d9 pci_host: fix breakage
This has been broken by commit 952760bb7b

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-23 09:59:54 +01:00
Blue Swirl c9a43af9af Fix Sparc64 build
952760bb7b missed one change.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 20:37:50 +00:00
Blue Swirl 952760bb7b Compile pci_host only once
Convert pci_host_conf_register_mmio_noswap(x) to
pci_host_conf_register_mmio(x, 0).

Convert pci_host_conf_register_mmio(x) to
pci_host_conf_register_mmio(x, 1) for big endian hosts, all cases
happen to be BE.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 19:47:15 +00:00
Blue Swirl f1698408f1 Compile usb-ohci only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 19:47:12 +00:00
Blue Swirl 2d48377a85 Compile serial only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 19:47:11 +00:00
Blue Swirl 84108e128e Compile isa_mmio only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 19:47:09 +00:00
Blue Swirl aa28b9bf9b Move x86 specific PC declarations to a separate file
x86 definitions (especially CPUState uses) prevent many files from
being compiled within libhw.

Move x86 specific declarations (APIC stuff) to a separate file.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 19:46:26 +00:00
Anthony Liguori 28695489e3 Revert "Convert atexit users to exit_notifier"
This reverts commit d7234f4d7e.

Conflicts:

	hw/xen_machine_pv.c

This should have never been committed.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-21 14:13:02 -05:00
Blue Swirl 8ec68b06bd Fix a typo
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 12:30:46 +00:00
Blue Swirl bafd20cec9 Fix a typo which broke Xen build
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-20 08:55:06 +00:00
Anthony Liguori d7234f4d7e Convert atexit users to exit_notifier
All of these users have global state so we really don't see a benefit from
exit_notifier.  However, using exit_notifier means that there's one less
justification for having global state in the first place.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:38 -05:00
Anthony Liguori 6fef28ee6e Rewrite mouse handlers to use QTAILQ and to have an activation function
And convert usb-hid to use it (to avoid regression with bisection)

Right now, when we do info mice and we've added a usb tablet, we don't see it
until the guest starts using the tablet.  We implement this behavior in order
to provide a means to delay registration of a mouse handler since we treat
the last registered handler as the current handler.

This is a usability problem though as we would like to give the user feedback
that they've either 1) not added an absolute device 2) there is an absolute
device but the guest isn't using it 3) we have an absolute device and it's
active.

By using QTAILQ and having an explicit activation function that moves the
handler to the front of the queue, we can implement the same semantics as
before with respect to automatically switching to usb tablet while providing
the user with a whole lot more information.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:38 -05:00
Blue Swirl 43dc2a645e Replace assert(0) with abort() or cpu_abort()
When building with -DNDEBUG, assert(0) will not stop execution
so it must not be used for abnormal termination.

Use cpu_abort() when in CPU context, abort() otherwise.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-18 18:41:57 +00:00
Arnaud Patard (Rtp) e5322f76a7 hw/usb-msd: fix some usb requests
The usb-msd device emulation needs some small tweaks in the requests
emulations. For instance, the reset/maxlun requests are class/interface
specific so requests for them with the type class and recipient interface
bits sets have to be handled.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17 11:17:05 -05:00