sim-card
/
qemu
Archived
10
0
Fork 0
Commit Graph

4331 Commits

Author SHA1 Message Date
Stefan Hajnoczi 419e691f8e scsi-disk: Allow overriding SCSI INQUIRY removable bit
Provide the "removable" qdev property bit to override the SCSI INQUIRY
removable (RMB) bit for non-CDROM devices.  This will be used by USB
Mass Storage Devices, which sometimes have this guest-visible bit set
and sometimes do not.  They therefore requires a means for user
configuration.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24 21:39:20 +01:00
Stefan Weil 1635eecc41 ide: Remove unneeded null pointer check
With bm == NULL, other code in the same function would crash.

This bug was reported by cppcheck:
hw/ide/pci.c:280: error: Possible null pointer dereference: bm

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24 16:41:49 +01:00
Christoph Hellwig c641483fbe ide: kill ide_dma_submit_check
Merge ide_dma_submit_check into it's only caller.  Also use tail recursion
using a goto instead of a real recursion - this avoid overflowing the
stack in the pathological situation of an recurring error that is ignored.
We'll still be busy looping in ide_dma_cb, but at least won't eat up
all stack space after this.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24 11:08:51 +01:00
Christoph Hellwig 596bb44dea ide: also reset io_buffer_index for writes
Currenly the code only resets the io_buffer_index field for reads,
but the code seems to expect this for all types of I/O.  I guess
we simply don't hit large enough transfers that would require this
often enough.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24 11:08:51 +01:00
Christoph Hellwig cd369c4634 ide: factor dma handling helpers
Factor the DMA I/O path that is duplicated between read and write
commands, into common helpers using the s->is_read flag added for
the macio ATA controller.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24 11:08:50 +01:00
Kevin Wolf 0bfe006c53 multiboot: Fix upper memory size in multiboot info
The upper memory size field should exclude the first MB of RAM.

Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-23 22:44:13 +01:00
Blue Swirl 64b85a8f23 Delete useless 'extern' qualifiers for functions
'extern' qualifier is useless for function declarations. Delete
them.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-23 16:21:20 +00:00
Aurelien Jarno b947c12c0b Merge branch 'usb.4' of git://anongit.freedesktop.org/spice/qemu
* 'usb.4' of git://anongit.freedesktop.org/spice/qemu: (32 commits)
  usb: zap pdev from usbport
  usb: rewrite fw path, fix numbering
  usb: add port property.
  usb: keep track of physical port address.
  usb storage: handle long responses
  usb storage: fix status reporting
  usb storage: high speed support
  usb: add device qualifier support
  usb: add usb_desc_attach
  usb: add attach callback
  usb: add speed mask to ports
  usb: hid: change serial number to "42".
  usb: hid: remote wakeup support.
  usb: hub: remote wakeup support.
  usb: uhci: remote wakeup support.
  usb: add usb_wakeup() + wakeup callback to port ops
  usb: rework attach/detach workflow
  usb: create USBPortOps, move attach there.
  usb: move remote wakeup handling to common code
  usb: move USB_REQ_{GET,SET}_CONFIGURATION handling to common code
  ...
2011-01-21 17:56:50 +01:00
Aurelien Jarno 543c4c94cf sm501: fix screen redraw
Due to signed/unsigned comparison, the dirty bits are never reset, and
the screen redrawn each time. Fix that by only using ram_addr_t types,
and looking for page_min != addr_max instead.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-21 17:56:32 +01:00
Aurelien Jarno 8e5977e5f5 gt64xxx: set isa_mem_base during registration
isa_mem_base is computed from registers during reset, but due to QEMU
limitations some devices (e.g. VGA card) need to know it earlier when
they are registered.

Workaround this by setting the value during registration instead of
reset.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 21:40:53 +01:00
Peter Maydell 730986e494 hw/pl190.c: Fix writing of default vector address
The PL190 implementation keeps the default vector address
in vect_addr[16], but we weren't using this for writes to
the DEFVECTADDR register. As a result of this fix the
default_addr structure member is unused and we can delete it.

Reported-by: Himanshu Chauhan <hschauhan@nulltrace.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 17:20:18 +01:00
Anthony Liguori 5dbbda3405 Merge remote branch 'mst/for_anthony' into staging 2011-01-20 09:05:37 -06:00
Isaku Yamahata e10990c3f0 pci: use qemu_malloc() in pcibus_get_dev_path()
use qemu_malloc() instead of direct use of malloc().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20 15:44:25 +02:00
Isaku Yamahata e407bf13ba msix: simplify write config
use pci_device_deassert_intx().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20 15:33:34 +02:00
Isaku Yamahata 59369b0816 msi: simplify write config a bit.
use pci_device_deassert_intx().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20 15:33:18 +02:00
Isaku Yamahata 4c92325b51 pci: deassert intx on reset.
deassert intx on device reset.
So far pci_device_reset() is used for system reset.
In that case, interrupt controller is reset at the same time so that
all irq is are deasserted.
But now pci bus reset/flr is supported, and in that case irq needs to be
disabled explicitly.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20 15:33:05 +02:00
Dmitry Eremin-Solenikov b2bf03a90c pxa2xx_lcd: restore updating of display
Recently PXA2xx lcd have stopped to be updated incrementally (picture
frozen). This patch fixes that by passing non min/max x/y, but rather
(correctly) x/y and w/h.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Dmitry Eremin-Solenikov f69866ea32 pxa2xx: fix vmstate_pxa2xx_i2c
vmstate_pxa2xx_i2c incorrectly recursed to itself instead of going
to store slave device. Fix that stop stop qemu from segfaulting
during savevm for pxa2xx-based devices.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Dmitry Eremin-Solenikov aa9438d9f8 scoop: fix access to registers from second instance
Second instance of scoop contains registers shifted to 0x40 from the start
of the page. Instead of messing with register mapping, just limit register
address to 0x00..0x3f.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Dmitry Eremin-Solenikov f75d216a80 mainstone: fix name of the allocated memory for roms
Mainstone board has two flash chips (emulated by two ram regions), however
currently code tries to allocate them with the same name, which fails.
Fix that to make mainstone emulation work again.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell 3ac59434c7 stc91c111: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell ff1758533c pl080: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell 8c60d0652e pl110: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell 0dc5595c2c pl031: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell d6ac172a84 pl050: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell b5ad0ae767 arm_sysctl: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell a796d0acbb vpb_sic: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Peter Maydell ac49d75001 pl190: Implement save/restore
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Aurelien Jarno c2dd2a2352 gt64xxx: qdev conversion
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Aurelien Jarno cf154394bd sh_pci: qdev conversion
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:21 +01:00
Aurelien Jarno b7d2b02093 sh_serial: process all received characters
When operating on the SCIF, process all the received characters, as long
as the FIFO can handle them.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:20 +01:00
Aurelien Jarno b7277ac289 sh_serial: remove one level of indirection
The indirection functions are empty since commit
8da3ff1809.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:20 +01:00
Aurelien Jarno 373dfc441d usb-hid: modifiers should generate an event
When a modifier key is pressed or released, the USB HID keyboard still
answers NAK, unless another key is also pressed or released.

The patch fixes that by calling usb_hid_changed() when a modifier key
is pressed or released.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20 12:37:20 +01:00
Michael S. Tsirkin 2991181aaa pci: fix device paths
Patch a6a7005d14 generated
broken device paths. We snprintf with a length shorter
than the output, so the last character is discarded and replaced
by the null byte. Fix it up by snprintf to a buffer
which is larger by 1 byte and then memcpy the data (without
the null byte) to where we need it.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-19 21:18:19 +02:00
Edgar E. Iglesias e027e1f075 mips: Expire late timers when reading cp0_count
When reading cp0_count from a timer with a late trigger that should
already have expired, expire it and raise the timer irq.

This makes it possible for guest code (e.g, Linux) that first read
cp0_count, then compare it with cp0_compare and check for raised
timer interrupt lines to run reliably.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-18 12:28:32 +01:00
Edgar E. Iglesias b1dfe6437c mips: Break out cpu_mips_timer_expire
Reorganize for future patches, no functional change.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-18 12:27:52 +01:00
Aurelien Jarno 07d8a50cb0 sm501: add 2D engine copyrect support
Linux kernel started to use the SM501 2D engine for the console, and
especially the copyrect operation.

Implement this operation so that recent kernels can be used with QEMU.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-17 19:29:48 +01:00
Anthony Liguori 9e8a69cfd6 Merge remote branch 'mst/for_anthony' into staging 2011-01-17 09:49:38 -06:00
Marcelo Tosatti 668643b025 acpi_piix4: expose no_hotplug attribute via i/o port
Expose no_hotplug attribute via I/O port, so ACPI BIOS can indicate
removability status to guest OS.

An updated seabios is required to make use of this feature (seabios.git
commit ID 3c241edf3d7ef29c21).

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Tested-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-17 17:30:40 +02:00
Hervé Poussineau 51f9b84e75 m48t59: Fix a wrong opaque passed to nvram read and write routines
This fixes boot on PPC prep.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-16 22:15:58 +01:00
Michael Tokarev a8fb7ff3fd USB keyboard emulation key mapping error
The USB keyboard emulation's translation table in hw/usb-hid.c doesn't
match the codes actually sent for the Logo (a.k.a. "Windows") or Menu
keys. This results in the guest OS not being able to receive these keys
at all when the USB keyboard emulation is being used.

In particular, both the keymap in /usr/share/kvm/keymaps/modifiers and
the evdev table in x_keymap.c map these keys to 0xdb, 0xdc, and 0xdd,
while usb_hid_usage_keys[] seems to be expecting them to be mapped to
0x7d, 0x7e, and 0x7f.

The attached patch seems to fix the problem, at least in my (limited)
testing.

http://bugs.debian.org/578846
http://bugs.debian.org/600593 (cloned from the above against different pkg)
https://bugs.launchpad.net/qemu/+bug/584139

Signed-Off-By: Brad Jorsch <anomie@users.sourceforge.net>
Signed-Off-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-16 19:52:48 +01:00
Aurelien Jarno 3bd4be3ada lsi53c895a: fix endianness issues
lsi_ram_read*() and lsi_ram_write*() are not consistent, one uses
leXX_to_cpu() the other uses nothing. As the comment above the RAM
declaration says: "Script ram is stored as 32-bit words in host
byteorder.", remove the leXX_to_cpu() calls.

This fixes the boot of an ARM versatile machine on MIPS and PowerPC
hosts.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-14 20:39:18 +01:00
Aurelien Jarno d30df5cec9 mips/malta: fix board id
Board id can't be written with stl_phys() as it's read-only part of
memory. Use stl_p() on the memory buffer instead.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-14 20:39:18 +01:00
Aurelien Jarno 4f6493ff8a target-sh4: fix reset on r2d
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-14 20:39:18 +01:00
Blue Swirl 4508d81a78 ppc405_uc: fix a buffer overflow
Fix a buffer overflow, reported by cppcheck:
[/src/qemu/hw/ppc405_uc.c:72]: (error) Buffer access out-of-bounds: bd.bi_s_version

The use of field bi_s_version seems to be a typo, it should be
bi_r_version.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 21:12:31 +00:00
Blue Swirl c46a3ea025 lan9118: fix a buffer overflow
Fix a buffer overflow, reported by cppcheck:
[/src/qemu/hw/lan9118.c:849]: (error) Buffer access out-of-bounds: s.eeprom

All eeprom handling code assumes that the size of eeprom is 128,
except lan9118_eeprom_cmd. Fix this by restricting the address passed.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 21:00:01 +00:00
Blue Swirl cedf9a6f45 loader: fix a file descriptor leak
Fix a file descriptor leak, reported by cppcheck:
[/src/qemu/hw/loader.c:311]: (error) Resource leak: fd

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12 19:48:57 +00:00
Amit Shah a01a9cb821 virtio-serial-bus: bump up control vq size to 32
The current default of 16 buffers for the control vq is too small.  We
can get more entries in there, for example when asking the guest to add
max. allowed ports.

Note: a more robust solution would involve some kind of event queueing
in host to guarantee no event loss. Added a TODO to look into
this later.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-12 17:55:30 +02:00
Gerd Hoffmann ace1318b8e usb: zap pdev from usbport
It isn't needed any more.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-12 11:40:04 +01:00
Gerd Hoffmann 70d31cb22c usb: rewrite fw path, fix numbering
This patch rewrites the firmware path code to use the physical port
location tracking just added to the qemu usb core.  It also fixes the
port numbering to start with "1" in the firmware path.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-12 11:37:26 +01:00