pxa2xx: port pxa2xx_rtc to using qdev/vmstate
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
pxa2xx_dma: Get rid of a forward declaration.
pxa2xx_dma: port to qdev/vmstate
vmstate: move VMSTATE_PCIE_AER_ERRS to hw/hw.h
VMSTATE_PCIE_AER_ERRS is indeed useful for other emulation drivers.Move it to hw/hw.h under the name of VMSTATE_STRUCT_VARRAY_POINTER_UINT16.Also add VMSTATE_STRUCT_VARRAY_POINTER_INT32 which is more or less...
pxa2xx_dma: drop unused pxa2xx_dma_handler_t/handler field
pxa2xx_timer: Store relevant irq line in each timer.
pxa2xx_timer: switch to using qdev/vmstate
pxa2xx_timer: change info struct name to comply with guidelines
It should be PXA2xxTimerInfo, not pxa2xx_timer_info. Replace alloccurences of old name with the new one.
pxa2xx_pic: Set base address for sysbus device.
Thid device's registration was broken sincee1f8c729fa890c67bb4532f22c22ace6fb0e1aaf, this should fix it.
vmstate: add VMSTATE_STRUCT_ARRAY_TEST
This is a _TEST variant of VMSTATE_STRUCT_ARRAY, necessary e.g.for future patch changing pxa2xx_timer to use vmstate.
pxa2xx_pic: update to use qdev
Use qdev/sysbus framework to handle pxa2xx-pic. Instead of exposing IRQsvia array, reference them via qdev_get_gpio_in().
Patch has been modified by the committer.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>...
mst_fpga: correct irq level settings
Final corrections for IRQ levels that are set by mst_fpga:
virtio-serial: kill VirtIOSerialDevice
VirtIOSerialDevice is like VirtIOSerialPort with just the first twofields, which makes it pretty pointless. Using VirtIOSerialPortdirectly works equally well and is less confusing.
[Amit: - rebase - rename 'dev' to 'port' in function params in virtio-serial.h ]...
hw/sd.c: Add missing state change for SD_STATUS, SEND_NUM_WR_BLOCKS
The SD_STATUS and SEND_NUM_WR_BLOCKS commands are supposed to causethe card to send data back to the host. However sd.c was missing thestate change to sd_sendingdata_state for these commands, with the effect...
pls3adsp1800: Base load_elf endianness on target endianness
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
hw/irq.h: Remove unused SetIRQFunc typedef
Remove the typedef SetIRQFunc, as it is not used by anything.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Revert "prep: Disable second IDE channel, as long as ISA IDE emulation doesn't support same irq for both channels"
This reverts commit 491e2a338fdf8310c84f6ebaed1683a871a0700e.
isa-bus: Remove bogus IRQ sharing check
Nothing prevented IRQ sharing on the ISA bus in principle. Not allboards supported this, neither each and every card nor driver and OS.Still, there existed valid IRQ sharing scenarios, (at least) two of themcan also be found in QEMU: >2 PC UARTs and the PREP IDE buses....
PS/2 keyboard Scancode Set 3 support
The following patch adds PS/2 keyboard Scancode Set 3 support.
Signed-off-by: Roy Tam <roytam@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix obvious mistake in pxa2xx i2s driver
RST bit is (1 << 4) bit, not (1 << 3), fix conditionthat enables i2s if ENB is set and RST is not set.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pxa2xx_keypad: Handle 0xe0xx keycodes
Add handling of 0xe0xx keycodes to pxa2xx_driver.Extended keycodes in keymap should be marked with most significantbit set (i.e. 0x80). Without this patch it's not possible to handlei.e. cursor keys.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>...
pxa2xx_keypad: enhance emulation of KPAS, KPASMKP regs
Add emulation of KPAS register and proper emulation ofKPASMKP regs, so now driver supports multipresses and properlyworks with Linux driver.
qdev: Fix printout of bit device properties with bit index >= 8
Signed-off-by: David 'Digit' Turner <digit@google.com>Acked-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
ppc405: Fix memory leak
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Acked-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
s390: Fix memory leak
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pci: Fix memory leak
vhost: disable on tap link down
qemu makes it possible to disable link at tap which is not communicatedto the guest but causes all packets to be dropped.
When vhost-net is enabled, vhost needs to be aware of both the virtiolink_down and the peer link_down. we switch to userspace emulation when...
e1000: verify we have buffers, upfront
The spec says: Any descriptor with a non-zero status byte has beenprocessed by the hardware, and is ready to be handled by the software.
Thus, once we change a descriptor status to non-zero we shouldnever move the head backwards and try to reuse this...
e1000: clear EOP for multi-buffer descriptors
The e1000 spec says: if software statically allocatesbuffers, and uses memory read to check for completed descriptors, itsimply has to zero the status byte in the descriptor to make it readyfor reuse by hardware. This is not a hardware requirement (moving the...
e1000: multi-buffer packet support
e1000 supports multi-buffer packets larger than rxbuf_size.
This fixes the following (on linux):- in guest: ifconfig eth1 mtu 16110- in host: ifconfig tap0 mtu 16110 ping -s 16082 <guest-ip>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
pc: remove test on TARGET_PHYS_ADDR_BITS == 32
Both i386 and x86_64 targets are now using target_phys_bits=64. Removeuseless code.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
i8254: convert to qdev
Convert to qdev. Don't expose PITState.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vga-isa: make optional
Ignore failure with vga-isa device creation, but print a warningmessage.
vga-isa: convert to qdev
fdc: make optional
Ignore failure with fdc device creation.
fdc: refactor device creation
Turn fdc_init_isa into an inline function.
Get floppy geometry directly from the drives.
Don't expose FDCtrl.
fdc: use FDriveType for floppy drive type
fdc: move floppy geometry guessing to block.c
Other geometry guessing functions already reside in block.c.
Remove some unused or debugging only fields.
serial: make optional
Ignore failure with serial device creation.
serial: refactor device creation
Turn serial_init into an inline function.
ne2000_isa: make optional
Ignore failure with ne2000_isa device creation.
ne2000_isa: refactor device creation
Turn isa_ne2000_init into an inline function.
parallel: make optional
Ignore failure with parallel device creation.
parallel: refactor device creation
Turn parallel_init into an inline function.
Don't expose ParallelState.
Fix vmport segfault (v2)
Fix regression caused by qdev conversion.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote branch 'qemu-kvm/uq/master' into staging
Merge mainstone.h header into mainstone.c
Now the only user of mainstone.h is mainstone.c file. Merge headerinto board file.
mainstone: convert FPGA emulation code to use QDev/SysBus
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>
kvm: x86: Introduce kvmclock device to save/restore its state
If kvmclock is used, which implies the kernel supports it, register akvmclock device with the sysbus. Its main purpose is to save and restorethe kernel state on migration, but this will also allow to visualize it...
Introduce log_start/log_stop in CPUPhysMemoryClient
In order to use log_start/log_stop with Xen as well in the vga code,this two operations have been put in CPUPhysMemoryClient.
The two new functions cpu_physical_log_start,cpu_physical_log_stop areused in hw/vga.c and replace the kvm_log_start/stop. With this, vga does...
cirrus: Remove obsolete kvm.h include
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Improve vm_stop reason declarations
Define and use dedicated constants for vm_stop reasons, they actuallyhave nothing to do with the EXCP_* defines used so far. At this chance,specify more detailed reasons so that VM state change handlers canevaluate them....
vmmouse: fix queue_size field initialization
Initialize the field queue_size, dropped by91c9e09147ba1f3604a3d5d29b4de7702082a33f.
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.
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....
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...