virtio-serial-bus: Unset guest_connected at reset and driver reset
When a guest driver resets the virtio status to not ready, or when qemuis reset, reset all ports' guest_connected bit and let port users knowof this event if they have the guest_close() callback registered....
virtio-serial-bus: fix guest_connected init before driver init
guest_connected should be false before guest driver initialization, andtrue after, both for multiport aware and non multiport aware drivers.
Don't set it before the guest_features are available; instead use...
versatiblepb: add NOR flash support
- add support for the 64MB NOR CFI01 flash available at0x34000000 on the versatilepb boardhttp://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0225d/BBAJIHEC.html
- tested with barebox bootloader
Signed-off-by: Eric Bénard <eric@eukrea.com>...
realview: break out versatile i2c controller code
The versatile i2c controller implementation was separated toits own file called versatile_i2c.c. This is done as a preparationfor adding i2c support to the versatilepb board.
Signed-off-by: Oskar Andero <oskar.andero@gmail.com>...
versatilepb: add ds1338 rtc device
Add ds1338 rtc attached on i2c.
Signed-off-by: Oskar Andero <oskar.andero@gmail.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm_mptimer: Reset the qemu_timer at reset
On reset of the mpcore timer/watchdog block we need todelete the qemu_timer in case it was running.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Merge remote-tracking branch 'origin/master' into staging
Merge remote-tracking branch 'spice/spice.v52' into staging
qxl: set default values of vram*_size_mb to -1
The addition of those values caused a regression where not specifyingany value for the vram bar size would result in a 4096 byte surfacearea. This is ok for the windows driver but causes the X driver to be...
qxl-render: fix broken vnc+spice since commit f934493
Notify any listeners such as vnc that the displaysurface has beenchanged, otherwise they will segfault when first accessing the freed olddisplaysurface data.
Signed-off-by: Alon Levy <alevy@redhat.com>...
hw/ac97: the volume mask is not only 0x1f
It's a case by case (see Table 66. AC ?97 Baseline Audio Register Map)
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>Signed-off-by: malc <av1474@comtv.ru>
hw/ac97: add support for volume control
Combine output volume with Master and PCM registers values.Use default values in mixer_reset ().Set volume on post-load to update backend values.
v4,v5:- fix some code style
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>...
hw/ac97: remove USE_MIXER code
That code doesn't compile. The interesting bits for volume control aregoing to be rewritten in the following patch.
usb-ehci: drop assert()
Not sure what the purpose of the assert() was, in any case it is bogous.We can arrive there if transfer descriptors passed to us from the guestfailed to pass sanity checks, i.e. it is guest-triggerable. We dealwith that case by resetting the host controller. Everything is ok, no...
usb-ehci: fix ehci_child_detach
Looks like a cut+paste bug from ehci_detach. When the device itself isdetached from a ehci port (ehci_detach op) we have to clear thedevice pointer for the companion port too. When a device gets removedfrom a downstream port of a usb hub (ehci_child_detach op) the ehci port...
usb-ehci: frindex always is a 14 bits counter
frindex always is a 14 bits counter, and not a 13 bits one as we wereemulating. There are some subtle hints to this in the spec, first of all"Table 2-12. FRINDEX - Frame Index Register" says:"Bit 13:0 Frame Index. The value in this register increments at the end of...
usb: add USBDescriptor, use for device descriptors.
This patch adds a new type for the binary representation of usbdescriptors. It is put into use for the descriptor generator codewhere the struct replaces the hard-coded offsets.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: use USBDescriptor for device qualifier descriptors.
Add device qualifier substruct to USBDescriptor,use it in the descriptor generator code.
usb: use USBDescriptor for config descriptors.
Add config descriptor substruct to USBDescriptor,use it in the descriptor generator code.
usb: use USBDescriptor for interface descriptors.
Add interface descriptor substruct to USBDescriptor,use it in the descriptor generator code.
usb: use USBDescriptor for endpoint descriptors.
Add endpoint descriptor substruct to USBDescriptor,use it in the descriptor generator code.
usb-host: rewrite usb_linux_update_endp_table
This patch carries a complete rewrite of the usb descriptor parser.Changes / improvements:
usb-ehci: Drop unused sofv value
The sofv value only ever gets a value assigned and is never used (read)anywhere, so we can just drop it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-redir: Notify our peer when we reject a device due to a speed mismatch
Also cleanup (reset) our device state when we reject a device due to aspeed mismatch.
usb-uhci: stop queue filling when we find a in-flight td
Not only QHs can form rings, but TDs too. With the newqueuing/pipelining support we are following TD chains andcan actually walk in circles. An assert() prevents us fromentering an endless loop then....
usb-uhci: queuing fix
When we queue up usb packets we may happen to find a already queuedpacket, which also might be finished at that point already. We don'twant continue processing the packet at this point though, so letsjust signal back we've found a in-flight packet when in queuing mode....
Add bootindex support to usb-host and usb-redir
When passing through a usb pendrive seabios will present it in the F12boot menu and will happily boot from it.
This patch adds bootorder support so you can even make it the defaultboot device.
usb-host: trace emulated requests
Add tracepoint to track completion of emulated control requests.
usb-host: trace canceled requests
Add tracepoints to track canceled requests.
usb-host: add usb packet to request tracepoints
Add pointer to USBPacket to all tracepoints tracking requests to make iteasier to identify them when multiple requests are in flight.
usb-host: add property to turn off pipelining
Add a property to usb-host to disable the bulk endpoint pipelining.
usb_packet_set_state: handle p->ep == NULL
usb_packet_set_state can be called with p->ep = NULL. The tracepointthere tries to log endpoint information, which leads to a segfault.This patch makes usb_packet_set_state handle the NULL pointer properly.
usb-hub: add tracepoints
Add tracepoints to the usb hub emulation.
usb/vmstate: add parent dev path
... to make vmstate id string truely unique with multiple hostcontrollers, i.e. move from "1/usb-ptr" to "0000:00:01.3/1/usb-ptr" (usb tabled connected to piix3 uhci).
This obviously breaks migration. To handle this the usb bus...
Merge remote-tracking branch 'kiszka/queues/pending' into staging
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
Merge remote-tracking branch 'sstabellini/for_anthony' into staging
vapic: Disable for pre-1.1 machines
The kvmvapic was not present in older QEMU versions, thus must bedisabled in compat machines.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
pcnet: Properly handle TX requests during Link Fail
As long as we have no link and we aren't in internal loopback mode, nopacket must be sent. Instead, LCAR needs to be set in any active TXdescriptor and also CERR in CSR0.
pcnet: Clear ERR in CSR0 on stop
pcnet_stop already clears any reason (BABL, CERR, MISS, MERR) why ERR(bit 15) should be set in CRS0. So we have to clear that bit as well.
pseries: Fix reset of VIO network device
Currently, the PAPR VIO network device does not have a reset handler. Thismeans that after a hard reset, H_REGISTER_LOGICAL_LAN will return an errorwhen the new guest boot attempts to initialize the device.
This patch corrects this, adding a suitable reset hook....
pseries: Remove old debug leftovers from spapr_vscsi
The PAPR VSCSI emulation contains a few lines of code which were once usedfor debug but now do nothing at all. This patch removes them.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Andreas Färber <afaerber@suse.de>
pseries: Remove old hcalls hook stub
Some time ago we removed all use of the 'hcalls' callback in the pseriesVIO code, which was used to workaround an ordering problem which has sincebeen solved properly. However, the function pointer for the hook remains....
pseries: Correctly use the device model reset hooks
Recently we added code to properly clean away VIO CRQs on reset However,this directly uses qemu_register, rather than the existing device modelreset callbacks. This patch cleans this up by adding proper use of the...
pseries: Reset vscsi properly
Currently the PAPR vscsi implementation does not properly clear its tableof request tags when the system is reset. This patch adds a reset hookto do so.
pseries: Fix RTAS based config access
On the pseries platform, access to PCI config space is via RTAS calls(which go to the hypervisor) rather than MMIO. This means we don't usethe same code path as nearly everyone else which goes through pci_host.cand we're missing some of the parameter checking along the way....
pseries: Clean up hcall_dprintf() debugging messages
The pseries machine code has a number of debug messages for debugging PAPRhypercalls, dependent on DEBUG_SPAPR_HCALLS. This patch cleans thesemessages up a bit, by adding func to the hcall_dprintf() macro and...
pseries: Fix bug with reset of VIO CRQs
PAPR specifies a Command Response Queue (CRQ) mechanism used for virtualIO, which we implement. However, we don't correctly clean up registeredCRQs when we reset the system.
This patch adds a reset handler to fix this bug. While we're at it, add...
pseries: Implement RTAS system-reboot call
This patch adds the PAPR defined RTAS system-reboot call to the pseriesmachine emulation, providing the guest with a way to trigger a reboot.
pseries: Remove unused fields from VIOsPAPRBus structure
The VIOsPAPRBus structure, used on the pseries machine contains some oldfields which are no longer used anywhere. This patch removes them.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
pseries: Consolidate hack for RTAS display-character usage
Currently the pseries machine contains not one but two somewhat ugly hacksto allow printing of early debug messages before the guest has properlyread the device tree.
First, we special case H_PUT_TERM_CHAR so that a vtermno of 0 (usually...
acpi_piix4: Fix PCI hotplug race
As Michael Tsirkin demonstrated, current PCI hotplug is vulnerableto a few races. The first is a race with other hotplug operationsbecause we clear the up & down registers at each event. If a newevent comes before the last is processed, up/down is cleared and...
acpi_piix4: Remove PCI_RMV_BASE write code
Clarify this register as read-only and remove write code. Nochange in existing behavior.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
acpi_piix4: Re-define PCI hotplug eject register read
The PCI hotplug eject register has always returned 0, so let's redefineit as a hotplug feature register. The existing model of using separateup & down read-only registers and an eject via write to this register...
acpi: explicitly account for >1 device per slot
Slot present bit is cleared apparently for each device. Hotplug and nonhotplug devices should not mix normally, and we only set the bit when weadd a device so it should all work out, but it's more robust to...
pci: fix corrupted pci conf index register by unaligned write
Commit d0ed8076cbdc261 converted the PCI config access to the memoryAPI, but also inadvertantly changed it to accept unaligned writes,and corrupt the index register in the process. This causes a regression...
acpi_piix4: Disallow write to up/down PCI hotplug registers
The write side of these registers is never used and actually can't beused as defined because any read/modify/write sequence from the guestpotentially races with qemu. Drop the write support and define these...
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
xen: handle backend deletion from xenstore
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Xen: Add xen-apic support and hook it up.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Xen: basic HVM MSI injection support.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
hw/arm11mpcore: Convert to using sysbus GIC device
Convert arm11mpcore to using the standalone sysbus GIC device.
hw/arm_gic: Make gic_reset a sysbus reset function
Make gic_reset a sysbus reset function, so we actuallyreset the GIC on system reset rather than only at init.For the NVIC this requires us also to implement resetof the SysTick.
hw/arm_gic: Use NVIC instead of LEGACY_INCLUDED_GIC define
Now all the A profile cores have been switched to use the standalonesysbus GIC, the only remaining code which #includes arm_gic.c isthe v7M NVIC. The coupling is much closer here so it's not so...
hw/arm_gic: gic_set_pending_private() is NVIC only
The function gic_set_pending_private() is now used by the NVIConly (for the GIC we now set PPI interrupts via gpio lines andgic_set_irq()). So make it #ifdef NVIC and remove the 'attributeunused' annotation....
hw/arm_gic: Remove stray hardcoded tab
Remove the single instance of a hardcoded tab from hw/arm_gic.c.
hw/a15mpcore: switch to using sysbus GIC
Switch the a15mpcore private peripheral region to usingthe standalone sysbus GIC device.
hw/a9mpcore: Switch to using sysbus GIC
Switch the a9mpcore to using the sysbus GIC device ratherthan having the a9mp private memory region device subclassthe GIC.
hw/realview_gic: switch to sysbus GIC
Switch the realview_gic device to the standalone sysbus GIC.
hw/exynos4210_gic: Convert to using sysbus GIC
Convert the Exynos GIC code to use the standalone sysbusGIC device.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Evgeny Voevodin <e.voevodin@samsung.com>
hw/arm_gic: Move NCPU definition to arm_gic.c
Move the NCPU definition to arm_gic.c: the maximum numberof CPU interfaces is defined by the GIC architecture specificationto be 8, so we don't need to have this #define in each of thesources files which currently includes arm_gic.c....
hw/arm_gic: Move gic_get_current_cpu into arm_gic.c
Move the gic_get_current_cpu() function into arm_gic.c.There are only two implementations: (1) "get the indexof the currently executing CPU", used by all multicoreGICs, and (2) "always 0", used by all GICs instantiated...
hw/arm_gic: Expose PPI inputs as gpio inputs
Expose the Private Peripheral Interrupt inputs as GPIO inputs.The layout of the GPIO array is thus: [0..N-1] SPIs [N..N+31] PPIs for CPU 0 [N+32..N+63] PPIs for CPU 1 ...
Treating PPIs as being another kind of input line is in line with the...
hw/arm_gic: Make the GIC its own sysbus device
Compile arm_gic.c as a standalone C file to produce a self containedsysbus GIC device. Support the legacy usage by #include of the .c fileby making those users #define LEGACY_INCLUDED_GIC, so we can convert...
Fix bit test in Exynos4210 UART emulation to use & instead of &&
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
ARM: Exynos4210: Drop gic_cpu_write() after initialization.
Remove gic_cpu_write() call after initialization that was emulatingfunctionality of earliest SOC bootloader which enables externalGIC CPU1 interface. Instead introduce Exynos4210-specific secondary...
hw/exynos4210_combiner.c: Drop excessive read/write access check.
Access to reserved area at offset higher than 0x3c is allowed inExternal Combiner. Samsung Galaxy Kernel implements this. So, dropexcessive checks in read/write functions.
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>...
kvmclock: guest stop notification
Often when a guest is stopped from the qemu console, it will report spurioussoft lockup warnings on resume. There are kernel patches being discussed thatwill give the host the ability to tell the guest that it is being stopped and...
kvm: allow arbitrarily sized mmio ioeventfd
We use a 2 byte ioeventfd for virtio memory,add support for this.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Reviewed-by: Amos Kong <akong@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
ps2: avoid repeated header file includes
Signed-off-by: Wanpeng Li <liwp@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
rtl8139: do not assume TxStatus[] and TxAddr[] are adjacent
Commit afe0a595356192d5f79703cf6462fcc112df007c ("rtl8139: support byteread to TxStatus registers") reused rtl8139_TxStatus_read() for readingTxAddr registers. It relies on the fact that TxStatus[] and TxAddr[]...
ivshmem: add missing msix calls
ivshmem used msix but didn't call it on either reset orconfig write paths. This used to partically work sinceguests don't use all of msi-x configuration fields,and reset is rarely used, but the patch 'msix: track function masked...
virtio-pci: change virtio balloon PCI class code
Currently the virtio balloon device, when using the virtio-pci interfaceadvertises itself with PCI class code MEMORY_RAM. This is wrong; theballoon is vaguely related to memory, but is nothing like a PCI memory...
piix_pci: fix typo in i400FX chipset init code
There is a typo in i440FX init code. This is causing problems whensomebody wants to access the 64bit PCI range.
Signed-off-by: Alexey Korolev <alexey.korolev@endace.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pc: reduce duplication in compat machine types
Make it easier to add compat properties, byadding macros for properties duplicated acrossmachine types.
Note: there could be bugs in compat properties,this patch does not attempt to address them,the code is bug for bug identical to the original....
vhost: Fix size of dirty log sync on resize
When the vhost log is resized, we want to sync up tothe size of the old log. With that end address in place,ignore regions that start after then end rather thanhitting assert.
This also addresses the following crash report:...
vhost: readd assert statement
It's clear from the surrounding code thatstart < end so it's enough to assert end < log_size.However, it's better to make this explicit in casewe refactor the code again.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Merge commit 'ff71f2e8cacefae99179993204172bc65e4303df' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
petalogix_s3adsp1800: deleted bad FIXME comment
This FIXME has already been actioned. Deleted comment.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
qdev: qdev_unplug(): use error_set()
It currently uses qerror_report(), but next commit will convertthe drive_del command to the QAPI and this requires usingerror_set().
One particularity of qerror_report() is that it knows when it'srunning on monitor context or command-line context and prints the...
qapi: convert device_del
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Replace Qemu by QEMU in comments
The official spelling is QEMU.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Andreas Färber <afaerber@suse.de>[blauwirbel@gmail.com: fixed comment style in hw/sun4m.c]Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qdev: add blocksize property type
Storage interfaces like virtio-blk can be configured with block sizeinformation so that the guest can take advantage of efficient I/Orequest sizes.
According to the SCSI Block Commands (SBC) standard a device's blocksize is "almost always greater than one byte and may be a multiple of...
Use DMADirection type for dma_bdrv_io
Currently dma_bdrv_io() takes a 'to_dev' boolean parameter todetermine the direction of DMA it is emulating. We already have aDMADirection enum designed specifically to encode DMA directions.This patch uses it for dma_bdrv_io() as well. This involves removing...
ide: Add "model=s" qdev option
Allow the user to override the default disk model name "QEMU HARDDISK".
Some Linux distributions use the /dev/disk/by-id/scsi-SATA_name-of-disk-model_serial addressing scheme when refering to partitions in /etc/fstaband elsewhere. This causes problems when starting a disk image taken from...
ide: Change serial number strncpy() to pstrcpy()
strncpy may not null-terminate the destination string.
Cc: kwolf@redhat.comSigned-off-by: Floris Bos <dev@noc-ps.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Adds wwn=hex qdev option
Allow the user to specify a disk's World Wide Name.
Linux guests can address disks by their unique World Wide Name number(e.g. /dev/disk/by-id/wwn-0x5001517959123522). This patch adds supportfor assigning a World Wide Name number to a virtual IDE disk....