aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-27virtio-gpu: Add helpers to create and destroy dmabuf objectsVivek Kasireddy
These helpers can be useful for creating dmabuf objects from blobs and submitting them to the UI. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-12-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27ui/pixman: Add qemu_pixman_to_drm_format()Vivek Kasireddy
This new function to get the drm_format associated with a pixman format will be useful while creating a dmabuf. Based-on-patch-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-11-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27virtio-gpu: Add virtio_gpu_resource_create_blobVivek Kasireddy
This API allows Qemu to register the blob allocated by the Guest as a new resource and map its backing storage. Based-on-patch-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-10-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27virtio-gpu: Add initial definitions for blob resourcesVivek Kasireddy
Add the property bit, configuration flag and other relevant macros and definitions associated with this feature. Based-on-patch-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-9-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27virtio-gpu: Refactor virtio_gpu_create_mapping_iovVivek Kasireddy
Instead of passing the attach_backing object to extract nr_entries and offset, explicitly pass these as arguments to this function. This will be helpful when adding create_blob API. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-8-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27virtio-gpu: Refactor virtio_gpu_set_scanoutVivek Kasireddy
Store the meta-data associated with a FB in a new object (struct virtio_gpu_framebuffer) and pass the object to set_scanout. Also move code in set_scanout into a do_set_scanout function. This will be helpful when adding set_scanout_blob API. Based-on-patch-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-7-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27virtio-gpu: Add virtio_gpu_find_check_resourceVivek Kasireddy
Move finding the resource and validating its backing storage into one function. Based-on-patch-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-6-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27stubs: Add stubs for udmabuf helpersVivek Kasireddy
This is needed to ensure that virtio-gpu device works for non-linux builds. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-5-vivek.kasireddy@intel.com> [ kraxel: add virtio-gpu-udmabuf.c stubs only when building system emulation ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27virtio-gpu: Add udmabuf helpersVivek Kasireddy
Add helper functions to create a dmabuf for a resource and mmap it. Also, introduce the fields blob and blob_size so that these helpers can start to use them but the full picture will emerge only after adding create_blob API in patch 8 of this series. To be able to create a dmabuf using the udmabuf driver, Qemu needs to be lauched with the memfd memory backend like this: qemu-system-x86_64 -m 8192m -object memory-backend-memfd,id=mem1,size=8192M -machine memory-backend=mem1 Based-on-patch-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-4-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27headers: Add udmabuf.hVivek Kasireddy
This adds udmabuf header to standard headers so that the relevant udmabuf objects can be accessed in subsequent patches. Based-on-patch-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-3-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27ui: Get the fd associated with udmabuf driverVivek Kasireddy
Try to open the udmabuf dev node for the first time or return the fd if the device was previously opened. Based-on-patch-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-2-vivek.kasireddy@intel.com> [ kraxel: fixup fcntl.h include ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27hw/display/qxl: Set pci rom address aligned with page sizemaobibo
On some MIPS system, page size is 16K, and qxl vga device can be used for VM in kvm mode. Qxl pci rom size is set 8K fixed, smaller than 16K page size on host system, it fails to be added into memslots in kvm mode where memory_size and GPA are required to align with page size. This patch fixes this issue. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Message-Id: <1621340448-31617-1-git-send-email-maobibo@loongson.cn> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27vhost-user-gpu: abstract vg_cleanup_mapping_iovLi Qiang
Currently in vhost-user-gpu, we free resource directly in the cleanup case of resource. If we change the cleanup logic we need to change several places, also abstruct a 'vg_create_mapping_iov' can be symmetry with the 'vg_create_mapping_iov'. This is like what virtio-gpu does, no function changed. Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210516030403.107723-9-liq3ea@163.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27vhost-user-gpu: fix OOB write in 'virgl_cmd_get_capset' (CVE-2021-3546)Li Qiang
If 'virgl_cmd_get_capset' set 'max_size' to 0, the 'virgl_renderer_fill_caps' will write the data after the 'resp'. This patch avoid this by checking the returned 'max_size'. virtio-gpu fix: abd7f08b23 ("display: virtio-gpu-3d: check virgl capabilities max_size") Fixes: CVE-2021-3546 Reported-by: Li Qiang <liq3ea@163.com> Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210516030403.107723-8-liq3ea@163.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27vhost-user-gpu: fix memory leak in 'virgl_resource_attach_backing' ↵Li Qiang
(CVE-2021-3544) If 'virgl_renderer_resource_attach_iov' failed, the 'res_iovs' will be leaked. Fixes: CVE-2021-3544 Reported-by: Li Qiang <liq3ea@163.com> virtio-gpu fix: 33243031da ("virtio-gpu-3d: fix memory leak in resource attach backing") Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210516030403.107723-7-liq3ea@163.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27vhost-user-gpu: fix memory leak in 'virgl_cmd_resource_unref' (CVE-2021-3544)Li Qiang
The 'res->iov' will be leaked if the guest trigger following sequences: virgl_cmd_create_resource_2d virgl_resource_attach_backing virgl_cmd_resource_unref This patch fixes this. Fixes: CVE-2021-3544 Reported-by: Li Qiang <liq3ea@163.com> virtio-gpu fix: 5e8e3c4c75 ("virtio-gpu: fix resource leak in virgl_cmd_resource_unref" Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210516030403.107723-6-liq3ea@163.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27vhost-user-gpu: fix memory leak while calling 'vg_resource_unref' ↵Li Qiang
(CVE-2021-3544) If the guest trigger following sequences, the attach_backing will be leaked: vg_resource_create_2d vg_resource_attach_backing vg_resource_unref This patch fix this by freeing 'res->iov' in vg_resource_destroy. Fixes: CVE-2021-3544 Reported-by: Li Qiang <liq3ea@163.com> virtio-gpu fix: 5e8e3c4c75 ("virtio-gpu: fix resource leak in virgl_cmd_resource_unref") Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210516030403.107723-5-liq3ea@163.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27vhost-user-gpu: fix memory leak in vg_resource_attach_backing (CVE-2021-3544)Li Qiang
Check whether the 'res' has already been attach_backing to avoid memory leak. Fixes: CVE-2021-3544 Reported-by: Li Qiang <liq3ea@163.com> virtio-gpu fix: 204f01b309 ("virtio-gpu: fix memory leak in resource attach backing") Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210516030403.107723-4-liq3ea@163.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27vhost-user-gpu: fix resource leak in 'vg_resource_create_2d' (CVE-2021-3544)Li Qiang
Call 'vugbm_buffer_destroy' in error path to avoid resource leak. Fixes: CVE-2021-3544 Reported-by: Li Qiang <liq3ea@163.com> Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210516030403.107723-3-liq3ea@163.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-27vhost-user-gpu: fix memory disclosure in virgl_cmd_get_capset_info ↵Li Qiang
(CVE-2021-3545) Otherwise some of the 'resp' will be leaked to guest. Fixes: CVE-2021-3545 Reported-by: Li Qiang <liq3ea@163.com> virtio-gpu fix: 42a8dadc74 ("virtio-gpu: fix information leak in getting capset info dispatch") Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210516030403.107723-2-liq3ea@163.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26Merge remote-tracking branch ↵Peter Maydell
'remotes/kraxel/tags/input-20210526-pull-request' into staging input: a bunch of ps2 fixes. # gpg: Signature made Wed 26 May 2021 15:06:12 BST # gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/input-20210526-pull-request: hw/input/ps2: Use ps2_raise_irq() instead of open coding it pckbd: clear outport_present in outer pre_load() pckbd: remove duplicated keyboard and mouse defines pckbd: correctly disable PS/2 communication pckbd: add function kbd_pending() pckbd: add controller response queue pckbd: add state variable for interrupt source pckbd: PS/2 keyboard throttle pckbd: don't update OBF flags if KBD_STAT_OBF is set pckbd: split out interrupt line changing code ps2: don't deassert irq twice if queue is empty ps2: don't raise an interrupt if queue is full ps2: fix mouse stream corruption hw/input: expand trace info reported for ps2 device Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-26hw/input/ps2: Use ps2_raise_irq() instead of open coding itPhilippe Mathieu-Daudé
Inspired-by: Volker Rümelin <vr_qemu@t-online.de> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Message-Id: <20210513171244.3940519-1-f4bug@amsat.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26pckbd: clear outport_present in outer pre_load()Volker Rümelin
The variable outport_present is a flag to show if the outport subsection was loaded. Clear the outport_present flag in the outer pre_load() function. This method is recommended in the QEMU manual for developers in the chapter "Migration, Subsections". Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-12-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26pckbd: remove duplicated keyboard and mouse definesVolker Rümelin
In 2005 the author of commit daa579632d "PS2 mouse and keyboard separation (Paul Brook)" and 0e43e99c04 "PS2 mouse and keyboard separation (Paul Brook)" separated the PS/2 controller code and the PS/2 keyboard and mouse code. It seems he forgot to remove a few defines. Remove them now. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-11-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26pckbd: correctly disable PS/2 communicationVolker Rümelin
Currently the PS/2 controller command KBD_CCMD_MOUSE_DISABLE doesn't disable the PS/2 mouse communication at all, and the PS/2 controller commands KBD_CCMD_KBD_DISABLE and KBD_CCMD_KBD_ENABLE only disable and enable the keyboard interrupt, which is very different from what a real PS/2 controller does. A guest may notice the difference. Mask out pending data on disabled queues to correctly disable the PS/2 controller communication. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-10-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26pckbd: add function kbd_pending()Volker Rümelin
Replace reads of the variable s->pending with a call to a new function kbd_pending() to ease the review of the next patch. There is no functional change. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-9-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26pckbd: add controller response queueVolker Rümelin
Add a separate queue for PS/2 controller responses. The responses no longer get queued in the keyboard or mouse queues. The advantage of this can be seen after the next two patches, where the guest can disable the PS/2 communication with keyboard and mouse and still talk to the PS/2 controller. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-8-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26pckbd: add state variable for interrupt sourceVolker Rümelin
Currently there is only one flag to distinguish between two interrupt sources and there are no available flags for more sources. Add an internal state variable to store the interrupt source. The next patch will introduce an additional interrupt source. There is no functional change. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-7-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26pckbd: PS/2 keyboard throttleVolker Rümelin
Limit the keyboard data rate to the serial link speed. Some old DOS software relies on being able to read an incoming scan-code more than once. After reading keyboard data from the i8042 controller, the guest software has 1ms to read the same data again. Use -global i8042.kbd-throttle=on to enable this feature. To see how this patch works, start a FreeDOS 1.2 guest with the qemu option -global i8042.kbd-throttle=on and open a text file with the vim 7.3 32 bit for DOS executable. Then use the cursor keys (not the cursor keys on the numeric keypad) to move through the text. Without the kbd-throttle option enabled each keystroke will move the cursor two positions. Buglink: https://bugs.launchpad.net/bugs/1895363 Buglink: https://bugs.launchpad.net/bugs/1897568 Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-6-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26pckbd: don't update OBF flags if KBD_STAT_OBF is setVolker Rümelin
Don't update the OBF flags in the status register and the cor- responding IRQ lines if KBD_STAT_OBF is set. Otherwise this may change the PS/2 event type. If the guest ISR was already scheduled, the changed event type will be rather surprising for the guest. This fixes a mouse event stream corruption. To reproduce the problem start a FreeDOS 1.2 guest with -machine pc,accel=kvm and -display gtk. The KVM in-kernel irqchip has to be enabled. Now open a text file with edit.exe in the guest and hold down the cursor right key and at the same time move the mouse around. You will quickly notice erratic mouse movements and unexpected mouse clicks. A trace file shows the mouse event stream corruption. Guest rip 0xce93 (f000:ce93) is the in al,0x60 instruction in the seabios mouse ISR, guest rip 0xceca (f000:ceca) is the in al,0x60 instruction in the seabios keyboard ISR. qemu-system-x86-5659 [007] .... 280.971116: tracing_mark_write: pckbd_kbd_update_irq kbd=0 aux=1 # gtk queues a mouse event qemu-system-x86-5665 [000] .... 280.971121: kvm_exit: reason EXTERNAL_INTERRUPT rip 0x22da info 0 800000fd qemu-system-x86-5665 [000] d..1 280.971122: kvm_entry: vcpu 0, rip 0x22da qemu-system-x86-5665 [000] .... 280.971123: kvm_exit: reason EXTERNAL_INTERRUPT rip 0x22da info 0 800000fd qemu-system-x86-5665 [000] d..1 280.971124: kvm_entry: vcpu 0, rip 0x22da qemu-system-x86-5665 [000] .... 280.971126: kvm_exit: reason IO_INSTRUCTION rip 0x110c8c info 640008 0 qemu-system-x86-5665 [000] .... 280.971176: tracing_mark_write: pckbd_kbd_read_status 0x3d # KBD_STAT_OBF and KBD_STAT_MOUSE_OBF set, the mouse ISR will # read data from the PS/2 controller. qemu-system-x86-5665 [000] d..1 280.971180: kvm_entry: vcpu 0, rip 0x110c8d qemu-system-x86-5665 [000] .... 280.971191: kvm_exit: reason EXTERNAL_INTERRUPT rip 0x110c8d info 0 800000f6 qemu-system-x86-5665 [000] d..1 280.971191: kvm_entry: vcpu 0, rip 0x110c8d qemu-system-x86-5665 [000] .... 280.971193: kvm_exit: reason IO_INSTRUCTION rip 0xce93 info 600048 0 # the mouse ISR wants to read data from the PS/2 controller qemu-system-x86-5659 [007] .... 280.971231: tracing_mark_write: pckbd_kbd_update_irq kbd=1 aux=0 qemu-system-x86-5659 [007] .... 280.971238: tracing_mark_write: pckbd_kbd_update_irq kbd=1 aux=0 # gtk queues a keyboard event 0xe0 0x4d (key right) qemu-system-x86-5665 [000] .... 280.971257: tracing_mark_write: pckbd_kbd_update_irq kbd=0 aux=1 qemu-system-x86-5665 [000] .... 280.971262: tracing_mark_write: pckbd_kbd_update_irq kbd=1 aux=0 # ps2_read_data() deasserts and reasserts the keyboard IRQ qemu-system-x86-5665 [000] .... 280.971266: tracing_mark_write: pckbd_kbd_read_data 0xe0 kbd # -> the mouse ISR receives keyboard data qemu-system-x86-5665 [000] d..1 280.971268: kvm_entry: vcpu 0, rip 0xce95 qemu-system-x86-5665 [000] .... 280.971269: kvm_exit: reason IO_INSTRUCTION rip 0xe828 info a00040 0 qemu-system-x86-5665 [000] .... 280.971270: kvm_ack_irq: irqchip PIC slave pin 12 qemu-system-x86-5665 [000] d..1 280.971270: kvm_entry: vcpu 0, rip 0xe82a qemu-system-x86-5665 [000] .... 280.971271: kvm_exit: reason IO_INSTRUCTION rip 0xe82a info 200040 0 qemu-system-x86-5665 [000] .... 280.971271: kvm_ack_irq: irqchip PIC master pin 2 qemu-system-x86-5665 [000] d..1 280.971271: kvm_entry: vcpu 0, rip 0xe82c qemu-system-x86-5665 [000] .... 280.971272: kvm_exit: reason PENDING_INTERRUPT rip 0x22da info 0 0 qemu-system-x86-5665 [000] d..1 280.971273: kvm_entry: vcpu 0, rip 0x22da qemu-system-x86-5665 [000] .... 280.971274: kvm_exit: reason IO_INSTRUCTION rip 0x110c8c info 640008 0 qemu-system-x86-5665 [000] .... 280.971275: tracing_mark_write: pckbd_kbd_read_status 0x1d qemu-system-x86-5665 [000] d..1 280.971276: kvm_entry: vcpu 0, rip 0x110c8d qemu-system-x86-5665 [000] .... 280.971277: kvm_exit: reason IO_INSTRUCTION rip 0xceca info 600048 0 # the keyboard ISR wants to read data from the PS/2 controller qemu-system-x86-5665 [000] .... 280.971279: tracing_mark_write: pckbd_kbd_update_irq kbd=0 aux=1 qemu-system-x86-5665 [000] .... 280.971282: tracing_mark_write: pckbd_kbd_read_data 0x4d kbd # the keyboard ISR receives the second byte of the keyboard event Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-5-vr_qemu@t-online.de> [ kraxel: add missing include ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26pckbd: split out interrupt line changing codeVolker Rümelin
Split out the interrupt line changing code from kbd_update_irq(). This is a preparation for the next patch. There is no functional change. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-4-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26ps2: don't deassert irq twice if queue is emptyVolker Rümelin
Don't deassert the irq twice if the queue is empty. While the second deassertion doesn't do any harm, it's unnecessary. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26ps2: don't raise an interrupt if queue is fullVolker Rümelin
ps2_queue() behaves differently than the very similar functions ps2_queue_2() to ps2_queue_4(). The first one calls update_irq() even if the queue is full, the others don't. Change ps2_queue() to be consistent with the others. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26ps2: fix mouse stream corruptionVolker Rümelin
Commit 7abe7eb294 "ps2: Fix mouse stream corruption due to lost data" added code to avoid mouse stream corruptions but the calculation of the needed free queue size was wrong. Fix this. To reproduce, open a text file with the vim 7.3 32 bit for DOS exe- cutable in a FreeDOS client started with -display sdl and move the mouse around for a few seconds. You will quickly see erratic mouse movements and unexpected mouse clicks. CuteMouse (ctmouse.exe) in FreeDOS doesn't try to re-sync the mouse stream. Fixes: 7abe7eb294 ("ps2: Fix mouse stream corruption due to lost data") Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210525181441.27768-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-26hw/input: expand trace info reported for ps2 deviceDaniel P. Berrangé
It is interesting to know if the PS2 keyboard is in translated mode, and which of the three scancode sets are in use. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20210309155804.306051-1-berrange@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-05-25Merge remote-tracking branch ↵Peter Maydell
'remotes/stsquad/tags/pull-testing-and-misc-updates-250521-2' into staging Testing, gdbstub and plugin updates - ensure gitlab references master registry - add special rule for hexagon image - clean-up gdbstub's argument handling - fix replay HMP commands to accept long icount - minor re-factor of gdbstub replay handling - update syscall plugin to be more useful # gpg: Signature made Tue 25 May 2021 16:55:16 BST # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-testing-and-misc-updates-250521-2: plugins/syscall: Added a table-like summary output gdbstub: tidy away reverse debugging check into function hmp-commands: expand type of icount to "l" in replay commands gdbstub: Replace GdbCmdContext with plain g_array() gdbstub: Constify GdbCmdParseEntry gitlab: add special rule for the hexagon container gitlab: explicitly reference the upstream registry Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-25plugins/syscall: Added a table-like summary outputMahmoud Mandour
Added a table-like output which contains the total number of calls for each used syscall along with the number of errors that occurred. Per-call tracing is still available through supplying the argument ``print`` to the plugin. Signed-off-by: Mahmoud Mandour <ma.mandourr@gmail.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210519032409.3041-1-ma.mandourr@gmail.com> Message-Id: <20210520174303.12310-9-alex.bennee@linaro.org>
2021-05-25gdbstub: tidy away reverse debugging check into functionAlex Bennée
In theory we don't need an actual record/replay to enact reverse debugging on a purely deterministic system (i.e one with no external inputs running under icount). Tidy away the logic into a little function. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210520174303.12310-8-alex.bennee@linaro.org>
2021-05-25hmp-commands: expand type of icount to "l" in replay commandsAlex Bennée
This is not a 32 bit number, it can (and most likely will) be quite a big one. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210520174303.12310-7-alex.bennee@linaro.org>
2021-05-25gdbstub: Replace GdbCmdContext with plain g_array()Alex Bennée
Instead of jumping through hoops let glib deal with both tracking the number of elements and auto freeing the memory once we are done. This allows is to drop the usage of ALLOCA(3) which the man-page mentions its "use is discouraged". Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210520174303.12310-6-alex.bennee@linaro.org>
2021-05-25gdbstub: Constify GdbCmdParseEntryPhilippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210505170055.1415360-3-philmd@redhat.com> Message-Id: <20210520174303.12310-5-alex.bennee@linaro.org>
2021-05-25gitlab: add special rule for the hexagon containerAlex Bennée
The hexagon container is always manually built but of course not everyone will be building it themselves and pushing to their registries. We still need to create a "local" registry copy for the actual gitlab tests to run. We don't build it in this case, just pull it across from the upstream registry. We disable this rule from running on the qemu-project itself so it doesn't accidentally wipe out our master copy. Fixes: 910c40ee94 ("gitlab: add build-user-hexagon test") Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Cc: Cornelia Huck <cohuck@redhat.com> Message-Id: <20210520174303.12310-4-alex.bennee@linaro.org>
2021-05-25Merge remote-tracking branch ↵Peter Maydell
'remotes/pmaydell/tags/pull-target-arm-20210525' into staging target-arm queue: * Implement SVE2 emulation * Implement integer matrix multiply accumulate * Implement FEAT_TLBIOS * Implement FEAT_TLBRANGE * disas/libvixl: Protect C system header for C++ compiler * Use correct SP in M-profile exception return * AN524, AN547: Correct modelling of internal SRAMs * hw/intc/arm_gicv3_cpuif: Fix EOIR write access check logic * hw/arm/smmuv3: Another range invalidation fix # gpg: Signature made Tue 25 May 2021 16:02:25 BST # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "peter.maydell@linaro.org" # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@gmail.com>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20210525: (114 commits) target/arm: Enable SVE2 and related extensions linux-user/aarch64: Enable hwcap bits for sve2 and related extensions target/arm: Implement integer matrix multiply accumulate target/arm: Implement aarch32 VSUDOT, VUSDOT target/arm: Split decode of VSDOT and VUDOT target/arm: Split out do_neon_ddda target/arm: Fix decode for VDOT (indexed) target/arm: Remove unused fpst from VDOT_scalar target/arm: Split out do_neon_ddda_fpst target/arm: Implement aarch64 SUDOT, USDOT target/arm: Implement SVE2 fp multiply-add long target/arm: Move endian adjustment macros to vec_internal.h target/arm: Implement SVE2 bitwise shift immediate target/arm: Implement 128-bit ZIP, UZP, TRN target/arm: Implement SVE2 LD1RO target/arm: Tidy do_ldrq target/arm: Share table of sve load functions target/arm: Implement SVE2 FLOGB target/arm: Implement SVE2 FCVTXNT, FCVTX target/arm: Implement SVE2 FCVTLT ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-25target/arm: Enable SVE2 and related extensionsRichard Henderson
Disable I8MM again for !have_neon during realize. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-93-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-25linux-user/aarch64: Enable hwcap bits for sve2 and related extensionsRichard Henderson
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-92-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-25target/arm: Implement integer matrix multiply accumulateRichard Henderson
This is {S,U,US}MMLA for both AArch64 AdvSIMD and SVE, and V{S,U,US}MMLA.S8 for AArch32 NEON. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-91-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-25target/arm: Implement aarch32 VSUDOT, VUSDOTRichard Henderson
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-90-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-25target/arm: Split decode of VSDOT and VUDOTRichard Henderson
Now that we have a common helper, sharing decode does not save much. Also, this will solve an upcoming naming problem. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-89-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-25target/arm: Split out do_neon_dddaRichard Henderson
Split out a helper that can handle the 4-register format for helpers shared with SVE. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-88-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-25target/arm: Fix decode for VDOT (indexed)Richard Henderson
We were extracting the M register twice, once incorrectly as M:vm and once correctly as rm. Remove the incorrect name and remove the incorrect decode. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-87-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>