- Sep 20, 2023
-
-
Kevin Wolf authored
The function reads the parents list, so it needs to hold the graph lock. This happens to result in BlockDriver.bdrv_set_perm() to be called with the graph lock held. For consistency, make it the same for all of the BlockDriver callbacks for updating permissions and annotate the function pointers with GRAPH_RDLOCK_PTR. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20230911094620.45040-15-kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Kevin Wolf authored
The function reads the parents list, so it needs to hold the graph lock. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20230911094620.45040-14-kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Kevin Wolf authored
Instead of taking the writer lock internally, require callers to already hold it when calling bdrv_attach_child_common(). These callers will typically already hold the graph lock once the locking work is completed, which means that they can't call functions that take it internally. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20230911094620.45040-13-kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Kevin Wolf authored
Add a new wrapper type for GRAPH_WRLOCK functions that should be called from coroutine context. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20230911094620.45040-7-kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Kevin Wolf authored
bdrv_unref() is called by a lot of places that need to hold the graph lock (it naturally happens in the context of operations that change the graph). However, bdrv_unref() takes the graph writer lock internally, so it can't actually be called while already holding a graph lock without causing a deadlock. bdrv_unref() also can't just become GRAPH_WRLOCK because it drains the node before closing it, and draining requires that the graph is unlocked. The solution is to defer deleting the node until we don't hold the lock any more and draining is possible again. Note that keeping images open for longer than necessary can create problems, too: You can't open an image again before it is really closed (if image locking didn't prevent it, it would cause corruption). Reopening an image immediately happens at least during bdrv_open() and bdrv_co_create(). In order to solve this problem, make sure to run the deferred unref in bdrv_graph_wrunlock(), i.e. the first possible place where we can drain again. This is also why bdrv_schedule_unref() is marked GRAPH_WRLOCK. The output of iotest 051 is updated because the additional polling changes the order of HMP output, resulting in a new "(qemu)" prompt in the test output that was previously on a separate line and filtered out. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Message-ID: <20230911094620.45040-6-kwolf@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- 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 18, 2023
-
-
Cédric Le Goater authored
NVLink2 support was removed from the PPC PowerNV platform and VFIO in Linux 5.13 with commits : 562d1e207d32 ("powerpc/powernv: remove the nvlink support") b392a1989170 ("vfio/pci: remove vfio_pci_nvlink2") This was 2.5 years ago. Do the same in QEMU with a revert of commit ec132efa ("spapr: Support NVIDIA V100 GPU with NVLink2"). Some adjustements are required on the NUMA part. Cc: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Daniel Henrique Barboza <danielhb413@gmail.com> Acked-by:
Alex Williamson <alex.williamson@redhat.com> Signed-off-by:
Cédric Le Goater <clg@redhat.com> Message-ID: <20230918091717.149950-1-clg@kaod.org> Signed-off-by:
Daniel Henrique Barboza <danielhb413@gmail.com>
-
Yuri Benditovich authored
Tap indicates support for USO features according to capabilities of current kernel module. Signed-off-by:
Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by:
Andrew Melnychecnko <andrew@daynix.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
Andrew Melnychenko authored
Passing additional parameters (USOv4 and USOv6 offloads) when setting TAP offloads Signed-off-by:
Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by:
Andrew Melnychenko <andrew@daynix.com> Signed-off-by:
Jason Wang <jasowang@redhat.com>
-
- Sep 16, 2023
-
-
LIU Zhiwei authored
We missed these functions when upstreaming the bfloat16 support. Signed-off-by:
LIU Zhiwei <zhiwei_liu@linux.alibaba.com> Message-Id: <20230531065458.2082-1-zhiwei_liu@linux.alibaba.com> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
Rather than saving MemoryRegionSection and offset, save phys_addr and MemoryRegion. This matches up much closer with the plugin api. Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
Now that we defer address space update and tlb_flush until the next async_run_on_cpu, the plugin run at the end of the instruction no longer has to contend with a flushed tlb. Therefore, delete SavedIOTLB entirely. Properly return false from tlb_plugin_lookup when we do not have a tlb match. Fixes a bug in which SavedIOTLB had stale data, because there were multiple i/o accesses within a single insn. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Tested-by:
Song Gao <gaosong@loongson.cn> Reviewed-by:
Song Gao <gaosong@loongson.cn> Message-Id: <20230831030904.1194667-2-richard.henderson@linaro.org>
-
- 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>
-
Akihiko Odaki authored
Alpha, IA-64, and PA-RISC hosts are no longer supported. Signed-off-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20230808152314.102036-1-akihiko.odaki@daynix.com> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
LIU Zhiwei authored
When memory region is ram, the lower TARGET_PAGE_BITS is not the physical section number. Instead, its value is always 0. Add comment and assert to make it clear. Signed-off-by:
LIU Zhiwei <zhiwei_liu@linux.alibaba.com> Message-Id: <20230901060118.379-1-zhiwei_liu@linux.alibaba.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.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>
-