- Apr 20, 2017
-
-
Krzysztof Kozlowski authored
The static array exynos4210_uart_regs with register values is not modified so it can be made const. Few other functions accept driver or uart state as an argument but they do not change it and do not cast it so this can be made const for code safeness. Signed-off-by:
Krzysztof Kozlowski <krzk@kernel.org> Message-id: 20170313184750.429-3-krzk@kernel.org Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Mar 19, 2017
-
-
Stefano Stabellini authored
Change Makefile.objs to use CONFIG_XEN instead of CONFIG_XEN_BACKEND, so that the Xen backends are only built for targets that support Xen. Set CONFIG_XEN in the toplevel Makefile to ensure that files that are built only once pick up Xen support properly. Signed-off-by:
Stefano Stabellini <stefano@aporeto.com> Tested-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Greg Kurz <groug@kaod.org> CC: pbonzini@redhat.com CC: peter.maydell@linaro.org CC: rth@twiddle.net CC: stefanha@redhat.com Message-Id: <1489694518-16978-1-git-send-email-sstabellini@kernel.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Mar 15, 2017
-
-
Hailiang Zhang authored
Signed-off-by:
zhanghailiang <zhang.zhanghailiang@huawei.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Amit Shah <amit@kernel.org>
-
- Feb 16, 2017
-
-
Thomas Huth authored
Use type_init() etc. to adapt the ColdFire UART to the latest QEMU device conventions. Signed-off-by:
Thomas Huth <huth@tuxfamily.org> Message-Id: <1485586582-6490-1-git-send-email-huth@tuxfamily.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Feb 13, 2017
-
-
Halil Pasic authored
The member VMStateField.start is used for two things, partial data migration for VBUFFER data (basically provide migration for a sub-buffer) and for locating next in QTAILQ. The implementation of the VBUFFER feature is broken when VMSTATE_ALLOC is used. This however goes unnoticed because actually partial migration for VBUFFER is not used at all. Let's consolidate the usage of VMStateField.start by removing support for partial migration for VBUFFER. Signed-off-by:
Halil Pasic <pasic@linux.vnet.ibm.com> Message-Id: <20170203175217.45562-1-pasic@linux.vnet.ibm.com> Reviewed-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com>
-
- Feb 06, 2017
-
-
David Gibson authored
At present, the core device model code for 8250-like serial ports (serial.c) and the code for serial ports attached to ISA-style legacy IO (serial-isa.c) are both controlled by the CONFIG_SERIAL variable. There are lots and lots of embedded platforms that have 8250-like serial ports but have never had anything resembling ISA legacy IO. Therefore, split serial-isa into its own CONFIG_SERIAL_ISA option so it can be disabled for platforms where it's not appropriate. For now, I enabled CONFIG_SERIAL_ISA in every default-config where CONFIG_SERIAL is enabled, excepting microblaze, or32, and xtensa. As best as I can tell, those platforms never used legacy ISA, and also don't include PCI support (which would allow connection of a PCI->ISA bridge and/or a southbridge including legacy ISA serial ports). Signed-off-by:
David Gibson <david@gibson.dropbear.id.au> Reviewed-by:
Thomas Huth <thuth@redhat.com> Acked-by:
Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Jan 27, 2017
-
-
Marc-André Lureau authored
Pick a uniform chardev type name. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Peter Maydell authored
The frame_size local variable in exynos4210_uart_update_parameters() is calculated but never used (and has been this way since the device was introduced in commit e5a4914e). The qemu_chr_fe_ioctl() doesn't need this information (if it really wanted it it could calculate it from the parity/data_bits/stop_bits), so just drop the variable entirely. Fixes: https://bugs.launchpad.net/bugs/1655702 Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 1484589515-26353-1-git-send-email-peter.maydell@linaro.org
-
- Jan 16, 2017
-
-
Li Qiang authored
The serial_exit_core function doesn't free some resources. This can lead memory leak when hotplug and unplug. This patch avoid this. Signed-off-by:
Li Qiang <liqiang6-s@360.cn> Message-Id: <586cb5ab.f31d9d0a.38ac3.acf2@mx.google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jan 10, 2017
-
-
Jason Wang authored
Currently, all virtio devices bypass IOMMU completely. This is because address_space_memory is assumed and used during DMA emulation. This patch converts the virtio core API to use DMA API. This idea is - introducing a new transport specific helper to query the dma address space. (only pci version is implemented). - query and use this address space during virtio device guest memory accessing when iommu platform (VIRTIO_F_IOMMU_PLATFORM) was enabled for this device. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Stefan Hajnoczi <stefanha@redhat.com> Cc: Kevin Wolf <kwolf@redhat.com> Cc: Amit Shah <amit.shah@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: qemu-block@nongnu.org Signed-off-by:
Jason Wang <jasowang@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Jan 09, 2017
-
-
Xiaoqiang Zhao authored
Drop the old Sysbus init and use instance_init and DeviceClass::realize instead Signed-off-by:
xiaoqiang zhao <zxq_yx_007@163.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Dec 27, 2016
-
-
Andrew Gacek authored
When register Rcvr_timeout_reg0 (R_RTOR in cadence_uart.c) is set to 0, the receiver timeout counter should be disabled. See page 1801 of "Zynq-7000 AP SoC Technical Reference Manual". This commit adds a such a check before setting the receive timeout interrupt. Signed-off-by:
Andrew Gacek <andrew.gacek@gmail.com> Reviewed-by:
Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Alistair Francis authored
The Cadence UART device emulator calculates speed by dividing the baud rate by a 'baud rate generator' & 'baud rate divider' value. The device specification defines these register values to be non-zero and within certain limits. Checks were recently added when writing to these registers but not when restoring from migration. This patch adds checks when restoring from migration to avoid divide by zero errors. Reported-by:
Huawei PSIRT <psirt@huawei.com> Signed-off-by:
Alistair Francis <alistair.francis@xilinx.com> Message-id: 04ae30ed8ee1758cd2d2af880da4d28f74c67738.1481132150.git.alistair.francis@xilinx.com Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Nov 23, 2016
-
-
Thomas Huth authored
The can_receive() callbacks of the character devices should return the amount of characters that can be accepted at once, not just a boolean value (which rather means only one character at a time). Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au>
-
- Nov 14, 2016
-
-
Thomas Huth authored
When using the serial console in the GTK interface of QEMU (and QEMU has been compiled with CONFIG_VTE), it is possible to trigger the assert() statement in vty_receive() in spapr_vty.c by pasting a chunk of text with length > 16 into the QEMU window. Most of the other serial backends seem to simply drop characters that they can not handle, so I think we should also do the same in spapr-vty to fix this issue. Buglink: https://bugs.launchpad.net/qemu/+bug/1639322 Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
David Gibson <david@gibson.dropbear.id.au>
-
- Nov 07, 2016
-
-
Prasad J Pandit authored
The Cadence UART device emulator calculates speed by dividing the baud rate by a 'baud rate generator' & 'baud rate divider' value. The device specification defines these register values to be non-zero and within certain limits. Add checks for these limits to avoid errors like divide by zero. Reported-by:
Huawei PSIRT <psirt@huawei.com> Signed-off-by:
Prasad J Pandit <pjp@fedoraproject.org> Reviewed-by:
Alistair Francis <alistair.francis@xilinx.com> Message-id: 1477596278-1470-1-git-send-email-ppandit@redhat.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Oct 29, 2016
-
-
Emil Condrea authored
Prepare xen_be_send_notify to be shared with frontends: * xen_be_send_notify -> xen_pv_send_notify Signed-off-by:
Emil Condrea <emilcondrea@gmail.com> Signed-off-by:
Stefano Stabellini <sstabellini@kernel.org> Signed-off-by:
Quan Xu <xuquan8@huawei.com> Acked-by:
Anthony PERARD <anthony.perard@citrix.com>
-
Emil Condrea authored
Prepare xen_be_unbind_evtchn to be shared with frontends: * xen_be_unbind_evtchn -> xen_pv_unbind_evtchn Signed-off-by:
Emil Condrea <emilcondrea@gmail.com> Signed-off-by:
Stefano Stabellini <sstabellini@kernel.org> Signed-off-by:
Quan Xu <xuquan8@huawei.com> Acked-by:
Anthony PERARD <anthony.perard@citrix.com>
-
Emil Condrea authored
Prepare xen_be_printf to be used by both backend and frontends: * xen_be_printf -> xen_pv_printf Signed-off-by:
Emil Condrea <emilcondrea@gmail.com> Signed-off-by:
Stefano Stabellini <sstabellini@kernel.org> Signed-off-by:
Quan Xu <xuquan8@huawei.com> Acked-by:
Anthony PERARD <anthony.perard@citrix.com>
-
Emil Condrea authored
Fixes: * WARNING: line over 80 characters Signed-off-by:
Emil Condrea <emilcondrea@gmail.com> Signed-off-by:
Stefano Stabellini <sstabellini@kernel.org> Signed-off-by:
Quan Xu <xuquan8@huawei.com> Acked-by:
Anthony PERARD <anthony.perard@citrix.com>
-
Emil Condrea authored
Fixes the following errors: * ERROR: line over 90 characters * ERROR: code indent should never use tabs * ERROR: space prohibited after that open square bracket '[' * ERROR: do not initialise statics to 0 or NULL * ERROR: "(foo*)" should be "(foo *)" Signed-off-by:
Emil Condrea <emilcondrea@gmail.com> Signed-off-by:
Stefano Stabellini <sstabellini@kernel.org> Signed-off-by:
Quan Xu <xuquan8@huawei.com> Acked-by:
Anthony PERARD <anthony.perard@citrix.com>
-
- Oct 28, 2016
-
-
Prasad J Pandit authored
The Cadence UART device emulator stores 'baud rate generator' and 'baud rate divider' values, used in computing speed, in two registers. The device specification defines their range and their reset value. Use their correct value when resetting the device in cadence_uart_reset. Signed-off-by:
Prasad J Pandit <pjp@fedoraproject.org> Message-id: 1477378140-2670-1-git-send-email-ppandit@redhat.com Reviewed-by:
Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Oct 24, 2016
-
-
Marc-André Lureau authored
No need to keep explicit_fe_open around if it affects only a qemu_chr_fe_set_handlers(). Use an additional argument instead. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-24-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
In most cases, front ends do not care about the side effect of CharBackend, so we can simply skip the checks and call the qemu_chr_fe functions even without associated CharDriver. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-20-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
Now that all front end use qemu_chr_fe_init(), we can move chardev claiming in init(), and add a function deinit() to release the chardev and cleanup handlers. The qemu_chr_fe_claim_no_fail() for property are gone, since the property will raise an error instead. In other cases, where there is already an error path, an error is raised instead. Finally, other cases are handled by &error_abort in qemu_chr_fe_init(). Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-19-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
This also switches from qemu_chr_add_handlers() to qemu_chr_fe_set_handlers(). Note that qemu_chr_fe_set_handlers() now takes the focus when fe_open (qemu_chr_add_handlers() did take the focus) Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-16-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
qemu_chr_accept_input() and qemu_chr_disconnect() are only used by frontend, so use qemu_chr_fe prefix. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-14-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
Similar to previous change, for the remaining CharDriverState front ends users. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-13-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
Store the property in a CharBackend instead of CharDriverState*. This also replace systematically chr by chr.chr to access the CharDriverState*. The following patches will replace it with calls to qemu_chr_fe CharBackend functions. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-12-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
The CharDriverState.init() callback is no longer set since commit a61ae7f8 and thus unused. The only user, the malta FGPA display has been converted to use an event "opened" callback instead. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-7-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
Since commit b6607a1a, serial_hds_isa_init() was introduced to factor out serial_isa_init() loops. However, sun4uv shouldn't start from 0 when there is a mm serial on 0 already. Add a "from" argument to serial_hds_isa_init(). Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-5-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Prasad J Pandit authored
16550A UART device uses an oscillator to generate frequencies (baud base), which decide communication speed. This speed could be changed by dividing it by a divider. If the divider is greater than the baud base, speed is set to zero, leading to a divide by zero error. Add check to avoid it. Reported-by:
Huawei PSIRT <psirt@huawei.com> Signed-off-by:
Prasad J Pandit <pjp@fedoraproject.org> Message-Id: <1476251888-20238-1-git-send-email-ppandit@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Oct 17, 2016
-
-
Peter Maydell authored
Add some trace events for the pl011 UART model. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 1476294876-12340-5-git-send-email-peter.maydell@linaro.org
-
- Oct 09, 2016
-
-
Halil Pasic authored
Now all the usages of the old version of VMSTATE_VIRTIO_DEVICE are gone, so we can get rid of the conditionals, and the old macro. Signed-off-by:
Halil Pasic <pasic@linux.vnet.ibm.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Halil Pasic authored
Use the new VMSTATE_VIRTIO_DEVICE macro. Signed-off-by:
Halil Pasic <pasic@linux.vnet.ibm.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Stefan Hajnoczi authored
Ports enter a "throttled" state when writing to the chardev would block. The current output VirtQueueElement is kept around until the chardev becomes writable again. There are several places in the virtio-serial lifecycle where the VirtQueueElement should be thrown away. For example, if the virtio device is reset then virtqueue elements are no longer valid. This patch adds the discard_throttle_data() function to unmap the scatter-gather list and decrement vq->inuse. This ensures that the VirtQueueElement is freed properly. Cc: amit.shah@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Tested-by:
Ladi Prosek <lprosek@redhat.com> Reviewed-by:
Ladi Prosek <lprosek@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Sascha Silbe authored
Add support for enabling the virtio 1.0 "emergency write" (VIRTIO_CONSOLE_F_EMERG_WRITE) feature. The previous patch introduced the plumbing required for this; now we expose the virtio feature to the guest. The feature is disabled for compatibility machines to avoid exposing a new feature to existing guests. As required by the virtio 1.0 spec, the emergency write functionality is available to the guest even if the guest doesn't negotatiate the feature, as well as before feature negotation. Reviewed-by:
Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by:
Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Sascha Silbe authored
Add the infrastructure required for the virtio 1.0 "emergency write" (VIRTIO_CONSOLE_F_EMERG_WRITE) feature. Because we don't touch the size of the configuration area, guests will not be able to actually make use of this without further patches. Reviewed-by:
Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by:
Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Sep 13, 2016
-
-
Daniel P. Berrangé authored
The qemu_chr_fe_write method will return -1 on EAGAIN if the chardev backend write would block. Almost no callers of the qemu_chr_fe_write() method check the return value, instead blindly assuming data was successfully sent. In most cases this will lead to silent data loss on interactive consoles, but in some cases (eg RNG EGD) it'll just cause corruption of the protocol being spoken. We unfortunately can't fix the virtio-console code, due to a bug in the Linux guest drivers, which would cause the entire Linux kernel to hang if we delay processing of the incoming data in any way. Fixing this requires first fixing the guest driver to not hold spinlocks while writing to the hvc device backend. Fixes bug: https://bugs.launchpad.net/qemu/+bug/1586756 Signed-off-by:
Daniel P. Berrange <berrange@redhat.com> Message-Id: <1473170165-540-4-git-send-email-berrange@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Daniel P. Berrangé authored
The write_console_data() method in sclpconsole-lm.c checks whether the return value of qemu_chr_fe_write() has the value of -EAGAIN and if so then increments the buffer offset by the value of EAGAIN. Fortunately qemu_chr_fe_write() will never return EAGAIN directly, rather it returns -1 with errno set to EAGAIN, so this broken code path was not reachable. The behaviour on EAGAIN was stil bad though, causing the write_console_data() to busy_wait repeatedly calling qemu_chr_fe_write() with no sleep between iters. Just remove all this loop logic and replace with a call to qemu_chr_fe_write_all(). Acked-by:
Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com> Message-Id: <1473170165-540-3-git-send-email-berrange@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-