Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM infrastructure fixes and device conversions
char/serial: Fix emptyness check
This was guarding against a full fifo rather than an empty fifo whenpopping. Fix.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Martin Kletzander <mkletzan@redhat.com>Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>...
qdev: Remove hex8/32/64 property types
Replace them with uint8/32/64.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
ipack: Move IndustryPack out of hw/char/
Move the header defining an IPackBus and IPackDevice base class intoa new include/ directory and move their implementation and aPCI-IndustryPack bridge out of hw/char/ directory into a new hw/ipack/.
Acked-by: Alberto Garcia <agarcia@igalia.com>...
ipack: Convert to QOM realize
Acked-by: Alberto Garcia <agarcia@igalia.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
ipack: QOM parent field cleanup for IPackBus
Clean up the only user of IPackBus::qbus field and rename it.
ipack: QOM parent field cleanup for IPackDevice
Rename the IPackDevice::qdev field to avoid accidental use.
ipoctal232: QOM parent field cleanup
Clean up accesses to IPOctalState::dev field and rename it.
lm32_uart/lm32_juart: use qemu_chr_fe_write_all()
qemu_chr_fe_write() may return EAGAIN. Therefore, useqemu_chr_fe_write_all().
Signed-off-by: Michael Walle <michael@walle.cc>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
milkymist-uart: use qemu_chr_fe_write_all() instead of qemu_chr_fe_write()
qemu_chr_fe_write() is capable of returning 0to indicate EAGAIN (and friends) and we don'thandle this.
Just change it to qemu_chr_fe_write_all() to fix.
Reported-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
Merge remote-tracking branch 'mjt/trivial-patches' into staging
char/cadence_uart: Mark struct fields as public/private
As per current QOM conventions.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: a1e31bd62e9709ffb9b3efc6c120f83f30b7a660.1388626249.git.peter.crosthwaite@xilinx.comSigned-off-by: Peter Maydell <peter.maydell@linaro.org>
char/cadence_uart: Add missing uart_update_state
This should be rechecked on bus write accesses as such accesses maychange the underlying state that generates the interrupt. Particularrelevant for when the guest touches the interrupt status or mask.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
char/cadence_uart: Fix reset.
Don't reset the uart as an init step. Register the reset function as aproper reset fn instead.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: d82cd2e65e5a6f8b6deeecb6cced61f0bf3f8c89.1388626249.git.peter.crosthwaite@xilinx.com...
char/cadence_uart: s/r_fifo/rx_fifo
Rename this field to match the many other uses of "rx". Xilinxdocmentation (UG585) also refers to this as "RxFIFO".
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: 7386d7cee0ea175f7e53ed5ff045265528d34e32.1388626249.git.peter.crosthwaite@xilinx.com...
char/cadence_uart: Simplify status generation
The status register bits are always pure functions of other devicestate. Move the generation of these bits to the update_status()function to simplify. Makes developing much easier as theres now no needto recheck status bits on all the changes to rx/tx fifo state....
char/cadence_uart: Define Missing SR/ISR fields
Some (interrupt) status register bits relating to the TxFIFO path werenot defined. Define them. This prepares support for proper Tx data pathflow control.
char/cadence_uart: Remove TX timer & add TX FIFO state
This tx timer implementation is flawed. Despite the controllerattempting to time the guest visable assertion of the TX-empty statusbit (and corresponding interrupt) the controller is still transmitting...
char/cadence_uart: Fix can_receive logic
The can_receive logic was only taking into account the RxFIFOoccupancy. RxFIFO population is only used for the echo and normal modeshowever. Improve the logic to correctly return the true number ofreceivable characters based on the current mode:...
char/cadence_uart: Use the TX fifo for transmission
Populate the TxFIFO with the Tx data before sending. Preparessupport for proper Tx flow control implementation.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: bdf7f8af2ef02839bea18665701bc2612f7baa6f.1388626249.git.peter.crosthwaite@xilinx.com...
char/cadence_uart: Delete redundant rx rst logic
uart_rx_reset() called immediately above already does this. Remove.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: 05e30826496cf2579084ed801ac0b2c0d0a3071f.1388626249.git.peter.crosthwaite@xilinx.com...
char/cadence_uart: Implement Tx flow control
If the UART back-end blocks, buffer in the Tx FIFO to try again later.This stops the IO-thread busy waiting on char back-ends (which causesall sorts of performance problems).
exynos4210: Use macro ARRAY_SIZE where possible
This improves readability and simplifies the code.
Cc: Dmitry Solodkiy <d.solodkiy@samsung.com>Cc: Evgeny Voevodin <e.voevodin@samsung.com>Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>Cc: Maksim Kozlov <m.kozlov@samsung.com>...
hw/arm/digic: add UART support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: 1387188908-754-5-git-send-email-antonynpavlov@gmail.com...
Merge remote-tracking branch 'bonzini/virtio' into staging
virtio-serial: QOM realize preparations
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virtio-serial: Convert to QOM realize
virtio: Convert exit to unrealize
virtio-serial: switch exit callback to VirtioDeviceClass
This ensures hot-unplug is handled properly by the proxy, and avoidsleaking bus_name which is freed by virtio_device_exit.
Cc: qemu-stable@nongnu.orgAcked-by: Andreas Faerber <afaerber@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
misc: Replace 'struct QEMUTimer' by 'QEMUTimer'
Most code already used QEMUTimer without the redundant 'struct' keyword.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
spapr: add vio-bus devices to categories
In order to get devices appear in output of"./qemu-system-ppc64 -device ?",they must be assigned to one of DEVICE_CATEGORY_XXXX.
This puts VIO devices classes to corresponding categories.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>...
milkymist-uart: Use Device::realize instead of SysBusDevice::init
Use of SysBusDevice::init is deprecated. Use Device::realize instead.
Also introduce TypeInfo::instance_init milkymist_uart_init().
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci, pc, acpi fixes, enhancements
This includes some pretty big changes:- pci master abort support by Marcel- pci IRQ API rework by Marcel- acpi generation support by myself
Everything has gone through several revisions, latest versions have been on...
hw: set interrupts using pci irq wrappers
pci_set_irq and the other pci irq wrappers usePCI_INTERRUPT_PIN config register to compute deviceINTx pin to assert/deassert.
An irq is allocated using pci_allocate_irq wrapperonly if is needed by non pci devices....
sh4: Fix serial line access for Linux kernels later than 3.2
With Linux kernel version 3.3 or later, qemu fails with the following message:
sh_serial: unsupported read from 0x18 Aborted
Reported-and-analyzed-by: Rob Landley <rob@landley.net>Signed-off-by: Guenter Roeck <linux@roeck-us.net>...
s390/eventfacility: remove unused event_type variable
The event_type variable is never used. Get rid of it.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>Reviewed-by: Alexander Graf <agraf@suse.de>
s390/eventfacility: allow childs to handle more than 1 event type
Currently all handlers (quiesce, console) only handle one event type.Some drivers will handle multiple (compatible) event types. Rework thecode accordingly.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>...
s390/sclplmconsole: Add support for SCLP line-mode console
Add simple support for SCLP line-mode also known as operatingsystem messages. This can be added in addition to or instead ofthe SCLP full screen console with -device sclplmconsole.
Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>...
s390/sclpconsole: modify definition of input buffer
To use VMState for migration, we need to adapt some sclp code: - allocate console buffer as part of the console - change semantic of sclpconsole offset fields
s390/sclpconsole: Add code to support live migration for sclpconsole
This patch adds the necessary life migration pieces to the sclp codeby using vmstate_register.
Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>Reviewed-by: Alexander Graf <agraf@suse.de>...
s390/sclp: add reset() functions
Add reset() functions for event-facility, sclpconsole, and sclpquiesce.The reset() functions perform variable initializationat IPL and e.g. when monitor system_reset is called.
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
QOM device refactorings
pseries: Fix stalls on hypervisor virtual console
A number of users are reporting stalls when using the pserieshypervisor virtual console.
A simple test case is to paste 15 or 17 characters at a timeinto the console. Pasting 15 characters at a time works fine...
qdev: Pass size to qbus_create_inplace()
To be passed to object_initialize().
Since commit 39355c3826f5d9a2eb1ce3dc9b4cdd68893769d6 the argument isvoid*, so drop some superfluous (BusState *) casts or direct parentfield usages.
Signed-off-by: Andreas Färber <afaerber@suse.de>
ipack: Pass size to ipack_bus_new_inplace()
To be passed to qbus_create_inplace().
Simplify DEVICE cast to avoid parent field access.
Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'stefanha/block' into staging
aio / timers: Switch entire codebase to the new timer API
This is an autogenerated patch using scripts/switch-timer-api.
Switch the entire code base to using the new timer API.
Note this patch may introduce some line length issues.
Signed-off-by: Alex Bligh <alex@alex.org.uk>...
Convert stderr message calling error_get_pretty() to error_report()
Convert stderr messages calling error_get_pretty()to error_report().
Timestamp is prepended by -msg timstamp option with it.
Per Markus's comment below, A conversion from fprintf() to...
virtio-console: Use exitfn for virtserialport, too
virtconsole and virtserialport are identical in every other aspectexcept for the distinguishing VirtIOSerialPortClass::is_console field.
Cc: qemu-stable@nongnu.orgSigned-off-by: Andreas Färber <afaerber@suse.de>...
s390/sclpconsole: handle char layer busy conditions
Handle busy conditions (errno=EAGAIN) in char layer by usingthe new char layer in the sclp console.
Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
lm32_juart: QOM cast cleanup
lm32_uart: QOM cast cleanup
milkymist-uart: QOM cast cleanup
pl011: Rename pl011_state
pl011: QOM'ify pl011 and pl011_luminary
Let the Luminary variant inherit from the ARM one, overwriting its ID oninstance_init. Introduce type constant and use QOM casts. Replacetriplicated SysBusDevice initfn with QOM realizefn and instance_init.
cadence_uart: QOM cast cleanup
escc: QOM cast cleanup
exynos4210_uart: QOM cast cleanup
grlib_apbuart: QOM cast cleanup
imx_serial: QOM cast cleanup
lm32_juart: Relocate and tidy header
xilinx_uartlite: QOM cast cleanups
Introduce type constant and use QOM casts.
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
xilinx_uartlite: Rename xlx_uartlite to XilinxUARTLite
etraxfs_ser: QOM cast cleanups
Rename etrax_serial to ETRAXSerial, introduce type constant and use QOMcasts.
devices: Associate devices to their logical category
The category will be used to sort the devices displayed inthe command line help.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com...
pseries: savevm support for PAPR VIO logical tty
This patch adds the necessary VMStateDescription information to supportsavevm/loadvm for the spapr_tty (PAPR logical serial) device.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
char/cadence_uart: Fix reset for unattached instances
commit 1db8b5efe0c2b5000e50691eea61264a615f43de introduced an issuewhere QEMU would segfault if you have an unattached Cadence UART.
Fix by guarding the flush-on-reset logic on there being a qemu_chr...
hw/c*: pass owner to memory_region_init* functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
escc: rename struct to ESCCState
We are using the same struct name for two devices. 8250 is widespreadenough that this causes some confusion, rename the other instance.
Reviewed-by: Andreas Faerber <afaerber@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory: add owner argument to initialization functions
cadence_uart: Handle backend tx errors
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
char/serial: fix copy&paste error (fifo8_is_full vs empty)
Copy&paste error in serial.c causes a crash when attemptingto read from UART (if there is no data to be read)
Signed-off-by: Vladimir Senkov <hangup@gmail.com>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
Merge branch 'realize-isa.v2' of git://github.com/afaerber/qemu-cpu
char/serial: cosmetic fixes.
Some cosmetic fixes to char/serial fixing some checkpatch errors.
Cc: qemu-trivial@nongnu.org
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
char/serial: Use generic Fifo8
Use the generic Fifo8 helper provided by QEMU, rather than re-implementprivately.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
char/serial: serial_ioport_write: Factor out common code
These three lines are common to both FIFO and regular mode. Just factorthem out to outside the if rather than replicate the same lines insideboth if and else.
isa: QOM'ify ISADevice
Rename its parent field and use DEVICE where necessary.
isa: Use realizefn for ISADevice
Drop ISADeviceClass::init and the resulting no-op initfn and letchildren implement their own realizefn. Adapt error handling.Split off an instance_init where sensible.
debugcon: fix always print "addr=0x0, val=0x0" bug when use DEBUG_DEBUGCON
when use DEBUG_DEBUGCON, screen spits:debugcon: write addr=0x0000 val=0x00Rdebugcon: write addr=0x0000 val=0x00udebugcon: write addr=0x0000 val=0x00ndebugcon: write addr=0x0000 val=0x00...
debugcon: make debug message more readable
before change:Bdebugcon: write addr=0x0000 val=0x6fodebugcon: write addr=0x0000 val=0x6fodebugcon: write addr=0x0000 val=0x74tdebugcon: write addr=0x0000 val=0x69idebugcon: write addr=0x0000 val=0x6endebugcon: write addr=0x0000 val=0x67...
debugcon: fix compiler warning when open DEBUG_DEBUGCON
compiler warnings: CC hw/char/debugcon.ohw/char/debugcon.c: In function ‘debugcon_ioport_write’:hw/char/debugcon.c:58: warning: format ‘%02x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’...
virtio-serial: fix command line compatibility.
The bus name is wrong since the refactoring.
This keeps the behaviour of the command line.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>Message-id: 1367330931-12994-5-git-send-email-fred.konrad@greensocs.com...
serial: QOM'ify ISA serial
Introduce type constant and cast macro to obsolete DO_UPCAST().
Prepares for ISA realizefn.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Message-id: 1367093935-29091-16-git-send-email-afaerber@suse.de...
parallel: QOM'ify
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Message-id: 1367093935-29091-11-git-send-email-afaerber@suse.de...
pseries: Convert VIO code to QOM style type safe(ish) casts
Curerntly the pseries VIO device code contains quite a few explicituses of DO_UPCAST and plain C casts. This is (obviously) type unsafe,and not the conventional way of doing things in the QOM model. This...
virtio: cleanup: init and exit function.
This clean the init and the exit functions and rename virtio_common_cleanupto virtio_cleanup.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-7-git-send-email-fred.konrad@greensocs.com...
virtio: remove the function pointer.
This remove the function pointer in VirtIODevice, and use onlyVirtioDeviceClass function pointer.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-5-git-send-email-fred.konrad@greensocs.com...
virtio-console: Also throttle when less was written then requested
This is necessary so that we get properly woken up to write the rest.
This patch also changes the len argument to the have_data callback, toavoid doing an unsigned signed comparison.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
virtio-console: Remove any pending watches on close
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Merge remote-tracking branch 'bonzini/hw-dirs' into staging
sysemu: avoid proliferation of include/ subdirectories
virtio-serial: cleanup: init and exit functions.
This remove old init and exit function as they are no longer needed.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
virtio-serial: cleanup: use QOM casts.
As the virtio-serial-pci and virtio-serial-s390 are switched to the newAPI, we can use QOM casts.
virtio-serial: cleanup: remove qdev field.
The qdev field is no longer needed, just drop it.
virtio-serial: add the virtio-serial device.
Create virtio-serial which extends virtio-device, so it can be connectedon virtio-bus.
hw: move private headers to hw/ subdirectories.
Many headers are used only in a single directory. These can bekept in hw/.
hw: move char devices to hw/char/, configure via default-configs/
hw: move target-independent files to subdirectories
This patch tackles all files that are compiled once, movingthem to subdirectories of hw/.
hw: move virtio devices to hw/ subdirectories
hw: make subdirectories for devices
Prepare the new directory structure.