aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-01-12qom: remove unused headerIgor Mammedov1-1/+0
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1484052795-158195-2-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-01-12libqtest: handle zero length memwrite/memreadGreg Kurz2-1/+13
Some recently added tests pass a zero length to qtest_memwrite(). Unfortunately, the qtest protocol doesn't implement an on-the-wire syntax for zero-length writes and the current code happily sends garbage to QEMU. This causes intermittent failures. It isn't worth the pain to enhance the protocol, so this patch simply fixes the issue by "just return, doing nothing". The same fix is applied to qtest_memread() since the issue also exists in the QEMU part of the "memread" command. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 148412457273.22750.983275587432075569.stgit@bahia Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-01-10Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20170110-1' into ↵Peter Maydell13-28/+119
staging gtk,vnc: misc bugfixes. kbd: add jp keys, fix ps2 regressions. sdl: export window id for baum, remove sdl hooks from baum. egl: egl-helpers.c license change. # gpg: Signature made Tue 10 Jan 2017 07:16:05 GMT # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-ui-20170110-1: ps2: Fix lost scancodes by recent changes curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT) ui/vnc: Fix problem with sending too many bytes as server name gtk: avoid oob array access egl-helpers: Change file licensing to LGPLv2 sdl2: set window ID console: move window ID code from baum to sdl console: add API to get underlying gui window ID ui: use evdev keymap when running under wayland ui/gtk: fix crash at startup when no console is available Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-01-10Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell66-557/+1164
virtio, vhost, pc: fixes, features beginnings of iotlb support for vhost acpi hotplug rework vhost net tx flush on link down passing mtu to guests hotplug for virtio crypto fixes and cleanups all over the place Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Tue 10 Jan 2017 05:37:48 GMT # gpg: using RSA key 0x281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: (41 commits) acpi-test: update expected files memhp: move DIMM devices into dedicated scope with related common methods memhp: don't generate memory hotplug AML if it's not enabled/supported memhp: move memory hotplug only defines to memory_hotplug.c memhp: move GPE handler_E03 into build_memory_hotplug_aml() memhp: merge build_memory_devices() into build_memory_hotplug_aml() memhp: consolidate scattered MHPD device declaration memhp: move build_memory_devices() into memory_hotplug.c memhp: move build_memory_hotplug_aml() into memory_hotplug.c tests: pc: add memory hotplug acpi tables tests virtio-net: Add MTU feature support vhost-net: Notify the backend about the host MTU vhost-user: Add MTU protocol feature and op net: virtio-net discards TX data after link down virtio: Introduce virtqueue_drop_all procedure net: vhost stop updates virtio queue state net: Add virtio queue interface to update used index from vring state balloon: Don't balloon roms virtio: fix vq->inuse recalc after migr pcie_aer: support configurable AER capa version ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-01-10ps2: Fix lost scancodes by recent changesOGAWA Hirofumi3-1/+18
With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one. This adds some missing qcodes/scancodes what I found in using. [set1 and set3 are from <hpoussin@reactos.org>] Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT)Stefan Weil2-1/+3
For builds with Mingw-w64 as it is included in Cygwin, there are two header files which define KEY_EVENT with different values. This results in lots of compiler warnings like this one: CC vl.o In file included from /qemu/include/ui/console.h:340:0, from /qemu/vl.c:76: /usr/i686-w64-mingw32/sys-root/mingw/include/curses.h:1522:0: warning: "KEY_EVENT" redefined #define KEY_EVENT 0633 /* We were interrupted by an event */ In file included from /usr/share/mingw-w64/include/windows.h:74:0, from /usr/share/mingw-w64/include/winsock2.h:23, from /qemu/include/sysemu/os-win32.h:29, from /qemu/include/qemu/osdep.h:100, from /qemu/vl.c:24: /usr/share/mingw-w64/include/wincon.h:101:0: note: this is the location of the previous definition #define KEY_EVENT 0x1 QEMU only uses the KEY_EVENT macro from wincon.h. Therefore we can undefine the macro coming from curses.h. The explicit include statement for curses.h in ui/curses.c is not needed and was removed. Those two modifications fix the redefinition warnings. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Message-id: 20161119185318.10564-1-sw@weilnetz.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10ui/vnc: Fix problem with sending too many bytes as server nameThomas Huth1-2/+6
If the buffer is not big enough, snprintf() does not return the number of bytes that have been written to the buffer, but the number of bytes that would be needed for writing the whole string. By using this value for the following vnc_write() calls, we send some junk at the end of the name in case the qemu_name is longer than 1017 bytes, which could confuse the VNC clients. Fix this by adding an additional size check here. Buglink: https://bugs.launchpad.net/qemu/+bug/1637447 Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1479749115-21932-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10gtk: avoid oob array accessMarc-André Lureau1-0/+5
When too many consoles are created, vcs[] may be write out-of-bounds. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20161207105511.25173-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10egl-helpers: Change file licensing to LGPLv2Frediano Ziglio1-0/+16
The relicense permits sharing the code with Spice which is LGPL. All people listed below have agreed to the relicense: - Arei Gonglei; - Cole Robinson; - Gerd Hoffmann; - Peter Maydell. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Cole Robinson <crobinso@redhat.com> Acked-by: Gonglei <arei.gonglei@huawei.com> Acked-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20161208104539.3045-1-fziglio@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10sdl2: set window IDSamuel Thibault1-0/+7
This uses the console API to record the window ID of the SDL2 windows. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Message-id: 20161221003806.22412-4-samuel.thibault@ens-lyon.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10console: move window ID code from baum to sdlSamuel Thibault2-23/+33
This moves the SDL bits for window ID from the baum driver to SDL, as well as fixing the build for non-X11. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Message-id: 20161221003806.22412-3-samuel.thibault@ens-lyon.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10console: add API to get underlying gui window IDSamuel Thibault2-0/+15
This adds two console functions, qemu_console_set_window_id and qemu_graphic_console_get_window_id, to let graphical backend record the window id in the QemuConsole structure, and let the baum driver read it. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Message-id: 20161221003806.22412-2-samuel.thibault@ens-lyon.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10ui: use evdev keymap when running under waylandDaniel P. Berrange2-0/+11
Wayland always uses evdev as its input source, so QEMU can use the existing evdev keymap data Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20161201094117.16407-1-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10ui/gtk: fix crash at startup when no console is availableHervé Poussineau1-1/+5
This patch fixes a segfault at QEMU startup, introduced in a08156321ab9a7d2fed9ee77dbfeea2a61ffd153. gd_vc_find_current() return NULL, which is dereferenced without checking it. While at it, disable the whole 'View' menu if no console exists. Reproducer: qemu-system-i386 -M none -nodefaults Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1483263585-8101-1-git-send-email-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10acpi-test: update expected filesMichael S. Tsirkin10-0/+0
clean up warnings after latest hotplug changes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10memhp: move DIMM devices into dedicated scope with related common methodsIgor Mammedov1-93/+97
Move DIMM devices from global _SB scope to a new \_SB.MHPC container along with common methods used by DIMMs: MCRS, MRST, MPXM, MOST, MEJ00, MSCN, MTFY this reduces AML size on 12 * #slots bytes, i.e. up to 3072 bytes for 265 slots. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2017-01-10memhp: don't generate memory hotplug AML if it's not enabled/supportedIgor Mammedov6-20/+23
That reduces DSDT by 910 bytes when memory hotplug isn't enabled. While doing so drop intermediate variables/arguments passing around ACPI_MEMORY_HOTPLUG_IO_LEN and making it local to memory_hotplug.c, hardcoding it there as it can't change. Also don't pass around ACPI_MEMORY_HOTPLUG_BASE through intermediate variables/arguments where it's not needed. Instead initialize in module static variable when MMIO region is mapped and use that within memory_hotplug.c whenever it's required. That way MMIO base specified only at one place and AML with MMIO would always use the same value. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2017-01-10memhp: move memory hotplug only defines to memory_hotplug.cIgor Mammedov3-25/+24
Move defines used locally only by memory_hotplug.c into it from header files. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2017-01-10memhp: move GPE handler_E03 into build_memory_hotplug_aml()Igor Mammedov3-23/+32
>From this patch all the memory hotplug related AML bits are consolidated in one place within DSTD. Follow up patches will utilize that to simplify memory hotplug related C/AML code. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2017-01-10memhp: merge build_memory_devices() into build_memory_hotplug_aml()Igor Mammedov3-44/+33
It consolidates memory hotplug AML in one place within DSDT Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10memhp: consolidate scattered MHPD device declarationIgor Mammedov2-64/+61
since static and dynamic parts of memory MHPD device are now in the same table (DSDT), there is no point keeping them scattered across the table, so consolidate it in one place. There aren't any functional change, only AML text movement from externally refferenced MHPD scope directly into MHPD device declaration. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2017-01-10memhp: move build_memory_devices() into memory_hotplug.cIgor Mammedov3-124/+126
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2017-01-10memhp: move build_memory_hotplug_aml() into memory_hotplug.cIgor Mammedov3-263/+248
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2017-01-10tests: pc: add memory hotplug acpi tables testsIgor Mammedov5-0/+24
This also adds SRAT and DSDT blobs for memory hotplug variant Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2017-01-10virtio-net: Add MTU feature supportMaxime Coquelin2-0/+20
This patch allows advising guest with host MTU's by setting host_mtu parameter. If VIRTIO_NET_F_MTU has been successfully negotiated, MTU value is passed to the backend. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Aaron Conole <aconole@redhat.com Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10vhost-net: Notify the backend about the host MTUMaxime Coquelin2-0/+20
This patch provides a way for virtio-net to notify the backend about the host MTU set by the user. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Aaron Conole <aconole@redhat.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10vhost-user: Add MTU protocol feature and opMaxime Coquelin3-0/+52
This patch implements VHOST_USER_PROTOCOL_F_NET_MTU protocol feature and VHOST_USER_NET_SET_MTU request so that the backend gets notified of the user defined host MTU. If backend supports VHOST_USER_PROTOCOL_F_REPLY_ACK, QEMU assumes MTU is valid if success is returned. Vhost-net driver sends this request through a new vhost_net_set_mtu vhost_ops entry. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Aaron Conole <aconole@redhat.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10net: virtio-net discards TX data after link downYuri Benditovich1-0/+26
https://bugzilla.redhat.com/show_bug.cgi?id=1295637 Upon set_link monitor command or upon netdev deletion virtio-net sends link down indication to the guest and stops vhost if one is used. Guest driver can still submit data for TX until it recognizes link loss. If these packets not returned by the host, the Windows guest will never be able to finish disable/removal/shutdown. Now each packet sent by guest after NIC indicated link down will be completed immediately. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10virtio: Introduce virtqueue_drop_all procedureYuri Benditovich2-0/+39
Add procedure for fast drop of queued packets, acting like pop and push without mapping the buffers into memory. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10net: vhost stop updates virtio queue stateYuri Benditovich1-0/+1
Make virtio queue suitable for push operation from qemu after vhost was stopped. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10net: Add virtio queue interface to update used index from vring stateYuri Benditovich2-0/+6
Bring virtio queue to correct internal state for host-to-guest operations when vhost is temporary stopped. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10balloon: Don't balloon romsDr. David Alan Gilbert2-1/+8
A broken guest can specify physical addresses that correspond to any memory region, but it shouldn't be able to change ROM. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Cc: qemu-stable@nongnu.org Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10virtio: fix vq->inuse recalc after migrHalil Pasic1-3/+5
Correct recalculation of vq->inuse after migration for the corner case where the avail_idx has already wrapped but used_idx not yet. Also change the type of the VirtQueue.inuse to unsigned int. This is done to be consistent with other members representing sizes (VRing.num), and because C99 guarantees max ring size < UINT_MAX but does not guarantee max ring size < INT_MAX. Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com> Fixes: bccdef6b ("virtio: recalculate vq->inuse after migration") CC: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-01-10pcie_aer: support configurable AER capa versionDou Liyang6-9/+13
Now, AER capa version is fixed to v2, if assigned device isn't v2, then this value will be inconsistent between guest and host Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10pcie_aer: Convert pcie_aer_init to ErrorCao jin6-16/+16
When user specify invalid value for property aer_log_max, device should fail to create, and report appropriate message. Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Acked-by: Dmitry Fleytman <dmitry@daynix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10virtio-crypto: zeroize the key material before freeGonglei1-1/+12
Common practice with sensitive information (key material, passwords, etc). Prevents sensitive information from being exposed by accident later in coredumps, memory disclosure bugs when heap memory is reused, etc. Sensitive information is sometimes also held in mlocked pages to prevent it being swapped to disk but that's not being done here. Let's zeroize the memory of CryptoDevBackendSymOpInfo structure pointed for key material security. [Thanks to Stefan for help with crafting the commit message] Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10virtio-crypto-pci: tag virtio-crypto device hot pluggableGonglei1-1/+0
After resolving the relationship with cryptodev backend, the virtio crypto device supports hotplug now. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10virtio-crypto: avoid one cryptodev device is used by multiple virtio crypto ↵Gonglei1-1/+15
devices Add the check condition for cryptodev device in order to avoid one cryptodev device is used by multiple virtio crypto devices. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10virtio-crypto-pci: add check for cryptodev objectGonglei1-0/+5
We must assure each virtio crypto pci device has an vaild cryptodev backend object. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10cryptodev: wrap the ready flagGonglei4-6/+36
The ready flag should be set by the children of cryptodev backend interface. Warp the setter/getter functions for it. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10cryptodev: introduce a new is_used propertyGonglei3-0/+44
This property is used to Tag the cryptodev backend is used by virtio-crypto or not. Making cryptodev can't be hot unplugged when it's in use. Cleanup resources when cryptodev is finalized. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10virtio-crypto: use the correct length for cipher operationGonglei1-1/+1
In some modes of cipher algorithms, the length of destination data maybe larger then source data, such as ciphertext stealing (CTS). For symmetric algorithms, the length of ciphertext is definitly equal to the plaintext for each crypto operation. So we should use the src_len instead of dst_len avoid to pass the incorrect cryptographical results to the frontend driver. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10doc/pcie: correct command line examplesCao jin1-6/+6
Nit picking: Multi-function PCI Express Root Ports should mean that 'addr' property is mandatory, and slot is optional because it defaults to 0, and 'chassis' is mandatory for 2nd & 3rd root port because it defaults to 0 too. Bonus: fix a typo(2->3) Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-01-10memory: handle alias in memory_region_is_iommu()Jason Wang1-0/+3
Cc: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> 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> Reviewed-by: Peter Xu <peterx@redhat.com>
2017-01-10memory: handle alias for iommu notifierJason Wang1-0/+9
Cc: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> 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> Reviewed-by: Peter Xu <peterx@redhat.com>
2017-01-10acpi: add ATSR for q35Jason Wang2-0/+21
This patch provides ATSR which was a requirement for software that wants to enable ATS on endpoint devices behind a Root Port. This is done simply by setting ALL_PORTS which indicates all PCI-Express Root Ports support ATS transactions. 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>
2017-01-10virtio-pci: address space translation service (ATS) supportJason Wang5-0/+31
This patches enable the Address Translation Service support for virtio pci devices. This is needed for a guest visible Device IOTLB implementation and will be required by vhost device IOTLB API implementation for intel IOMMU. Cc: Michael S. Tsirkin <mst@redhat.com> 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>
2017-01-10intel_iommu: support device iotlb descriptorJason Wang4-7/+107
This patch enables device IOTLB support for intel iommu. The major work is to implement QI device IOTLB descriptor processing and notify the device through iommu notifier. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> 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> Reviewed-by: Peter Xu <peterx@redhat.com>
2017-01-10exec: introduce address_space_get_iotlb_entry()Jason Wang2-0/+38
This patch introduces a helper to query the iotlb entry for a possible iova. This will be used by later device IOTLB API to enable the capability for a dataplane (e.g vhost) to query the IOTLB. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com> Cc: Richard Henderson <rth@twiddle.net> Acked-by: Paolo Bonzini <pbonzini@redhat.com> 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>
2017-01-10intel_iommu: allocate new key when creating new address spaceJason Wang1-2/+3
We use the pointer to stack for key for new address space, this will break hash table searching, fixing by g_malloc() a new key instead. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Peter Xu <peterx@redhat.com> 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>