- Sep 19, 2023
-
-
hongmianquan authored
When updating ioeventfds, we need to iterate all address spaces, but some address spaces do not register eventfd_add|del call when memory_listener_register() and they do nothing when updating ioeventfds. So we can skip these AS in address_space_update_ioeventfds(). The overhead of memory_region_transaction_commit() can be significantly reduced. For example, a VM with 8 vhost net devices and each one has 64 vectors, can reduce the time spent on memory_region_transaction_commit by 20%. Message-ID: <20230830032906.12488-1-hongmianquan@bytedance.com> Reviewed-by:
Peter Xu <peterx@redhat.com> Signed-off-by:
hongmianquan <hongmianquan@bytedance.com> Signed-off-by:
David Hildenbrand <david@redhat.com>
-
David Hildenbrand authored
There is a difference between how we open a file and how we mmap it, and we want to support writable private mappings of readonly files. Let's define RAM_READONLY and RAM_READONLY_FD flags, to replace the single "readonly" parameter for file-related functions. In memory_region_init_ram_from_fd() and memory_region_init_ram_from_file(), initialize mr->readonly based on the new RAM_READONLY flag. While at it, add some RAM_* flags we missed to add to the list of accepted flags in the documentation of some functions. No change in functionality intended. We'll make use of both flags next and start setting them independently for memory-backend-file. Message-ID: <20230906120503.359863-3-david@redhat.com> Acked-by:
Peter Xu <peterx@redhat.com> Signed-off-by:
David Hildenbrand <david@redhat.com>
-
David Hildenbrand authored
Currently, when using a true R/O NVDIMM (ROM memory backend) with a label area, the VM can easily crash QEMU by trying to write to the label area, because the ROM memory is mmap'ed without PROT_WRITE. [root@vm-0 ~]# ndctl disable-region region0 disabled 1 region [root@vm-0 ~]# ndctl zero-labels nmem0 -> QEMU segfaults Let's remember whether we have a ROM memory backend and properly reject the write request: [root@vm-0 ~]# ndctl disable-region region0 disabled 1 region [root@vm-0 ~]# ndctl zero-labels nmem0 zeroed 0 nmem In comparison, on a system with a R/W NVDIMM: [root@vm-0 ~]# ndctl disable-region region0 disabled 1 region [root@vm-0 ~]# ndctl zero-labels nmem0 zeroed 1 nmem For ACPI, just return "unsupported", like if no label exists. For spapr, return "H_P2", similar to when no label area exists. Could we rely on the "unarmed" property? Maybe, but it looks cleaner to only disallow what certainly cannot work. After all "unarmed=on" primarily means: cannot accept persistent writes. In theory, there might be setups where devices with "unarmed=on" set could be used to host non-persistent data (temporary files, system RAM, ...); for example, in Linux, admins can overwrite the "readonly" setting and still write to the device -- which will work as long as we're not using ROM. Allowing writing label data in such configurations can make sense. Message-ID: <20230906120503.359863-2-david@redhat.com> Fixes: dbd730e8 ("nvdimm: check -object memory-backend-file, readonly=on option") Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
David Hildenbrand <david@redhat.com>
-
- Sep 15, 2023
-
-
Richard Henderson authored
Detect PCLMUL in cpuinfo; implement the accel hook. Reviewed-by:
Ard Biesheuvel <ardb@kernel.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
Reviewed-by:
Ard Biesheuvel <ardb@kernel.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
Reviewed-by:
Ard Biesheuvel <ardb@kernel.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
Reviewed-by:
Ard Biesheuvel <ardb@kernel.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
Reviewed-by:
Ard Biesheuvel <ardb@kernel.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Sep 12, 2023
-
-
Thomas Huth authored
This update contains the required header changes for the "target/s390x: AP-passthrough for PV guests" patch from Steffen Eiden. Message-ID: <20230912093432.180041-1-thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Marc-André Lureau authored
Ensure that it only get called when dpy_ui_info_supported(). The function should always return a result. There should be a non-null console or active_console. Modify the argument to be const as well. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Albert Esteve <aesteve@redhat.com>
-
Marc-André Lureau authored
Mostly for readability reasons. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Marc-André Lureau authored
It's already part of PIXMAN image. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Marc-André Lureau authored
They are QemuTextConsole functions, let's make it clear. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Marc-André Lureau authored
The function calls to `kbd_put_keysym` have been updated to now call `kbd_put_keysym_console` with a NULL console parameter. Like most console functions, NULL argument is now for the active console. This will allow to rename the text console functions in a consistent manner. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Akihiko Odaki <akihiko.odaki@daynix.com>
-
- Sep 11, 2023
-
-
Avihai Horon authored
Add a new .save_prepare() handler to struct SaveVMHandlers. This handler is called early, even before migration starts, and can be used by devices to perform early checks. Refactor migrate_init() to be able to return errors and call .save_prepare() from there. Suggested-by:
Peter Xu <peterx@redhat.com> Signed-off-by:
Avihai Horon <avihaih@nvidia.com> Reviewed-by:
Peter Xu <peterx@redhat.com> Reviewed-by:
Cédric Le Goater <clg@redhat.com> Signed-off-by:
Cédric Le Goater <clg@redhat.com>
-
Joao Martins authored
Move the PRE_COPY and RUNNING state checks to helper functions. This is in preparation for adding P2P VFIO migration support, where these helpers will also test for PRE_COPY_P2P and RUNNING_P2P states. Signed-off-by:
Joao Martins <joao.m.martins@oracle.com> Signed-off-by:
Avihai Horon <avihaih@nvidia.com> Reviewed-by:
Cédric Le Goater <clg@redhat.com> Tested-by:
YangHang Liu <yanghliu@redhat.com> Signed-off-by:
Cédric Le Goater <clg@redhat.com>
-
Avihai Horon authored
Add qdev_add_vm_change_state_handler_full() variant that allows setting a prepare callback in addition to the main callback. This will facilitate adding P2P support for VFIO migration in the following patches. Signed-off-by:
Avihai Horon <avihaih@nvidia.com> Signed-off-by:
Joao Martins <joao.m.martins@oracle.com> Reviewed-by:
Cédric Le Goater <clg@redhat.com> Tested-by:
YangHang Liu <yanghliu@redhat.com> Signed-off-by:
Cédric Le Goater <clg@redhat.com>
-
Avihai Horon authored
Add prepare callback to struct VMChangeStateEntry. The prepare callback is optional and can be set by the new function qemu_add_vm_change_state_handler_prio_full() that allows setting this callback in addition to the main callback. The prepare callbacks and main callbacks are called in two separate phases: First all prepare callbacks are called and only then all main callbacks are called. The purpose of the new prepare callback is to allow all devices to run a preliminary task before calling the devices' main callbacks. This will facilitate adding P2P support for VFIO migration where all VFIO devices need to be put in an intermediate P2P quiescent state before being stopped or started by the main callback. Signed-off-by:
Avihai Horon <avihaih@nvidia.com> Reviewed-by:
Cédric Le Goater <clg@redhat.com> Tested-by:
YangHang Liu <yanghliu@redhat.com> Signed-off-by:
Cédric Le Goater <clg@redhat.com>
-
Max Chou authored
Adds sm4_ck constant for use in sm4 cryptography across different targets. Signed-off-by:
Max Chou <max.chou@sifive.com> Reviewed-by:
Frank Chang <frank.chang@sifive.com> Signed-off-by:
Max Chou <max.chou@sifive.com> Message-ID: <20230711165917.2629866-15-max.chou@sifive.com> Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Max Chou authored
Allows sharing of sm4_subword between different targets. Signed-off-by:
Max Chou <max.chou@sifive.com> Reviewed-by:
Frank Chang <frank.chang@sifive.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Max Chou <max.chou@sifive.com> Message-ID: <20230711165917.2629866-14-max.chou@sifive.com> Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Ard Biesheuvel authored
The AES MixColumns and InvMixColumns operations are relatively expensive 4x4 matrix multiplications in GF(2^8), which is why C implementations usually rely on precomputed lookup tables rather than performing the calculations on demand. Given that we already carry those tables in QEMU, we can just grab the right value in the implementation of the RISC-V AES32 instructions. Note that the tables in question are permuted according to the respective Sbox, so we can omit the Sbox lookup as well in this case. Cc: Richard Henderson <richard.henderson@linaro.org> Cc: Philippe Mathieu-Daudé <philmd@linaro.org> Cc: Zewen Ye <lustrew@foxmail.com> Cc: Weiwei Li <liweiwei@iscas.ac.cn> Cc: Junqiang Wang <wangjunqiang@iscas.ac.cn> Signed-off-by:
Ard Biesheuvel <ardb@kernel.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-ID: <20230731084043.1791984-1-ardb@kernel.org> Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
- Sep 08, 2023
-
-
Shameer Kolothum authored
Now that we have Eager Page Split support added for ARM in the kernel, enable it in Qemu. This adds, -eager-split-size to -accel sub-options to set the eager page split chunk size. -enable KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE. The chunk size specifies how many pages to break at a time, using a single allocation. Bigger the chunk size, more pages need to be allocated ahead of time. Reviewed-by:
Gavin Shan <gshan@redhat.com> Signed-off-by:
Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Message-id: 20230905091246.1931-1-shameerali.kolothum.thodi@huawei.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Francisco Iglesias authored
Connect the Configuration Frame controller (CFRAME_REG) and the Configuration Frame broadcast controller (CFRAME_BCAST_REG) to the Versal machine. Signed-off-by:
Francisco Iglesias <francisco.iglesias@amd.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 20230831165701.2016397-9-francisco.iglesias@amd.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Francisco Iglesias authored
Connect the Configuration Frame Unit (CFU_APB, CFU_FDRO and CFU_SFR) to the Versal machine. Signed-off-by:
Francisco Iglesias <francisco.iglesias@amd.com> Acked-by:
Edgar E. Iglesias <edgar@zeroasic.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 20230831165701.2016397-8-francisco.iglesias@amd.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Francisco Iglesias authored
Introduce a model of Xilinx Versal's Configuration Frame broadcast controller (CFRAME_BCAST_REG). Signed-off-by:
Francisco Iglesias <francisco.iglesias@amd.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 20230831165701.2016397-7-francisco.iglesias@amd.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Francisco Iglesias authored
Introduce a model of Xilinx Versal's Configuration Frame controller (CFRAME_REG). Signed-off-by:
Francisco Iglesias <francisco.iglesias@amd.com> Message-id: 20230831165701.2016397-6-francisco.iglesias@amd.com Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Francisco Iglesias authored
Introduce a model of Xilinx Versal's Configuration Frame Unit's Single Frame Read port (CFU_SFR). Signed-off-by:
Francisco Iglesias <francisco.iglesias@amd.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 20230831165701.2016397-5-francisco.iglesias@amd.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Francisco Iglesias authored
Introduce a model of Xilinx Versal's Configuration Frame Unit's data out port (CFU_FDRO). Signed-off-by:
Francisco Iglesias <francisco.iglesias@amd.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 20230831165701.2016397-4-francisco.iglesias@amd.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Francisco Iglesias authored
Introduce a model of the software programming interface (CFU_APB) of Xilinx Versal's Configuration Frame Unit. Signed-off-by:
Francisco Iglesias <francisco.iglesias@amd.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 20230831165701.2016397-3-francisco.iglesias@amd.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Francisco Iglesias authored
Introduce the Xilinx Configuration Frame Interface (CFI) for transmitting CFI data packets between the Xilinx Configuration Frame Unit models (CFU_APB, CFU_FDRO and CFU_SFR), the Xilinx CFRAME controller (CFRAME_REG) and the Xilinx CFRAME broadcast controller (CFRAME_BCAST_REG) models (when emulating bitstream programming and readback). Signed-off-by:
Francisco Iglesias <francisco.iglesias@amd.com> Reviewed-by:
Sai Pavan Boddu <sai.pavan.boddu@amd.com> Acked-by:
Edgar E. Iglesias <edgar@zeroasic.com> Message-id: 20230831165701.2016397-2-francisco.iglesias@amd.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Kevin Wolf authored
Migration code can run both in coroutine context (the usual case) and non-coroutine context (at least savevm/loadvm for snapshots). This also affects the VMState callbacks, and devices must consider this. Change the callback definition in VMStateInfo to be explicit about it. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Message-ID: <20230905145002.46391-2-kwolf@redhat.com> Acked-by:
Peter Xu <peterx@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Fabiano Rosas authored
The last call site of this function has been removed by commit c04d0ab0 ("qemu-img: Let info print block graph"). Reviewed-by:
Claudio Fontana <cfontana@suse.de> Signed-off-by:
Fabiano Rosas <farosas@suse.de> Message-ID: <20230901184605.32260-2-farosas@suse.de> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Stefan Hajnoczi authored
CoMutex has poor performance when lock contention is high. The tracked requests list is accessed frequently and performance suffers in QEMU multi-queue block layer scenarios. It is not necessary to use CoMutex for the requests lock. The lock is always released across coroutine yield operations. It is held for relatively short periods of time and it is not beneficial to yield when the lock is held by another coroutine. Change the lock type from CoMutex to QemuMutex to improve multi-queue block layer performance. fio randread bs=4k iodepth=64 with 4 IOThreads handling a virtio-blk device with 8 virtqueues improves from 254k to 517k IOPS (+203%). Full benchmark results and configuration details are available here: https://gitlab.com/stefanha/virt-playbooks/-/commit/980c40845d540e3669add1528739503c2e817b57 In the future we may wish to introduce thread-local tracked requests lists to avoid lock contention completely. That would be much more involved though. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20230808155852.2745350-3-stefanha@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Philippe Mathieu-Daudé authored
Missed while reviewing commit dfd1b812 ("accel/tcg: Introduce translator_io_start"). Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
Michael Tokarev authored
Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org>
-
Michael Tokarev authored
Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru> Acked-by:
Alistair Francis <alistair.francis@wdc.com>
-
Stefan Hajnoczi authored
The ongoing QEMU multi-queue block layer effort makes it possible for multiple threads to process I/O in parallel. The nbd block driver is not compatible with the multi-queue block layer yet because QIOChannel cannot be used easily from coroutines running in multiple threads. This series changes the QIOChannel API to make that possible. In the current API, calling qio_channel_attach_aio_context() sets the AioContext where qio_channel_yield() installs an fd handler prior to yielding: qio_channel_attach_aio_context(ioc, my_ctx); ... qio_channel_yield(ioc); // my_ctx is used here ... qio_channel_detach_aio_context(ioc); This API design has limitations: reading and writing must be done in the same AioContext and moving between AioContexts involves a cumbersome sequence of API calls that is not suitable for doing on a per-request basis. There is no fundamental reason why a QIOChannel needs to run within the same AioContext every time qio_channel_yield() is called. QIOChannel only uses the AioContext while inside qio_channel_yield(). The rest of the time, QIOChannel is independent of any AioContext. In the new API, qio_channel_yield() queries the AioContext from the current coroutine using qemu_coroutine_get_aio_context(). There is no need to explicitly attach/detach AioContexts anymore and qio_channel_attach_aio_context() and qio_channel_detach_aio_context() are gone. One coroutine can read from the QIOChannel while another coroutine writes from a different AioContext. This API change allows the nbd block driver to use QIOChannel from any thread. It's important to keep in mind that the block driver already synchronizes QIOChannel access and ensures that two coroutines never read simultaneously or write simultaneously. This patch updates all users of qio_channel_attach_aio_context() to the new API. Most conversions are simple, but vhost-user-server requires a new qemu_coroutine_yield() call to quiesce the vu_client_trip() coroutine when not attached to any AioContext. While the API is has become simpler, there is one wart: QIOChannel has a special case for the iohandler AioContext (used for handlers that must not run in nested event loops). I didn't find an elegant way preserve that behavior, so I added a new API called qio_channel_set_follow_coroutine_ctx(ioc, true|false) for opting in to the new AioContext model. By default QIOChannel uses the iohandler AioHandler. Code that formerly called qio_channel_attach_aio_context() now calls qio_channel_set_follow_coroutine_ctx(ioc, true) once after the QIOChannel is created. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Acked-by:
Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20230830224802.493686-5-stefanha@redhat.com> [eblake: also fix migration/rdma.c] Signed-off-by:
Eric Blake <eblake@redhat.com>
-
Stefan Hajnoczi authored
aio_context is always NULL, so drop it. Suggested-by:
Fabiano Rosas <farosas@suse.de> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230830224802.493686-2-stefanha@redhat.com> Signed-off-by:
Eric Blake <eblake@redhat.com>
-
- Sep 07, 2023
-
-
Jeuk Kim authored
This commit adds support for ufs logical unit. The LU handles processing for the SCSI command, unit descriptor query request. This commit enables the UFS device to process IO requests. Signed-off-by:
Jeuk Kim <jeuk20.kim@samsung.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-id: beacc504376ab6a14b1a3830bb3c69382cf6aebc.1693980783.git.jeuk20.kim@gmail.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Jeuk Kim authored
Universal Flash Storage (UFS) is a high-performance mass storage device with a serial interface. It is primarily used as a high-performance data storage device for embedded applications. This commit contains code for UFS device to be recognized as a UFS PCI device. Patches to handle UFS logical unit and Transfer Request will follow. Signed-off-by:
Jeuk Kim <jeuk20.kim@samsung.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-id: 10232660d462ee5cd10cf673f1a9a1205fc8276c.1693980783.git.jeuk20.kim@gmail.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-