mainstone: convert FPGA emulation code to use QDev/SysBus
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
mainstone: correct and simplify irq handling
Simplify IRQ handling to stop setting an input irq pin. As a win, also getcorrect IRQ status after save/load cycle.
correctly check ppr priority during interrupt injection]
TPR blocks all interrupts in a priority class, so simple "less orequal" check is not enough.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmmouse: fix queue_size field initialization
Initialize the field queue_size, dropped by91c9e09147ba1f3604a3d5d29b4de7702082a33f.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hpet: make optional
Ignore failure with hpet device creation.
sysbus: add creation function that may fail
x86: make vmmouse optional
Compile vmmouse in hwlib. Ignore failure if vmmouse device can't becreated.
isa: add creation function that may fail
vmmouse: convert to qdev
Convert to qdev, also add a proper reset function.
vmport: convert to qdev
x86,MIPS: make vmware_vga optional
Allow failure with vmware_vga device creation and use standardVGA instead.
pci: add creation functions that may fail
qdev: add creation function that may fail
vmware_vga: refactor device creation
Turn vmsvga_init into an inline function.
mst_fpga: Drop one more pxa.h inclusion.
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
max7310: finish qdev'ication
1) Move GPIO-related functionality to qdev. Now one can use directlyqdev_get_gpio_in()/qdev_connect_gpio_out() on max7310 devices.
2) Make reset to be called through qdev.reset callback.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>...
pxa2xx: convert i2c master to use qdev/vmsd
Add scoop post_load callback that sets IRQs to loaded levels
Drop unnecessary inclusions of pxa.h header
Seceral files contained onnecessary dependencies on hw/pxa.h header.Drop unused references.
mainstone: pass one irq to the mst_fpga instead of the whole PIC
tosa: we aren't connected to VBus, pass this info to Linux kernel
tc6393xb: correct NAND isr assertion
sysbus: print number of irqs in dev_print
blockdev: add refcount to DriveInfo
The host part of a block device can be deleted with in progressblock migration.
To fix this, add a reference count to DriveInfo, freeing resourceson last reference.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>...
ahci: make number of ports runtime determined
Different AHCI controllers have a different number of ports, so the coreshouldn't care about the amount of ports available.
This patch makes the number of ports available to the AHCI core runtimeconfigurable, allowing us to have multiple different AHCI implementations...
ahci: Implement HBA reset
The ahci code was missing its soft reset functionality. This wasn't really anissue for Linux guests, but Windows gets confused when the controller doesn'treset when it tells it so.
Using this patch I can now successfully boot Windows 7 from AHCI using AHCI...
ahci: send init d2h fis on fis enable
The drive sends a d2h init fis on initialization. Usually, the guest doesn'treceive fises yet at that point though, so the delivery is deferred.
Let's reflect that by sending the init fis on fis receive enablement....
ahci: split ICH and AHCI even more
Sebastian's patch already did a pretty good job at splitting up ICH-9AHCI code and the AHCI core. We need some more though. Copyright was missing,the lspci dump belongs to ICH-9, we don't need the AHCI core to have its...
ahci: add license header in ahci.h
Due to popular request, this patch adds a license header to ahci.h
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ahci: split ICH9 from core
There are multiple ahci devices out there. The currently implemented ich-9is only one of the many. So let's split that one out into a separate fileto stress the difference.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>Signed-off-by: Alexander Graf <agraf@suse.de>...
virtio-serial: Make sure virtqueue is ready before discarding data
This can happen if a port gets unplugged before guest has chance toinitialise vqs.
Reported-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ioapic: Implement EOI handling for level-triggered IRQs
Add the missing EOI broadcast from local APIC to the IOAPICs oncompletion of level-triggered IRQs. This ensures that a still assertedIRQ source properly re-triggers an APIC IRQ.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
ioapic: Save/restore irr
This is a guest modifiable state that must be saved/restored properly.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ioapic: Add support for qemu-kvm's vmstate v2
qemu-kvm carries the IOAPIC base address in its v2 vmstate. We onlysupport the default base address so far, and saving even that in thedevice state was rejected.
Add a padding field to be able to read qemu-kvm's old state, but...
ioapic: Style & magics cleanup
Fix a few style issues and convert magic numbers into prober symbolicconstants, also fixing the wrong but unused IOAPIC_DM_SIPI value.
Add bootindex handling into usb storage device.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vhost: force vhost off for non-MSI guests
When MSI is off, each interrupt needs to be bounced through the iothread when it's set/cleared, so vhost-net causes more context switches andhigher CPU utilization than userspace virtio which handles networking in...
Merge remote branch 'spice/spice.v29.pull' into staging
Conflicts: trace-events
Merge remote branch 'spice/usb.5' into staging
Merge remote branch 'amit/for-anthony' into staging
hw/slavio_intctl.c: fix gcc warning about array bounds overrun
The Ubuntu 10.10 gcc for ARM complains that we might be overrunningthe cpu_irqs[][] array: silence this by correcting the bounds on theloop. (In fact we would not have overrun the array because bit...
SPARC: Fix Leon3 cache control
The "leon3_cache_control_int" (op_helper.c) function is called within leon3.cwhich leads to segfault error with the global "env".
Now cache control is a CPU feature and everything is handled in op_helper.c.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>...
Merge remote branch 'mst/for_anthony' into staging
blockdev: Fix drive_add for drives without media
Watch this:
(qemu) drive_add 0 if=none (qemu) info block none0: type=hd removable=0 [not inserted] (qemu) drive_del none0 Segmentation fault (core dumped)
add_init_drive() is confused about drive_init()'s failure modes, and...
blockdev: Make drive_add() take explicit type, index parameters
Before, type & index were hidden in printf-like fmt, ... parameters,which get expanded into an option string. Rather inconvenient foruses later in this series.
New IF_DEFAULT to ask for the machine's default interface. Before,...
blockdev: Fix regression in -drive if=scsi,index=N
Before commit 622b520f, index=12 meant bus=1,unit=5.
Since the commit, it means bus=0,unit=12. The drive is created, butnot the guest device. That's because the controllers we use withif=scsi drives (lsi53c895a and esp) support only 7 units, and...
blockdev: New drive_get_next(), replacing qdev_init_bdrv()
qdev_init_bdrv() doesn't belong into qdev.c; it's about drives, notqdevs. Rename to drive_get_next, move to blockdev.c, drop the bogusDeviceState argument, and return DriveInfo instead ofBlockDriverState....
block: tell drivers about an image resize
Extend the change_cb callback with a reason argument, and use itto tell drivers about size changes.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: tell the guest about size changes
Raise a config change interrupt when the size changed. This allowsvirtio-blk guest drivers to read-read the information from theconfig space once it got the config chaged interrupt.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
ahci: Fix cpu_physical_memory_unmap() argument ordering
The len and is_write arguments to cpu_physical_memory_unmap() wereswapped. This patch changes calls to use the correct argument ordering.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
scsi hotplug: Set DriveInfo member bus correctly
drive_init() picks the first free bus and unit number, unless the userspecifies them.
This isn't a good fit for the drive_add monitor command, because therewe specify the controller by PCI address instead of using bus number...
prep: Disable second IDE channel, as long as ISA IDE emulation doesn't support same irq for both channels
Cc: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
prep: Remove bogus BIOS size check
r3480 added this check to account for the entry vector 0xfff00100 to beavailable for CPUs that need it. Today however, the NIP is not yetinitialized at this point (zero), so the check always triggers.
Moreover, BIOS size check is already done previously, so this part can...
mc146818rtc: update registers after a format change
For some unknown reason, the MIPS kernel briefly changes the RTC tobinary mode during boot, switch back to BCD mode and read the time. Asthe registers are updated only every second, they may still be in the...
mc146818rtc: constantify
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
virtio-blk: fix cross-endianness targets
virtio-blk doesn't work on cross-endian configuration, as endianness isnot handled correctly.
This patch adds missing endianness conversions to make virtio-blkworking. Tested on the following configurations:- i386 guest on x86_64 host...
virtio-net: fix cross-endianness support
virtio-net used to work on cross-endianness configurations, but doesn'tanymore with recent guest kernels, as the new features don't handleendianness correctly.
This patch fixes wrong conversion, and add missing ones to make...
escc: fix interrupt flags
Recent PowerPC kernel end up in kernel panic during boot in -nographicmode. In this mode the second serial port is used as the udbg console,and thus a few characters are sent on this port. This activates thetx interrupt flag, and later choke the Linux kernel, as it was not...
pxa2xx_gpio: switch to using qdev
As noted by Markus Armbruster pxa2xx_gpio vmstate version bumpedbecause of a change in the or .ilevel / .olevel arrays are saved,for convenience.
spitz: make spitz-keyboard to use qdev infrastructure
spitz: make sl-nand emulation use qdev infrastructure
Switch sl-nand emulation to use qdev and vmstate. Also drop ecc_get/_putfunctions as sl-nand was the only user of that code.
Use vmstate to save/load spitz-lcdtg and corgi-ssp state
SharpSL scoop device - convert to qdev
Convert SharpSL scoop device to qdev, remove lots of supporting code, aslot of init and gpio related things can now be done automagically.
pci: typo in pcibus_get_dev_path()
This patch fixes typo in pcibus_get_dev_path().Without this patch, the result of pcibus_get_dev_path() isn't unique.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: bridge control fixup
PCI_BRIDGE_CTL_DISCARD_STATUS (bit 10 in bridge control register)is W1C so we should not make it writeable, otherwise the assert(!(wmask& w1cmask)) in pci_default_write_config() is hit
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
sh4: implement missing mmaped TLB write functions
sh4: implement missing mmaped TLB read functions
etrax: Dont decrease the granularity of timers
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
mips_fulong: remove bogus HAS_AUDIO
remove bogus HAS_AUDIO according to 738012bec4c67e697e766edadab3f522c552a04d.
Cc: Blue Swirl <blauwirbel@gmail.com>Cc: Huacai Chen <zltjiangshi@gmail.com>Cc: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
audio: consolidate audio_init()
consolidate audio_init() and remove references to shoundhw.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Merge remote branch 'kwolf/for-anthony' into staging
SPARC: Emulation of GRLIB IRQMP
This device exposes two parameters: - set_pil_in (ptr) : A function to set the pil_in of the SPARC CPU - set_pil_in_opaque (ptr) : Opaque argument of the set_pil_in function
Emulation of GrLib devices is base on the GRLIB IP Core User's Manual:...
SPARC: Emulation of GRLIB APB UART
This device exposes one parameter: - chardev (ptr) : Pointer to a qemu character device
Emulation of GrLib devices is base on the GRLIB IP Core User's Manual:http://www.gaisler.com/products/grlib/grip.pdf
SPARC: Emulation of Leon3
Leon3 is an open-source VHDL System-On-Chip, well known in space industry (moreinformation on http://www.gaisler.com).
Leon3 is made of multiple components available in the GrLib VHDL library.Three devices are implemented: uart, timers and IRQ manager....
SPARC: Emulation of GRLIB GPTimer
This device exposes three parameters: - frequency (uint32) : The system frequency - irq-line (uint32) : IRQ line number for the first timer (others use irq-line + 1, irq-line + 2...) - nr-timers (uint32) : Number of timers...
scsi: Allow scsi_bus_legacy_add_drive() to set removable bit
scsi-disk devices may wish to override the removable bit. Add supportfor a qdev property on SCSI devices. This is will be used by usb-msd.
usb-msd: Propagate removable bit to SCSI device
USB Mass Storage Devices sometimes have the RMB (removable) bit set inthe SCSI INQUIRY response. Thumbdrives tend to have the bit set whereashard disks do not.
Operating systems differentiate between removable devices and fixed...
scsi-disk: Allow overriding SCSI INQUIRY removable bit
Provide the "removable" qdev property bit to override the SCSI INQUIRYremovable (RMB) bit for non-CDROM devices. This will be used by USBMass Storage Devices, which sometimes have this guest-visible bit set...
usb-bus: use snprintf
Avoid this warning from OpenBSD linker: LINK i386-softmmu/qemu../usb-bus.o(.text+0x27c): In function `usb_get_fw_dev_path':/src/qemu/hw/usb-bus.c:294: warning: sprintf() is often misused,please use snprintf()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>...
add event queueing to USB HID
The polling nature of the USB HID device makes it very hard to doubleclick or drag while on a high-latency VNC connection. This patch,based on work done in the Xen qemu-dm tree by Ian Jackson, fixes thisbug by adding an event queue to the device. The event queue associates...
usb keyboard: add event event queue
This patch adds a event queue to the usb keyboard. This makes sure theguest will see all key events even if they come in bursts. With thispatch applied sending Ctrl-Alt-Del using vncviewer's F8 menu works.Also with autosuspend enabled the first keypress on a suspended keyboard...
usb hid: move head+n to common struct
This patch moves the 'head' and 'n' fields from USBMouseState andUSBKeyboardState to the common USBHIDState struct.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb core: add migration support
Yes, seriously. There is no migration support at all for usb devices.They loose state, especially the device address, and stop respondingbecause of that. Oops.
Luckily there is so much broken usb hardware out there that the guest...
usb hub: add migration support
usb hid: add migration support
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>...
qxl: locking fix
One spice worker call lacks the unlock/relock calls,which may lead to deadlocks, add them.
spice/qxl: zap spice 0.4 migration compatibility bits
Live migration from and to spice 0.4 qxl devices isn't going to work.Rip out the bits which attempt to support that. Zap the subsectionlogic which is obsolete now. Bumb the version to make a clean cut....
pci: memory leak of PCIDevice::rom_file
PCIDevice::rom_file is leaked.PCIDevice::rom_file is allocated in pci_qdev_init(), but not freed anywhere.free it in qemu_unregister_device().
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 guesswe simply don't hit large enough transfers that would require thisoften enough....
ide: kill ide_dma_submit_check
Merge ide_dma_submit_check into it's only caller. Also use tail recursionusing a goto instead of a real recursion - this avoid overflowing thestack 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...
ide: factor dma handling helpers
Factor the DMA I/O path that is duplicated between read and writecommands, into common helpers using the s->is_read flag added forthe macio ATA controller.
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>
Delete useless 'extern' qualifiers for functions
'extern' qualifier is useless for function declarations. Deletethem.
Merge branch 'usb.4' of git://anongit.freedesktop.org/spice/qemu
sm501: fix screen redraw
Due to signed/unsigned comparison, the dirty bits are never reset, andthe screen redrawn each time. Fix that by only using ram_addr_t types,and looking for page_min != addr_max instead.
gt64xxx: set isa_mem_base during registration
isa_mem_base is computed from registers during reset, but due to QEMUlimitations some devices (e.g. VGA card) need to know it earlier whenthey are registered.
Workaround this by setting the value during registration instead of...
hw/pl190.c: Fix writing of default vector address
The PL190 implementation keeps the default vector addressin vect_addr16, but we weren't using this for writes tothe DEFVECTADDR register. As a result of this fix thedefault_addr structure member is unused and we can delete it....
pci: use qemu_malloc() in pcibus_get_dev_path()
use qemu_malloc() instead of direct use of malloc().